eidaqc.eida_inventory module
Test ‘get_stations’ response, compare retrieved networks between routing client and separate requests to EIDA servers directly.
- class eidaqc.eida_inventory.EidaInventory(reqlevel, starttime=UTCDateTime(2021, 12, 16, 18, 3, 30, 662353), endtime=UTCDateTime(2021, 12, 15, 18, 3, 30, 662363), wanted_channels=('HHZ', 'BHZ', 'EHZ', 'SHZ'), timeout=240, ref_networks_servers={}, datapath='/home/docs/checkouts/readthedocs.org/user_builds/eidaqc/checkouts/latest/docs/source', rotate_log_at='midnight', inv_log_bckp_count=30, rotate_log_at_time=None, resultfile_kwargs={}, **kwargs)
Bases:
object
Manage inventory test.
- check4missing_networks(reference_networks)
- print_results(runtime=99999.9)
- routing_request()
Request inventories using obspy.clients.fdsn.RoutingClient( “eida-routing” )
RoutingClient retrieves all available inventories in EIDA virtual network without specifying a server. It finds its way to the server “on its own”.
Returns and sets attribute rnets which is a set of all networks retrieved.
- server_request(servers=None)
Request inventories from servers directly.
Uses obspy.clients.fdsn.client.Client(server) on each server in EidaInventory.servers or servers if not None.
Returns and sets attribute snets which is a set of all networks retrieved.
- class eidaqc.eida_inventory.Logtext(datapath, rotate_log_at, inv_log_bckp_count, rotate_log_at_time=None, **kwargs)
Bases:
object
Manage output of results from inventory test
We use the logging module with a TimedRotatingFileHandler to log the results. The handler allows to renew the current logfile at a specified time. A number of backup files to be kept, counting from now into the past, can be chosen.
Example
Start a new file at each monday at midnight, keep results up to 1 year:
From the config file only some arguments of the log handler can be accessed, allowing only for rotations after 24h or 7 days. However, if used as module you can set all additional parameters.
- write(text)
Write text to logger and result file.
- eidaqc.eida_inventory.run(reqlevel, configfile)