ogalanis / hypoDDpy

A collection of scripts to steer HypoDD by Felix Waldhauser.
83 stars 47 forks source link

AttributeError: 'HypoDDRelocator' object has no attribute 'events' #4

Closed TraziBatine closed 7 years ago

TraziBatine commented 7 years ago

Dear Lion

I am trying to use hypoddpy and I have some problems with HypoDDRelocator.

I put my event quakeml files into the folder events, station diles into folder sta, ... when i run

relocator.add_station_files(glob.glob("sta/*")) relocator._parse_station_files() relocator._write_station_input_file()

stations are read and outputed without problems (both station.dat and json are created)

then the same should happen with event files:

relocator.add_event_files(glob.glob("events/*.xml")) relocator._write_catalog_input_file()

but I get error

Traceback (most recent call last): File "run_relocator.py", line 21, in relocator._write_catalog_input_file() File "/home/blaz/Software/hypoDDpy/hypoddpy/hypodd_relocator.py", line 341, in _write_catalog_input_file for event in self.events: AttributeError: 'HypoDDRelocator' object has no attribute 'events'

I checked if there is something wrong with quakemls, but they are read without problems by obspy read_events command.

Thank you for your time and help. Blaz

krischer commented 7 years ago

I did not test it but judging from the code you have to run _read_event_information() to set self.events. Please note that all functions starting with an underscore are private and not intended to be used from the outside.

Any reason you are not using relocator.start_relocation() which calls all internal functions in the correct order?

krischer commented 7 years ago

No answer - I assume this is resolved. Please reopen if there is still an issue.