hydrogeoscience / pygtide

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

etpolutl.bin problem #7

Closed WilkAndy closed 3 years ago

WilkAndy commented 4 years ago

If i run test.py two times, the second time produces an error:

ETERNA PREDICT v3.4 (10/02/2013) is calculating, please wait ...
At line 3121 of file etpred.f90 (unit = 31, file = 'commdat/etpolut1.bin')
Fortran runtime error: Record number must be positive
Jollyfant commented 4 years ago

@WilkAndy I have the same problem. First I hardcoded the end and test.py started downloading some files. Now when I run it again it gives this.

Did you manage to solve it?

Jollyfant commented 4 years ago

When running the example in the PDF I have a different problem:

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

I fixed this by removing the first space in commdat/etpolut1.dat. I can now run this code:

# PyGTide: A Python module and wrapper for ETERNA PREDICT # to compute gravitational tides on Earth
import pygtide
import datetime as dt
# create a PyGTide object
pt = pygtide.pygtide()
# define a start date
start = dt.datetime(2017,1,1)
# calculate the gravitational tides
latitude = 49.00937
longitude = 8.40444
height = 120
start = dt.datetime(2017,1,1)
duration = 31*24
samplerate = 3600
pt.predict(latitude, longitude, height, start, duration, samplerate)
# retrieve the results as dataframe
data = pt.results()
# output
print(data)

but the test.py is still broken with the same Fortran error.