AuScope / seed-vault

Other
2 stars 0 forks source link

station search: select by time & option for expanded detail #120

Closed filefolder closed 1 week ago

filefolder commented 2 weeks ago

when searching stations it appears to call the below from seismoloader.py

def get_selected_stations_at_channel_level(settings: SeismoLoaderSettings):
    waveform_client = Client(settings.waveform.client)
    if settings.station and settings.station.client: # config['STATION']['client']:
        station_client = Client(settings.station.client) # Client(config['STATION']['client'])
    else:
        station_client = waveform_client

    invs = Inventory()
    for network in settings.station.selected_invs:
        for station in network:
            try:
                updated_inventory = station_client.get_stations(
                    network=network.code,
                    station=station.code,
                    level="channel"
                )

                invs += updated_inventory

            except Exception as e:
                print(f"Error updating station {station.code}: {e}")

    settings.station.selected_invs = invs

    return settings

It would be faster to also implement the starttime and endtime kwargs in get_stations which are provided in the search filters... this may significantly reduce the download size as well as remove any stations which fit the search parameter, but don't actually have data

also

I think a good default channel filter would be "?[HN]?" which will only select seismic data and avoid all the other diagnostic stuff. I think pre-populating the filter window with this so people can see what's happening would be ideal as well as show users how it works.

also

I think we should edit the station info that is returned in the table. We don't need elevation, waste of space. But it would be good to have columns for start_date and end_date (e.g. sta.start_date). (note end_date can be None). Also helpful to an "details" popup/popout that can show the contents and span of a station's channels.

in obspy this is built in e.g.

In [8]: sta
Out[8]: 
Station AI45 (Jurien Bay)
    Station Code: AI45
    Channel Count: None/6 (Selected/Total)
    2024-02-07T00:56:00.000000Z - 
    Access: open Alternate Code: OA.AI45 
    Latitude: -29.9886, Longitude: 114.9982, Elevation: 2.0 m
    Available Channels:
        ..HH[ZNE]   100.0 Hz  2024-02-07(038) -     
        ..LH[ZNE]     1.0 Hz  2024-02-07(038) -

worst-case, at least just a column that shows what channels each station has, e.g. HH[ZNE],LH[ZNE] so people can quickly eyeball

filefolder commented 1 week ago

small update on this, if we are setting the default channel filter to ?[HN]?, this would actually have to be ?H?,?N? in the get_stations call as [] are not supported there

bmotevalli commented 1 week ago

no more using get_selected_stations_at_channel_level, instead using get_stations. Bascially, I have fall back to how initially we where doing this, ie, to get the stations at the channel level in the station step. get_stations function already includes the time filter.

Regarding default values, @NTaherifar will create a separate issue for desired default values in config file and required validations.