swig
examples
example2.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
"""
4
A GNSSTk example of reading a RINEX obs file.
5
6
This is a semi-port of the older C++ example2.cpp.
7
Usage:
8
python example2.py
9
10
"""
11
12
import
gnsstk
13
14
15
def
main
():
16
rfn = gnsstk.getPathData() +
'/test_input_rinex2_obs_RinexObsFile.06o'
17
header, data = gnsstk.readRinex3Obs(rfn, strict=
True
)
18
19
# Let's pretend we want to change something in the header
20
# (otherwise this would be a two-line example!)
21
header.receiverOffset = 47
22
23
# Now let's find the earliest and latest observations
24
# function for how to compare Rinex3ObsData objects for min/max functions:
25
timeFunction =
lambda
self: self.time
26
earliest =
min
(data, key=timeFunction)
27
latest =
max
(data, key=timeFunction)
28
29
print
'Earliest time found:'
,
gnsstk.CivilTime
(earliest.time)
30
print
'Latest time found: '
,
gnsstk.CivilTime
(latest.time)
31
32
# Now let's write it all back to a different file
33
gnsstk.writeRinex3Obs(
'rinex3obs_data.txt.new'
, header, data)
34
35
if
__name__ ==
'__main__'
:
36
main
()
gnsstk::max
T max(const SparseMatrix< T > &SM)
Maximum element - return 0 if empty.
Definition:
SparseMatrix.hpp:881
example2.main
def main()
Definition:
example2.py:15
gnsstk::min
T min(const SparseMatrix< T > &SM)
Maximum element - return 0 if empty.
Definition:
SparseMatrix.hpp:858
gnsstk::CivilTime
Definition:
CivilTime.hpp:55
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39