hydrogeoscience / pygtide

A Python module and wrapper for ETERNA PREDICT to compute gravitational tides on Earth
Mozilla Public License 2.0
53 stars 19 forks source link

Retrieved etpolut.dat file cannot be read by ETERNA #5

Closed rwalkerlewis closed 3 years ago

rwalkerlewis commented 5 years ago

Hello,

I am trying to run pygtide on python built from anaconda on ubuntu linux, and every time that a new etpolut1.dat file is pulled, it cannot be read by the included eterna, I believe because it has a space between the beginning of the line and the date. The error produced is as follows (from iPython):


ValueError Traceback (most recent call last) ~/projects/pygtide/test.py in 7 8 # create a PyGTide object ----> 9 pt = pygtide.pygtide() 10 11 # update the pole coordinates and UT1 time database

~/projects/pygtide/pygtide/pygtide.py in init(self, msg) 138 self.etpolut1_dat_file = str(etpred.params.etpolutdat, 'UTF-8').strip() 139 self.etpolut1_bin_file = str(etpred.params.etpolutbin, 'UTF-8').strip() --> 140 self.etpolut1_start = dt.datetime.strptime(str(etpred.inout.etpol_start), "%Y%m%d") 141 self.etpolut1_end = dt.datetime.strptime(str(etpred.inout.etpol_end), "%Y%m%d") 142

~/.conda/envs/obspy/lib/python3.6/_strptime.py in _strptime_datetime(cls, data_string, format) 563 """Return a class cls instance based on the input string and the 564 format string.""" --> 565 tt, fraction = _strptime(data_string, format) 566 tzname, gmtoff = tt[-2:] 567 args = tt[:6] + (fraction,)

~/.conda/envs/obspy/lib/python3.6/_strptime.py in _strptime(data_string, format) 360 if not found: 361 raise ValueError("time data %r does not match format %r" % --> 362 (data_string, format)) 363 if len(data_string) != found.end(): 364 raise ValueError("unconverted data remains: %s" %

ValueError: time data '1962010' does not match format '%Y%m%d'

===========================================================

The corresponding initial section of the etpolut1.dat file is as follows:

Date Time MJD x y UT1-UTC TAI-UT1 ["] ["] [sec] [sec] C**** 19620101 000000 37665.000 -0.01270 0.21300 0.032634 9.967366 19620102 000000 37666.000 -0.01590 0.21410 0.032055 9.967945 19620103 000000 37667.000 -0.01900 0.21520 0.031553 9.968447

===========================================================

Some jimmying with the file has produced a working run, but every update returns to this.

Robert

xief commented 5 years ago

hello

I also have this problem when run test.py on a win 7 platform

hydrogeoscience commented 3 years ago

Please see the new update.