shipgrav 1.0.6__py2.py3-none-any.whl → 1.0.7__py2.py3-none-any.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.
shipgrav/__init__.py CHANGED
@@ -62,7 +62,7 @@ Navigation data
62
62
 
63
63
  Which navigation data should you use to process gravimeter data?
64
64
 
65
- In an ideal world, the gravimeter pulls navigation info from the ship's feed and synchronizes it perfectly with acquisition such that the output files have the correct geographic coordinates in them at the start. In practice, this synchronization doesn't always work as expected (see ``example-scripts/dgs_raw_comp.py`` for a case where the serial files do not have GPS info). So, we like to take the timestamped navigation data directly from the ship's feed and match up the gravimeter timestamps to obtain more accurate coordinates.
65
+ In an ideal world, the gravimeter pulls navigation info from the ship's feed and synchronizes it perfectly with acquisition such that the output files have the correct geographic coordinates in them at the start. In practice, this synchronization doesn't always work as expected (see ``example-scripts/dgs_raw_comp.py`` for a case where the serial files do not have GPS info). So, we like to take the timestamped navigation data directly from the ship's feed and match up the gravimeter timestamps to obtain more accurate coordinates. Using navigation from a feed separate from the gravimeter is **highly recommended**.
66
66
 
67
67
  The database file included in shipgrav lists the navigation talkers that we expect are good to use for specific UNOLS vessels. Find the files that contain those feeds, and you should be able to read in timestamped coordinates from them.
68
68
 
@@ -94,10 +94,10 @@ The data files can be downloaded from R2R and Zenodo, and the scripts will do th
94
94
  :height: 250px
95
95
  :align: center
96
96
 
97
- ``dgs_ccp_calc.py`` reads DGS files from R/V Thompson cruise TN400, calculates the FAA and various kinematic variables, and fits for cross-coupling coefficients. The cross-coupling correction is applied and the data are plotted with and without correction.
97
+ ``dgs_ccp_calc.py`` reads DGS files from R/V Thompson cruise TN400, calculates the FAA and various kinematic variables, and fits for cross-coupling coefficients. The cross-coupling correction is applied and the data are plotted with and without correction. Satellite-derived FAA is also plotted
98
98
 
99
99
  .. image:: _static/TN400_ccp.png
100
- :alt: FAA for TN400, with and without cross-coupling correction applied.
100
+ :alt: FAA for TN400, with and without cross-coupling correction applied; and satellite-derived FAA.
101
101
  :height: 250px
102
102
  :align: center
103
103
 
shipgrav/database.toml CHANGED
@@ -5,6 +5,7 @@ Revelle = {'dgs'=968888.6465, 'bgm'=855240.81987}
5
5
  NBP = {'dgs'=968634.2514, 'bgm'=-999}
6
6
  Ride = {'dgs'=968895.7718, 'bgm'=-999}
7
7
  Langseth = {'dgs'=-999, 'bgm'=854974.4}
8
+ Sikuliaq = {'dgs'=969538.8152, 'bgm'=-999}
8
9
 
9
10
  [nav-talkers]
10
11
  Atlantis = 'GPGGA'
shipgrav/io.py CHANGED
@@ -17,7 +17,7 @@ from tqdm import tqdm
17
17
  ########################################################################
18
18
 
19
19
 
