pygnss 0.6.0__cp313-cp313-musllinux_1_2_i686.whl → 0.7.0__cp313-cp313-musllinux_1_2_i686.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pygnss might be problematic. Click here for more details.

pygnss/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.6.0"
1
+ __version__ = "0.7.0"
pygnss/ionex.py CHANGED
@@ -4,8 +4,10 @@ import math
4
4
  import os
5
5
  from typing import List
6
6
 
7
+ import nequick
7
8
  import numpy as np
8
9
 
10
+
9
11
  from .iono import gim
10
12
  from .decorator import read_contents
11
13
 
@@ -268,14 +270,43 @@ def _parse_ionex_epoch(ionex_line: str) -> datetime.datetime:
268
270
  return datetime.datetime.strptime(ionex_line[:36], _HEADER_EPOCH_FORMAT)
269
271
 
270
272
 
273
+
274
+ class NeQuickGimHandlerArray(gim.GimHandler):
275
+ """
276
+ Handler to store the incoming GIMs in arrays
277
+ """
278
+
279
+ def __init__(self):
280
+ self.vtec_gims: List[gim.Gim] = []
281
+
282
+ def process(self, nequick_gim: nequick.Gim):
283
+ """
284
+ Process a GIM file
285
+ """
286
+
287
+ incoming_gim = gim.Gim(nequick_gim.epoch,
288
+ nequick_gim.longitudes, nequick_gim.latitudes,
289
+ nequick_gim.vtec_values)
290
+
291
+ self.vtec_gims.append(incoming_gim)
292
+
293
+
271
294
  def cli():
272
295
  """
273
296
  This function allows users to compute the difference between two IONEX files
297
+ or between an IONEX file and the NeQuick model (with three coefficients),
274
298
  and save the result in a new IONEX file.
299
+
300
+
301
+ Example:
302
+ Compute the difference between two IONEX files:
303
+ $ python ionex.py file1.ionex file2.ionex output.ionex
304
+
305
+ Compute the difference between an IONEX file and the NeQuick model:
306
+ $ python ionex.py file1.ionex output.ionex --nequick 0.123 0.456 0.789
275
307
  """
276
- parser = argparse.ArgumentParser(
277
- description="Compute the difference between two IONEX files and save the result in a new IONEX file."
278
- )
308
+ parser = argparse.ArgumentParser(description=cli.__doc__,
309
+ formatter_class=argparse.RawDescriptionHelpFormatter )
279
310
 
280
311
  parser.add_argument(
281
312
  "lhs",
@@ -284,19 +315,96 @@ def cli():
284
315
  )
285
316
 
286
317
  parser.add_argument(
287
- "rhs",
318
+ "output",
319
+ type=str,
320
+ help="Path to the output IONEX file where the differences will be saved.",
321
+ )
322
+
323
+ rhs = parser.add_mutually_exclusive_group(required=True)
324
+
325
+ rhs.add_argument(
326
+ "--rhs",
288
327
  type=str,
289
- help="Path to the second IONEX file (right-hand side).",
328
+ help="Path to the second IONEX file (right-hand side). If not provided, --nequick must be specified.",
329
+ )
330
+
331
+ rhs.add_argument(
332
+ "--nequick",
333
+ type=float,
334
+ nargs=3,
335
+ metavar=("AZ0", "AZ1", "AZ2"),
336
+ help="Use the NeQuick model to compare against the 'lhs' IONEX (instead of another IONEX file). "
337
+ "Specify the three NeQuick coefficients (az0, az1, az2).",
290
338
  )
291
339
 
292
340
  parser.add_argument(
293
- "output",
341
+ "--nequick-ionex",
294
342
  type=str,
295
- help="Path to the output IONEX file where the differences will be saved.",
343
+ default=None,
344
+ required=False,
345
+ metavar='<file>',
346
+ help="Specify a filename to store the NeQuick model in IONEX format",
296
347
  )
297
348
 
298
349
  args = parser.parse_args()
299
350
 
300
351
  PGM = "ionex_diff"
301
352
 
