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

read local files with -f #23

Closed dylanmikesell closed 8 years ago

dylanmikesell commented 8 years ago

Hi Tobias,

I got the code working with obspy 1.0. It didn't seem like there were any problems, just some deprecation warnings that I have updated in util.py and obspyck.py. As to the subject of this issue thought, I cannot load local files. There is no -f option as you point out in this other post.

Current command line options as taken from util.py are the following.

COMMANDLINE_OPTIONS = (
        # XXX wasn't working as expected
        #(("--debug"), {'dest': "debug", 'action': "store_true",
        #        'default': False,
        #        'help': "Switch on Ipython debugging in case of exception"}),
        (("-c", "--config"), {
            'dest': "config_file", "type": "str",
            'help': "Location of obspyck config file to use. If not "
                    "specified, obspyck looks up '~/.obspyckrc' (an example "
                    "configuration will be created if the file does not "
                    "exist)."}),
        (("-s", "--station-combination"), {
            'dest': "station_combination", "type": "str", "default": None,
            'help': "Station combination to fetch data for (which must be "
                    "defined in config file). If not specified, the default "
                    "station combination specified in config file is used."}),
        (("-t", "--time"), {
            'dest': "time", "default": None,
            'help': "Starttime of seismogram to retrieve. It takes a "
                    "string which UTCDateTime can convert. E.g. "
                    "'2010-01-10T05:00:00'"}),
        (("-d", "--duration"), {
            'type': "float", 'dest': "duration", "default": None,
            'help': "Duration of seismogram in seconds"}),
        (("-o", "--starttime-offset"), {
            'type': "float", 'dest': "starttime_offset",
            'default': None, 'help': "Offset to add to specified starttime "
            "in seconds. Thus a time from an automatic picker can be used "
            "with a specified offset for the starttime. E.g. to request a "
            "waveform starting 30 seconds earlier than the specified time "
            "use '-o -30'."}),
        # (("--noevents",), {
        #     'action': "store_true",
        #     'dest': "noevents", 'default': False,
        #     'help': "Deactivate fetching event data using FDSNWS and "
        #             "plotting theoretical arrivals."}),
        (("--event",), {
            'dest': "event", 'type': "str",
            'default': '',
            'help': "Filename (or path) of event file to load."}),
        )

What happened to --files? Thanks,

Dylan

megies commented 8 years ago

Anything that is not an option but a command line argument is read in as waveforms/station metadata. So basically just add your filenames at the end of the call. But yes, it might be clearer to have it in the Parser setup explicitly like here

See https://github.com/megies/obspyck/issues/10#issue-45621787