20
- def read_nav(ship, pathlist, sampling=1, talker=None, ship_function=None, progressbar=True):
20
+ def read_nav(ship, pathlist, sampling=1, talker=None, ship_function=None, decimate=0, progressbar=True):
21
21
  """ Read navigation strings from .GPS (or similar) files.
22
22
 
23
23
  Ships have different formats and use different talkers for preferred
@@ -38,6 +38,8 @@ def read_nav(ship, pathlist, sampling=1, talker=None, ship_function=None, progre
38
38
  This function should return arrays of lon, lat, and timestamps.
39
39
  Look at _navcoords() and navdate_Atlantis() (and similar functions) for examples.
40
40
  :type ship_function: function, optional
41
+ :param decimate: integer skip for decimating data, default 0 returns all points
42
+ :type decimate: int, optional
41
43
  :param progressbar: display progress bar while list of files is read
42
44
  :type progressbar: bool
43
45
 
@@ -119,6 +121,12 @@ def read_nav(ship, pathlist, sampling=1, talker=None, ship_function=None, progre
119
121
  lon_out = np.interp(sec_time, sec_time[idx], lon[idx])
120
122
  lat_out = np.interp(sec_time, sec_time[idx], lat[idx])
121
123
 
124
+ # decimate if we're doing that
125
+ if decimate:
126
+ sec_time = sec_time[::decimate]
127
+ lon_out = lon_out[::decimate]
128
+ lat_out = lat_out[::decimate]
129
+
122
130
  timetime = np.append(timetime, sec_time)
123
131
  lonlon = np.append(lonlon, lon_out)
124
132
  latlat = np.append(latlat, lat_out)
@@ -325,14 +333,16 @@ def _navcoords(allnav, talker):
325
333
  post = subnav[i].split(talker)[-1].lstrip().split(',')
326
334
  if post[0] == '':
327
335
  post = post[1:] # correct for spacing in some files
328
-
329
- lat[i] = int(post[1][:2]) + float(post[1][2:]) / \
330
- 60 # convert to decimal degrees
331
- if post[2] == 'S':
332
- lat[i] = -lat[i] # handle coordinate sign
333
- lon[i] = int(post[3][:3]) + float(post[3][3:])/60
334
- if post[4] == 'W':
335
- lon[i] = -lon[i]
336
+ if post[1] == '' or post[3] == '': # no coords, nav dropped out?
337
+ lat[i] = np.nan; lon[i] = np.nan
338
+ else:
339
+ lat[i] = int(post[1][:2]) + float(post[1][2:]) / \
340
+ 60 # convert to decimal degrees
341
+ if post[2] == 'S':
342
+ lat[i] = -lat[i] # handle coordinate sign
343
+ lon[i] = int(post[3][:3]) + float(post[3][3:])/60
344
+ if post[4] == 'W':
345
+ lon[i] = -lon[i]
336
346
 
337
347
  return lon, lat
338
348
 
@@ -560,6 +570,8 @@ def read_dgs_laptop(fp, ship, ship_function=None, progressbar=True):
560
570
  dat = _dgs_laptop_general(path)
561
571
  elif ship == 'Thompson':
562
572
  dat = _dgs_laptop_Thompson(path)
573
+ elif ship == 'Sikuliaq':
574
+ dat = _dgs_laptop_Sikuliaq(path)
563
575
  else:
564
576
  print('R/V %s not supported for dgs laptop file read' % ship)
565
577
  return -999
@@ -581,6 +593,17 @@ def _dgs_laptop_general(path):
581
593
  return dat
582
594
 
583
595
 
596
+ def _dgs_laptop_Sikuliaq(path):
597
+ """Read single laptop file for Sikuliaq, has more of a header than the others
598
+ """
599
+ dat = pd.read_csv(path,skiprows=19,names=['rgrav','long_a','crss_a','status','ve','vcc',
600
+ 'al','ax','lat','lon','year','month','day',
601
+ 'hour','minute','second'],
602
+ usecols=(1,2,3,6,10,11,12,13,14,15,19,20,21,22,23,24))
603
+ dat['date_time'] = pd.to_datetime(dat[['year','month','day','hour','minute','second']],utc=True)
604
+ return dat
605
+
606
+
584
607
  def _dgs_laptop_Thompson(path):
585
608
  """Read single laptop file for Thompson, which does things its own way.
