-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
'Catalog' object has no attribute 'short_str' #16
Comments
Hi @banstia7, thanks for raising this issue; great to see you working in the container and checking out the doc material. Looks like at some point I modified the To get things working you'll have to slightly modify the code block to append the first event of each catalog (if available), rather than the whole catalog itself. That would look something like this: In [18]: from pyatoa.core.gatherer import get_gcmt_moment_tensors
...:
...: events = []
...: for event in cat:
...: origintime = event.preferred_origin().time
...: magnitude = event.preferred_magnitude().mag
...: try:
...: event = get_gcmt_moment_tensors(event, origintime, magnitude)
...: if event:
...: events.append(event[0])
...: except FileNotFoundError:
...: print(f"No GCMT event found for: {format_event_name(event)}")
...: continue
...:
...: gcmt_catalog = Catalog(events)
...: print(f"\n{len(gcmt_catalog)}/{len(cat)} events with GCMT solutions found")
11/15 events with GCMT solutions found
In [19]: print(gcmt_catalog)
11 Event(s) in Catalog:
2019-01-13T16:45:55.900000Z | +61.260, -150.340 | 4.98 Mwc
2019-01-06T03:45:37.500000Z | +65.400, -153.420 | 4.93 Mwc
...
2011-06-16T19:06:06.800000Z | +60.790, -151.230 | 5.08 Mwc
2011-01-23T02:50:08.000000Z | +63.570, -150.890 | 5.24 Mwc
To see all events call 'print(CatalogObject.__str__(print_all=True))' I will fix the docs page in the next PR. Thanks for pointing out the other typos and function call changes! Bug Fix tasks:
|
Hi @bch0w |
No problem! I'm just going to re-open this as a reminder to fix those docs for the next PR after which I will mark it as closed again. Thanks again for bringing this to my attention! |
Ohh okay.. I also noticed that https://pyatoa.readthedocs.io/en/latest/inversion_prep.html#gathering-observation-data |
I recently decided to get rid of external data gathering from the Pyatoa package (#23), and move all these capabilities into PySEP (https://github.com/adjtomo/pysep). The corresponding fetching functions have been copied over there and I will need to write up a new example or docs page to mimic the inversion prep notebook. |
Hi,
I'm trying to run the 'inversion prep' example available at:
https://pyatoa.readthedocs.io/en/latest/inversion_prep.html#getting-moment-tensors
and I'm running it using the docker image https://github.com/adjtomo/adjdocs/blob/main/readmes/docker_image_install.md
But, I'm getting this error and I don't know how go about it:
AttributeError: 'Catalog' object has no attribute 'short_str'

Thanks in advance
Note: I've added the 's' in 'get_gcmt_moment_tensors' and 'event' in get_gcmt_moment_tensors(event,origintime,magnitude) to fix some previously encountered errors.
The text was updated successfully, but these errors were encountered: