Hi everyone,
Something weird is happening when using the pickle library.
I use a python code to get the event list:
# get the events
catalog=fdsn.get_events(starttime=starttime_check,
endtime=endtime_check,
minmagnitude=cfg.mag_thres,
magnitudetype="MLh",
includeallorigins=False,
includeallmagnitudes=False,
includearrivals=True,
orderby="time-asc",
limit=cfg.event_limit)
# and save them into a file for later use
with open('catalog','w') as f: # tried with wb also
pickle.dump(catalog,f)
From another script:
with open('catalog','r') as f:
catalog=pickle.load(f)
print catalog
When I run both scripts sequentially, I have no problem. Even if I run, later, the second one script repetitively.
However, if, for instance, I reboot my computer and run only the second script, I get the error (at the print statement):
AttributeError: 'UTCDateTime' object has no attribute '_UTCDateTime__ns'
Any ideas? What could be the cause of "destroying" the data?
Thanks,
Nikos