586
609
  """
@@ -1,9 +1,10 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: shipgrav
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Functions for marine gravity data processing and reduction
5
5
  Author-email: "Hannah F. Mark" <hmark@whoi.edu>
6
6
  Maintainer-email: "Hannah F. Mark" <hmark@whoi.edu>
7
+ License-File: LICENSE
7
8
  Keywords: UNOLS,gravimetry,marine gravity
8
9
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
9
10
  Classifier: Operating System :: OS Independent
@@ -1,7 +1,7 @@
1
- shipgrav/__init__.py,sha256=42vF06SBX2L8-ISqu1Hkgf2fr0qRzfV1ZSgF0Q4117c,12001
2
- shipgrav/database.toml,sha256=8xSnXoAsfBMPDhvzKzw83oDrDT9AxD_QINZ8IWSUmiE,551
1
+ shipgrav/__init__.py,sha256=aCI3zS2iUUH_hFhwPgs-VZDSdfsCnJExBjSgCJSVpY8,12151
2
+ shipgrav/database.toml,sha256=_uQdFL6XeiYX_YKRB-3lzr7mVY6gcRF5r7CRL_F8Dx0,594
3
3
  shipgrav/grav.py,sha256=09d5LIczUGys9VerTngumOMLeYOqdVJVtAdBGJZw2R8,43196
4
- shipgrav/io.py,sha256=N2cqXRHIX_lSyCKJ35h9J4zcvs7tMKvSq0ch90xJncM,30448
4
+ shipgrav/io.py,sha256=-w-NhsccIkTKqHwyD_rgJ3K1kiFT_fL1Nwcvw41_MsI,31586
5
5
  shipgrav/nav.py,sha256=3E2Il-PhTEPVv8_8PrLVe7h6slHq-2HYX_Q8PdpB6X4,2895
6
6
  shipgrav/utils.py,sha256=BJSBrKgCOADzdb6gBO3u9n16l22zzFXTAw42e5_QkBY,9582
7
7
  shipgrav/tests/__init__.py,sha256=i8hMukDivY8kFp7OBdo1byRJWMBvb8nDDWJcAy2cOOI,427
@@ -28,7 +28,7 @@ shipgrav/tests/ex_files/TN400_bgm.Raw,sha256=DL7T2aJednjGLMKJo6K8KcUYLMjQCiv6bsU
28
28
  shipgrav/tests/ex_files/TN400_dgs_proc.Raw,sha256=oxTXwDdyoz5yuKe253L1GgOSR5oWGGMuXfSQWrT24Ag,760
29
29
  shipgrav/tests/ex_files/TN400_dgs_raw.Raw,sha256=tb-zerwCH6kkbGDbnnJ6I-sAUdCHOvkKgXXrBb6zTj8,311
30
30
  shipgrav/tests/ex_files/TN400_nav.Raw,sha256=66dgRQTXjf0JItMWE1ZGUO6NptrGqV6JyN2wdYe5bW8,194
31
- shipgrav-1.0.6.dist-info/METADATA,sha256=B6JBqZZlu8Ni_o9lpZiZzM4ywutIdgzthgLIiksQE10,2855
32
- shipgrav-1.0.6.dist-info/WHEEL,sha256=aO3RJuuiFXItVSnAUEmQ0yRBvv9e1sbJh68PtuQkyAE,105
33
- shipgrav-1.0.6.dist-info/licenses/LICENSE,sha256=5X8cMguM-HmKfS_4Om-eBqM6A1hfbgZf6pfx2G24QFI,35150
34
- shipgrav-1.0.6.dist-info/RECORD,,
31
+ shipgrav-1.0.7.dist-info/METADATA,sha256=V2cPOwuPuUfHqExOfpOHfDerjQcAhmsbVHMeKkK_2yo,2877
32
+ shipgrav-1.0.7.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
33
+ shipgrav-1.0.7.dist-info/licenses/LICENSE,sha256=5X8cMguM-HmKfS_4Om-eBqM6A1hfbgZf6pfx2G24QFI,35150
34
+ shipgrav-1.0.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any