Skip to content

Usage Help: Calling Pysep with a specific Obspy Event #182

@bvanderbeek

Description

@bvanderbeek

First, thanks for the tool! I'm sure my issue is just a new user problem.

I have an earthquake catalog (QuakeML; event_cat) and station XML file (station_inv). I'd like to download waveforms for all stations for a specific event. Additional parameters I have specified in a pysep configuration file (attached). From the documentation (specifically the last Cookbook section), I understand that this can be accomplished via:

`
#\ Dowload all waveforms for the first event in the catalog

pysep_config.yaml

sep = Pysep(inv=station_inv, event=event_cat[0], config_file='pysep_config.yaml')
sep.run()
`

However, upon calling sep.run(), I receive an error related to the event origin time (see error stack below). It appears that the event origin time being used is the null value that I have in my pysep_config.yaml. But I expected that this value would be updated given the event data I explicitly passed to pysep. I'll note that if I hand-code the event parameters into the yaml-file, the data are retrieved as expected.

Am I misunderstanding the usage or is there an additional step required to extract the event parameters?

Thanks in advance!

Error Stack:
`

TypeError Traceback (most recent call last)
Cell In[19], line 1
----> 1 sep.run()

File ~/research/software/miniforge3/envs/pysep/lib/python3.9/site-packages/pysep/pysep.py:1826, in Pysep.run(self, event, inv, st, **kwargs)
1824 # Overload default parameters with event input file and check validity
1825 self.load(**kwargs)
-> 1826 self.check()
1827 self.c = self.get_client()
1829 # Get QuakeML (event) metadata

File ~/research/software/miniforge3/envs/pysep/lib/python3.9/site-packages/pysep/pysep.py:569, in Pysep.check(self)
565 def check(self):
566 """
567 Check input parameter validity against expected Pysep behavior
568 """
--> 569 self.origin_time = UTCDateTime(self.origin_time)
570 if self.reference_time is None:
571 self.reference_time = self.origin_time

File ~/research/software/miniforge3/envs/pysep/lib/python3.9/site-packages/obspy/core/utcdatetime.py:452, in UTCDateTime.init(self, *args, **kwargs)
449 args = args[0:5]
451 try: # If a value Error is raised try to allow overflow (see #2222)
--> 452 dt = datetime.datetime(*args, **kwargs)
453 except ValueError:
454 if not strict:

TypeError: an integer is required (got type NoneType)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions