seismic.ASDFdatabase package

Submodules

seismic.ASDFdatabase.ClientUtils module

class seismic.ASDFdatabase.ClientUtils.Client2ASDF(client='IRIS', network='AU')[source]

Bases: object

Object to query IRIS or other client with a bounding box and time interval. Returns ASDF containing station information and data for interval.

queryByBBoxInterval(outputFileName, bbox, timeinterval, chan='*Z', bbpadding=2, event_id=None, verbose=False)[source]

Time interval is a tuple (starttime,endtime)

seismic.ASDFdatabase.FederatedASDFDataSet module

seismic.ASDFdatabase.asdf2mseed module

Description:

Small utility for exporting mseed files from an asdf file in parallel.

References:

CreationDate: 06/08/18 Developer: rakib.hassan@ga.gov.au

Revision History:

LastUpdate: 04/12/17 RH LastUpdate: dd/mm/yyyy Who Optional description

seismic.ASDFdatabase.asdf2mseed.dump_traces(ds, sn_list, start_date, end_date, length, min_length_sec, output_folder)[source]

Dump mseed traces from an ASDF file in parallel

Parameters:
  • ds – ASDF Dataset

  • sn_list – station list to process

  • start_date – start date

  • end_date – end date

  • length – length of each mseed file

  • output_folder – output folder

seismic.ASDFdatabase.asdf_preprocess module

Description:

Reads waveforms from an ASDF file, optionally applies instrument response correction, resamples and outputs them to another ASDF file. This preprocessing is crucial for large-scale studies involving > 10000 Green’s Functions, e.g. in ambient noise tomography. This approach significantly reduces IO bottlenecks and computational costs associated with having to apply instrument response corrections on data from a given station in alternative workflows.

References:

CreationDate: 18/07/19

Developer: rakib.hassan@ga.gov.au

Revision History:

LastUpdate: 18/07/19 RH LastUpdate: dd/mm/yyyy Who Optional description

seismic.ASDFdatabase.asdf_preprocess.create_station_asdf(input_asdf, output_folder, resample_rate, instrument_response_inventory, instrument_response_output, water_level)[source]
seismic.ASDFdatabase.asdf_preprocess.getStationInventory(master_inventory, inventory_cache, netsta)[source]

seismic.ASDFdatabase.create_small_chunks module

seismic.ASDFdatabase.create_small_chunks.create_chunk(out_dir, trace, st_time, end_time, sta)[source]
seismic.ASDFdatabase.create_small_chunks.main()[source]

seismic.ASDFdatabase.plot_data_quality module

seismic.ASDFdatabase.query_input_yes_no module

From http://code.activestate.com/recipes/577058/

seismic.ASDFdatabase.query_input_yes_no.query_yes_no(question, default='yes')[source]

Ask a yes/no question via input() and return their answer.

“question” is a string that is presented to the user. “default” is the presumed answer if the user just hits <Enter>. It must be “yes” (the default), “no” or None (meaning an answer is required of the user).

The “answer” return value is one of “yes” or “no”.

seismic.ASDFdatabase.sc3toasdf module

Description:

Reads waveforms (within a given time-range) from a Seiscomp3 server and dumps out ASDF files, along with a json file containing associated metadata

References:

CreationDate: 13/09/18 Developer: rakib.hassan@ga.gov.au

Revision History:

LastUpdate: 22/08/18 RH LastUpdate: dd/mm/yyyy Who Optional description

class seismic.ASDFdatabase.sc3toasdf.DictToStr[source]

Bases: dict

seismic.ASDFdatabase.sc3toasdf.hasOverlap(stime1, etime1, stime2, etime2)[source]
seismic.ASDFdatabase.sc3toasdf.make_ASDF_tag(tr, tag)[source]

seismic.ASDFdatabase.seisds module

class seismic.ASDFdatabase.seisds.SeisDB(json_file=False, generate_numpy_index=True)[source]

Bases: object

generateIndex()[source]
get_data_percentage(net, sta, chan, tags)[source]
get_gaps_intervals(net, sta, chan, tags)[source]
get_recording_intervals(net, sta, chan, tags)[source]
get_unique_information()[source]

Method to retreive the unique channels and tags within an ASDF file from the JSON Database :return: (unique channels, unique tags)

Method to test if a channel code is related to a given net/stn/tag/loc :param chan: Channel Code, String :param net: Network Code, String :param sta: Station Code, String :param sta: Location Code, String :return: True/False, Bool

queryByTime(net, sta, chan, tags, query_starttime, query_endtime)[source]
retrieve_full_db_entry(json_key)[source]

Method to take an output from queryByTime and get the full information from the original JSON db :return: full DB

seismic.ASDFdatabase.utils module

Module contents