33[ ![ DOI] ( https://zenodo.org/badge/DOI/10.5281/zenodo.2580306.svg )] ( https://doi.org/10.5281/zenodo.2580306 )
44![ ci] ( https://github.com/geospace-code/georinex/workflows/ci/badge.svg )
55[ ![ Language grade: Python] ( https://img.shields.io/lgtm/grade/python/g/scivision/georinex.svg?logo=lgtm&logoWidth=18 )] ( https://lgtm.com/projects/g/scivision/georinex/context:python )
6- [ ![ PyPi versions] ( https://img.shields.io/pypi/pyversions/georinex.svg )] ( https://pypi.python.org/pypi/georinex )
76[ ![ PyPi Download stats] ( http://pepy.tech/badge/georinex )] ( http://pepy.tech/project/georinex )
87
98RINEX 3 and RINEX 2 reader and batch conversion to NetCDF4 / HDF5 in Python or Matlab.
@@ -112,6 +111,7 @@ Time bounds can be set for reading -- load only data between those time bounds:
112111``` sh
113112--tlim start stop
114113```
114+
115115option, where ` start ` and ` stop ` are formatted like ` 2017-02-23T12:00 `
116116
117117``` python
@@ -121,20 +121,20 @@ dat = gr.load('my.rnx', tlim=['2017-02-23T12:59', '2017-02-23T13:13'])
121121### Measurement selection
122122
123123Further speed increase can arise from reading only wanted measurements:
124+
124125``` sh
125126--meas C1C L1C
126127```
127128
128-
129129``` python
130130dat = gr.load(' my.rnx' , meas = [' C1C' , ' L1C' ])
131131```
132132
133133### Use Signal and Loss of Lock indicators
134+
134135By default, the SSI and LLI (loss of lock indicators) are not loaded to speed up the program and save memory.
135136If you need them, the ` -useindicators ` option loads SSI and LLI for OBS 2/3 files.
136137
137-
138138## read RINEX
139139
140140This convenience function reads any possible format (including compressed, Hatanaka) RINEX 2/3 OBS/NAV or ` .nc ` file:
@@ -143,19 +143,22 @@ This convenience function reads any possible format (including compressed, Hatan
143143obs = gr.load(' tests/demo.10o' )
144144```
145145
146-
147146### read times in OBS, NAV file(s)
147+
148148Print start, stop times and measurement interval in a RINEX OBS or NAV file:
149+
149150``` sh
150151TimeRinex ~ /my.rnx
151152```
152153
153154Print start, stop times and measurement interval for all files in a directory:
155+
154156``` sh
155157TimeRinex ~ /data * .rnx
156158```
157159
158160Get vector of ` datetime.datetime ` in RINEX file:
161+
159162``` python
160163times = gr.gettimes(' ~/my.rnx' )
161164```
@@ -180,9 +183,10 @@ only certain fields are valid for particular satellite systems.
180183Not every receiver receives every type of GNSS system.
181184Most Android devices in the Americas receive at least GPS and GLONASS.
182185
183-
184186### read OBS header
185- To get a ` dict() ` of the RINEX file header:
187+
188+ Get a ` dict() ` of the RINEX file header:
189+
186190``` python
187191hdr = gr.rinexheader(' myfile.rnx' )
188192```
@@ -191,33 +195,39 @@ hdr = gr.rinexheader('myfile.rnx')
191195
192196assume the OBS data from a file is loaded in variable ` obs ` .
193197
194- Select satellite(s) (here, ` G13 ` ) by
198+ Select satellite(s) (here, ` G13 ` )
199+
195200``` python
196201obs.sel(sv = ' G13' ).dropna(dim = ' time' ,how = ' all' )
197202```
198203
199204Pick any parameter (say, ` L1 ` ) across all satellites and time (or index via ` .sel() ` by time and/or satellite too) by:
205+
200206``` python
201207obs[' L1' ].dropna(dim = ' time' ,how = ' all' )
202208```
203209
204210Indexing only a particular satellite system (here, Galileo) using Boolean indexing.
211+
205212``` python
206213import georinex as gr
207214obs = gr.load(' myfile.o' , use = ' E' )
208215```
209- would load only Galileo data by the parameter E.
216+
217+ loads only Galileo data by the parameter E.
210218` ReadRinex ` allow this to be specified as the -use command line parameter.
211219
212220If however you want to do this after loading all the data anyway, you can make a Boolean indexer
221+
213222``` python
214223Eind = obs.sv.to_index().str.startswith(' E' ) # returns a simple Numpy Boolean 1-D array
215224Edata = obs.isel(sv = Eind) # any combination of other indices at same time or before/after also possible
216225```
217226
218- ### Plot OBS data
227+ ### Plot OBS data
219228
220229Plot for all satellites L1C:
230+
221231``` python
222232from matplotlib.pyplot import figure, show
223233ax = figure().gca()
@@ -226,31 +236,33 @@ show()
226236```
227237
228238Suppose L1C pseudorange plot is desired for ` G13 ` :
239+
229240``` python
230241obs[' L1C' ].sel(sv = ' G13' ).dropna(dim = ' time' ,how = ' all' ).plot()
231242```
232243
233244## read Nav
234245
235-
236246If you desire to specifically read a RINEX 2 or 3 NAV file:
247+
237248``` python
238249nav = gr.load(' tests/demo_MN.rnx' )
239250```
240251
241- This returns an ` xarray.Dataset ` of the data within the RINEX 3 or RINEX 2 Navigation file.
252+ Returns an ` xarray.Dataset ` of the data within the RINEX 3 or RINEX 2 Navigation file.
242253Indexed by time x quantity
243254
244-
245255### Index NAV data
246256
247257assume the NAV data from a file is loaded in variable ` nav ` .
248258Select satellite(s) (here, ` G13 ` ) by
259+
249260``` python
250261nav.sel(sv = ' G13' )
251262```
252263
253264Pick any parameter (say, ` M0 ` ) across all satellites and time (or index by that first) by:
265+
254266``` python
255267nav[' M0' ]
256268```
@@ -260,24 +272,31 @@ A significant reason for using `xarray` as the base class of GeoRinex is that bi
260272It's suggested to load the original RINEX files with the ` -use ` or ` use= ` option to greatly speed loading and conserve memory.
261273
262274A copy of the processed data can be saved to NetCDF4 for fast reloading and out-of-core processing by:
275+
263276``` python
264277obs.to_netcdf(' process.nc' , group = ' OBS' )
265278```
279+
266280` georinex.__init.py__ ` shows examples of using compression and other options if desired.
267281
268282### Join data from multiple files
283+
269284Please see documentation for ` xarray.concat ` and ` xarray.merge ` for more details.
270285Assuming you loaded OBS data from one file into ` obs1 ` and data from another file into ` obs2 ` , and the data needs to be concatenated in time:
286+
271287``` python
272288obs = xarray.concat((obs1, obs2), dim = ' time' )
273289```
290+
274291The ` xarray.concat ` operation may fail if there are different SV observation types in the files.
275292you can try the more general:
293+
276294``` python
277295obs = xarray.merge((obs1, obs2))
278296```
279297
280298### Receiver location
299+
281300While ` APPROX LOCATION XYZ ` gives ECEF location in RINEX OBS files, this is OPTIONAL for moving platforms.
282301If available, the ` location ` is written to the NetCDF4 / HDF5 output file on conversion.
283302To convert ECEF to Latitude, Longitude, Altitude or other coordinate systems, use
0 commit comments