302
- diff(args.lhs, args.rhs, args.output, pgm=PGM)
353
+ # Validate input arguments
354
+ if args.rhs is None and args.nequick is None:
355
+ parser.error("Either a second IONEX file (rhs) or the '--nequick' option must be provided.")
356
+
357
+ if args.rhs is not None and args.nequick is not None:
358
+ parser.error("You cannot specify both a second IONEX file (rhs) and the '--nequick' option.")
359
+
360
+ if args.nequick_ionex is not None and args.nequick is None:
361
+ parser.error("Cannot output the IONEX file with the NeQuick model without the '--nequick' option.")
362
+
363
+ # Process the lhs IONEX file
364
+ gim_handler_lhs = gim.GimHandlerArray()
365
+ load(args.lhs, gim_handler=gim_handler_lhs)
366
+
367
+ # Add comments to the output file
368
+ comment_lines = [
369
+ "This IONEX file contains the differences of VTEC values,",
370
+ "computed as vtec_left - vtec_right, where:",
371
+ f"- vtec_left: {os.path.basename(args.lhs)}"
372
+ ]
373
+
374
+ # Process the rhs input (either an IONEX file or NeQuick coefficients)
375
+ gim_handler_rhs = None
376
+ if args.rhs:
377
+ gim_handler_rhs = gim.GimHandlerArray()
378
+ # Load the second IONEX file
379
+ load(args.rhs, gim_handler=gim_handler_rhs)
380
+ comment_lines += [f"- vtec_right: {os.path.basename(args.rhs)}"]
381
+
382
+ else:
383
+ gim_handler_rhs = NeQuickGimHandlerArray()
384
+ # Generate GIMs using NeQuick coefficients
385
+ coeffs = args.nequick
386
+ nequick_desc = ["NeQuick model", f" az0={coeffs[0]}", f" az1={coeffs[1]}", f" az2={coeffs[2]}"]
387
+ comment_lines += [f"- vtec_right: {nequick_desc[0]}"] + nequick_desc[1:]
388
+
389
+ for ionex_gim in gim_handler_lhs.vtec_gims:
390
+
391
+ nequick.to_gim(nequick.Coefficients(*coeffs),
392
+ ionex_gim.epoch,
393
+ latitudes = ionex_gim.latitudes,
394
+ longitudes = ionex_gim.longitudes,
395
+ gim_handler= gim_handler_rhs)
396
+
397
+ # Compute the difference
398
+ gim_diffs = gim.subtract_gims(gim_handler_lhs.vtec_gims, gim_handler_rhs.vtec_gims)
399
+
400
+
401
+ # Write the result to the output file
402
+ write(args.output, gim_diffs, gim.GimType.TEC, pgm=PGM, comment_lines=comment_lines)
403
+
404
+ if args.nequick_ionex is not None:
405
+ comment_lines = [
406
+ "TEC values generated with the " + nequick_desc[0]
407
+ ] + nequick_desc[1:]
408
+
409
+ write(args.nequick_ionex, gim_handler_lhs.vtec_gims, gim.GimType.TEC, pgm=PGM,
410
+ comment_lines=comment_lines )
pygnss/iono/gim.py CHANGED
@@ -50,8 +50,8 @@ class GimHandlerArray(GimHandler):
50
50
  """
51
51
 
52
52
  def __init__(self):
53
- self.vtec_gims = []
54
- self.rms_gims = []
53
+ self.vtec_gims: List[Gim] = []
54
+ self.rms_gims: List[Gim] = []
55
55
 
56
56
  def process(self, gim: Gim, type: GimType):
57
57
  """
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygnss
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Package with utilities and tools for GNSS data processing
5
5
  Author-email: Miquel Garcia-Fernandez <miquel@mgfernan.com>
6
6
  License: MIT
7
7
  Requires-Python: >=3.10
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
- Requires-Dist: nequick
10
+ Requires-Dist: nequick>=0.2.0
11
11
  Requires-Dist: numpy
12
12
  Requires-Dist: pandas>=2.2
13
13
  Requires-Dist: pyarrow>=18.0.0
@@ -1,4 +1,4 @@
1
- pygnss/__init__.py,sha256=cID1jLnC_vj48GgMN6Yb1FA3JsQ95zNmCHmRYE8TFhY,22
1
+ pygnss/__init__.py,sha256=RaANGbRu5e-vehwXI1-Qe2ggPPfs1TQaZj072JdbLk4,22
2
2
  pygnss/_c_ext.cpython-313-i386-linux-musl.so,sha256=9CwtpxkeyS2ajcDuwlLpG1R9QsgwtBkl6wMFDeK4LNw,81152
3
3
  pygnss/cl.py,sha256=ISmd2RjikUMmj3nLPN0VSjvQLG5rLizp2X2ajeBkoDE,4509
4
4
  pygnss/constants.py,sha256=1hF6K92X6E6Ofo0rAuCBCgrwln9jxio26RV2a6vyURk,133
@@ -6,7 +6,7 @@ pygnss/decorator.py,sha256=qB-0jl2GTEHJdvmDruNll5X3RrdySssv94u9Hok5-lA,1438
6
6
  pygnss/file.py,sha256=kkMBWjoTPkxJD1UgH0mXJT2fxnhU8u7_l2Ph5Xz2-hY,933
