megies / obspyck

ObsPyck is a GUI application that is intended to cover the tasks in a standard analysis workflow for seismic events in seismological observatory practice.
https://github.com/megies/obspyck/wiki
GNU General Public License v2.0
61 stars 32 forks source link

Can't run obspyck on local files #86

Closed savardge closed 4 years ago

savardge commented 5 years ago

Hi, I'm trying to run obspyck with local data only. but whenever I try reading files, it also tries to fetch waveforms from a server, and I don't understand how the configuration file works to disable that server fetching behaviour. I also have the issue that the stations do not have any metadata in a StationXML or Dataless format, so I manually created a StationXML using these guidelines: [https://docs.obspy.org/tutorial/code_snippets/stationxml_file_from_scratch.html]. Here is my command line output and I attach my stationXML and config file

(obspyck) C98809:obspyck genevievesavard$ obspyck -t 2019-03-21T12:00:00 -d 120 /Users/genevievesavard/CaMI/day_data_250Hz/HW0*/HW*_HHZ_250Hz_20190321*SAC station_CaMI_FebMarch2019.xml
/Users/genevievesavard/anaconda3/envs/obspyck/lib/python2.7/site-packages/obspy/clients/arclink/__init__.py:175: ObsPyDeprecationWarning: The ArcLink protocol will be deprecated in the near future. Please, use the client contacting the routing service provided by EIDA: https://docs.obspy.org/packages/obspy.clients.fdsn.html#basic-routing-clients-usage
  warnings.warn(msg, category=ObsPyDeprecationWarning)
Running ObsPyck version 0.5.1 (location: /Users/genevievesavard/anaconda3/envs/obspyck/lib/python2.7/site-packages/obspyck/obspyck.pyc)
using config file: /Users/genevievesavard/.obspyckrc
================================================================================
Reading local files:
--------------------------------------------------------------------------------
/Users/genevievesavard/CaMI/day_data_250Hz/HW001/HW001_HHZ_250Hz_20190321_065837_210236.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW002/HW002_HHZ_250Hz_20190321_065837_210236.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW003/HW003_HHZ_250Hz_20190321_065838_210237.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW004/HW004_HHZ_250Hz_20190321_065836_210235.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW005/HW005_HHZ_250Hz_20190321_065838_210237.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW006/HW006_HHZ_250Hz_20190321_065823_210222.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW007/HW007_HHZ_250Hz_20190321_065839_210238.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW008/HW008_HHZ_250Hz_20190321_065835_210234.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW009/HW009_HHZ_250Hz_20190321_065837_210236.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW010/HW010_HHZ_250Hz_20190321_065918_210317.SAC: Waveforms
/Users/genevievesavard/CaMI/day_data_250Hz/HW011/HW011_HHZ_250Hz_20190321_065841_210240.SAC: Waveforms
station_CaMI_FebMarch2019.xml: Metadata
found no metadata for .HW001..HHZ!!!
found no metadata for .HW002..HHZ!!!
found no metadata for .HW003..HHZ!!!
found no metadata for .HW004..HHZ!!!
found no metadata for .HW005..HHZ!!!
found no metadata for .HW006..HHZ!!!
found no metadata for .HW007..HHZ!!!
found no metadata for .HW008..HHZ!!!
found no metadata for .HW009..HHZ!!!
found no metadata for .HW010..HHZ!!!
found no metadata for .HW011..HHZ!!!
================================================================================
Fetching waveforms and metadata from servers:
--------------------------------------------------------------------------------
================================================================================
/Users/genevievesavard/anaconda3/envs/obspyck/lib/python2.7/site-packages/obspyck/obspyck.py:230: UserWarning: Cannot find external programs dir, localization methods/functions are deactivated
  warnings.warn(msg)
Traceback (most recent call last):
  File "/Users/genevievesavard/anaconda3/envs/obspyck/bin/obspyck", line 11, in <module>
    load_entry_point('obspyck==0.5.1', 'console_scripts', 'obspyck')()
  File "/Users/genevievesavard/anaconda3/envs/obspyck/lib/python2.7/site-packages/obspyck/obspyck.py", line 4666, in main
    obspyck = ObsPyck(clients, streams, options, KEYS, config)
  File "/Users/genevievesavard/anaconda3/envs/obspyck/lib/python2.7/site-packages/obspyck/obspyck.py", line 263, in __init__
    test_event_server_name = config.get("base", "test_event_server_jane")
  File "/Users/genevievesavard/anaconda3/envs/obspyck/lib/python2.7/ConfigParser.py", line 618, in get
    raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'test_event_server_jane' in section: 'base'

I don't understand how to tell obspyck to not look on servers (deleting lines related to servers in the config file returned "NoSection" errors) and also why it can't read the metadata. Any help would be greatly appreciated, as it's not clear from the short getting started how to set up the config file in those cases.

Archive.zip

megies commented 5 years ago

Just add this under [base] section in config (to make it None), see #71

test_event_server_jane =

Can you do a print(read_inventory("station_CaMI_FebMarch2019.xml"))?

savardge commented 4 years ago

Sorry, I forgot to update here. Your suggestion did the trick and it now works beautifully. And the other error regarding reading the station XML was that I had put the incorrect location code so there was a mismatch with the location code in the SAC files. Thanks for your help, I'll close this issue now.