7
7
  pygnss/geodetic.py,sha256=3q8Rpl4b5CxGlhdn1nQRBHHSW1v-0PBFz54zOeVyO74,33633
8
8
  pygnss/hatanaka.py,sha256=P9XG6bZwUzfAPYn--6-DXfFQIEefeimE7fMJm_DF5zE,1951
9
- pygnss/ionex.py,sha256=Sk0U_hRyYE7cEwLyMIgiY-2bBs6wktzKmZdI92HrU7c,10422
9
+ pygnss/ionex.py,sha256=WcY6PVwjzATjqyC0Htc5Jh_cv2a7yz4TZIcD723TpsY,14325
10
10
  pygnss/logger.py,sha256=4kvcTWXPoiG-MlyP6B330l4Fu7MfCuDjuIlIiLA8f1Y,1479
11
11
  pygnss/nequick.py,sha256=tSsUw3FoRWS-TBKKVb0_c90DFz_2jUTkUvNPsGQOLA8,1722
12
12
  pygnss/rinex.py,sha256=LsOOh3Fc263kkM8KOUBNeMeIAmbOn2ASSBO4rAUJWj8,68783
@@ -27,14 +27,14 @@ pygnss/gnss/observables.py,sha256=0x0NLkTjxf8cO9F_f_Q1b-1hEeoNjWB2x-53ecUEv0M,16
27
27
  pygnss/gnss/residuals.py,sha256=8qKGNOYkrqxHGOSjIfH21K82PAqEh2068kf78j5usL8,1244
28
28
  pygnss/gnss/types.py,sha256=lmL15KRckRiTwVkYvGzF4c1BrojnQlegrYCXSz1hGaI,10377
29
29
  pygnss/iono/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- pygnss/iono/gim.py,sha256=bJ-1jRIrkZj790fuCk3np72NrPaG_Qvx-EVZsvWMfsk,3521
30
+ pygnss/iono/gim.py,sha256=khKzClxLf46mVO6BCDk9u9DgS_50d-sbWEyoUQu7Jng,3543
31
31
  pygnss/orbit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  pygnss/orbit/kepler.py,sha256=QORTgg5yBtsQXxLWSzoZ1pmh-CwPiZlFdIYqhQhv1a0,1745
33
33
  pygnss/orbit/tle.py,sha256=6CIEielPgui3DXNv46XxOGlig31ROIwjH42xLGaeE5M,5905
34
34
  pygnss/parsers/rtklib/stats.py,sha256=YV6yadxMeQMQYZvsUCaSf4ZTpK8Bbv3f2xgu0l4PekA,5449
35
- pygnss-0.6.0.dist-info/METADATA,sha256=0gGj855FG6F9WGYHCsZ3gbEPX8avn7JP_P5r3QNExa4,1659
36
- pygnss-0.6.0.dist-info/WHEEL,sha256=qeaIuaJB-6C86fEu4NQSDId-fDkNNB1_xWNvSM-4W7I,110
37
- pygnss-0.6.0.dist-info/entry_points.txt,sha256=awWUCMfX3uMIAPPZqZfSUuw7Kd7defip8L7GtthKqgg,292
38
- pygnss-0.6.0.dist-info/top_level.txt,sha256=oZRSR-qOv98VW2PRRMGCVNCJmewcJjyJYmxzxfeimtg,7
39
- pygnss-0.6.0.dist-info/RECORD,,
40
- pygnss-0.6.0.dist-info/licenses/LICENSE,sha256=Wwany6RAAZ9vVHjFLA9KBJ0HE77d52s2NOUA1CPAEug,1067
35
+ pygnss-0.7.0.dist-info/METADATA,sha256=UGioECEGQJ7eQSa5yaZTnf3aNKvXG2dsiJVrhu0sPk0,1666
36
+ pygnss-0.7.0.dist-info/WHEEL,sha256=qeaIuaJB-6C86fEu4NQSDId-fDkNNB1_xWNvSM-4W7I,110
37
+ pygnss-0.7.0.dist-info/entry_points.txt,sha256=awWUCMfX3uMIAPPZqZfSUuw7Kd7defip8L7GtthKqgg,292
38
+ pygnss-0.7.0.dist-info/top_level.txt,sha256=oZRSR-qOv98VW2PRRMGCVNCJmewcJjyJYmxzxfeimtg,7
39
+ pygnss-0.7.0.dist-info/RECORD,,
40
+ pygnss-0.7.0.dist-info/licenses/LICENSE,sha256=Wwany6RAAZ9vVHjFLA9KBJ0HE77d52s2NOUA1CPAEug,1067
File without changes