class documentation

class FDSNBuilder(BaseBuilder):

View In Hierarchy

Build a request using a FDSN server for Event and another for Station metadata

This class implements a request builder module that uses FDSN calls to servers to fetch information and build a request.

Parameters
fdsn_event_urlThe URL for the Event FDSN server.
fdsn_station_urlThe URL for the Station FDSN server.
Method eventBased Perform the search of events and find stations based on the events
Method eventidBased Use a specific eventid or a list of eventids to build a request
Method list_networks Perform a simple query to find networks in the station server
Method list_stations Perform a simple query to find stations from given network in the station server
Method stationBased Perform the search of stations and find events based on the stations
Instance Variable e_fdsn_client This is the saved instance of the FDSN station client
Instance Variable s_fdsn_client This is the saved instance of the FDSN event client
Static Method _choose Undocumented
Static Method _getChannelList Undocumented
Method __collect_stations Undocumented
Method __init__ Undocumented
Method __str__ Undocumented

Inherited from BaseBuilder:

Static Method event_list Generate a printout list of individual events in the request
Static Method filter_channels Filter channels to be requested.
Static Method filter_netsta Filter the request based on the items, mode and operation.
Static Method filter_netStationEvent Filter out request lines that are already listed in the existing list.
Static Method filter_timewindow Filter out request lines not overlaping with this datetime range
Static Method load_request Load a request from file
Static Method map_request Make a map using cartopy representing the request.
Static Method reqlen Count the total number of lines in request
Static Method request_stats Show some stats from the request
Static Method save_request Save a built request to file
Static Method show_request Write a summary of the request to the screen
Static Method station_list Generate a printout list of individual stations in the request
Static Method stev_list Generate a printout list of events and stations in the request
Method setAllowRestricted Enable of disable the use of restricted station while building the request
Method setShowEvents Show events obtained from server before continuing to build the request.
Static Method __x_list Undocumented
Method __build_event_dictionary t0 is a UTCDateTime eventLatitude is degrees eventLongitude is degrees eventDepth is in Meters
Method __build_pick_dictionary Undocumented
Method __build_station_dictionary networkCode is String stationCode is String stationLatitude is degrees stationLongitude is degrees stationElevation is Meters
Method __find_arrivalTime delta is in degrees depth is in meters
Method _build Undocumented
Method _build_predefined Undocumented
Method _check_param Undocumented
Method _fill_kwargsevent Undocumented
Method _fill_kwargsstation Undocumented
Method _getOrigin Undocumented
Method _organize_by_event Undocumented
Method _organize_by_station Undocumented
Method _resolve_phasenames Undocumented
Instance Variable __include_restricted A global flag used by self._fill_kwargsstation to include or not restricted inventory.
Instance Variable __tworker Undocumented
Instance Variable _plotevents A global flag used by eventBased and stationBased to show or not events.
def eventBased(self, t0, t1, targetSamplingRate, allowedLocGainList, dataWindowRange, phasesOrPhaseGroupList, eventRestrictionArea, magnitudeRange, depthRange, networkStationList=None, stationRestrictionArea=None, distanceRange=None):

Perform the search of events and find stations based on the events

This method use the given time, region depth and magnitude constrains to search for events in the given FDSN server and for each event search for stations given the other parameters (networkStationList, stationRestrictionArea and distanceRange) to build a request. It will search for suitable data channels inside each station using the targetSamplingRate and allowedLocGainList.

Final time window for each request line will be based on the theoretical arrival time for phase phasesOrPhaseGroupList (use 'ttp' for P-waves or read the docs on obspy taup class) using the dataWindowRange parameter interval.

Will consider the restricted flag state of the Builder.

Parameters
t0:str or UTCDateTime
t1:str or UTCDateTime
targetSamplingRate:int
allowedLocGainList:list
dataWindowRange:Range
phasesOrPhaseGroupList:str
eventRestrictionArea:AreaRange
magnitudeRange:Range
depthRange:Range
networkStationList:list, optional
stationRestrictionArea:AreaRange, optional
distanceRange:Range, optional
Returns
requestA request object (dict of list of tuples)
def eventidBased(self, eventid_or_list_of, dataWindowRange):

Use a specific eventid or a list of eventids to build a request

This method will obtain from the event FDSN server the information for the given event ids and using the return information will build the request. The request will only contain stations that are used to locate the event.

Phased marks will be saved to be added to the final SAC file header. The only additional parameter is the dataWindowRange that will be used to determine de request time window. For each channel, on each station a time window will be determined using the first Phase plus the start of the dataWindowRange and the last Phase plus the end of the dataWindowRange.

Event picked stations that are not on the station FDSN server are also ignored from the request.

Will consider the restricted flag state of the Builder.

Parameters
eventid_or_list_of:str or list
dataWindowRange:Range
Returns
requestA request object (dict of list of tuples)
def list_networks(self, t0, t1):

Perform a simple query to find networks in the station server

Will consider the restricted flag state of the Builder.

Parameters
t0:str or UTCDateTimeThe starttime for the search
t1:str or UTCDateTimeThe endtime for the search
Returns
inventoryThe metadata inventory in obspy format with level = network.
def list_stations(self, t0, t1, net='*', do_map=False, global_map=False, grids_on=False):

Perform a simple query to find stations from given network in the station server

Will consider the restricted flag state of the Builder.

Parameters
t0:str or UTCDateTimeThe starttime for the search
t1:str or UTCDateTimeThe endtime for the search
net:str, default "*"A network code pattern to restrict the search
do_map:bool, default FalseGenerate a map of stations
global_map:bool, default FalseRestrict map to station region
grids_on:bool, default FalseAdd a grid to the map
Returns
inventoryThe metadata inventory in obspy format with level = network.
def stationBased(self, t0, t1, targetSamplingRate, allowedLocGainList, dataWindowRange, phasesOrPhaseGroupList, networkStationList, stationRestrictionArea, eventRestrictionArea=None, magnitudeRange=None, depthRange=None, distanceRange=None):

Perform the search of stations and find events based on the stations

This method use the given time, codes and region to constrain the search for stations in the given FDSN server and for each station search for events given the other parameters (eventRestrictionArea, magnitudeRange, depthRange and distanceRange) to build a request. It will search for suitable data channels inside each station using the targetSamplingRate and allowedLocGainList.

Final time window for each request line will be based on the theoretical arrival time for phase phasesOrPhaseGroupList (use 'ttp' for P-waves or read the docs on obspy taup class) using the dataWindowRange parameter interval.

Will consider the restricted flag state of the Builder.

Parameters
t0:str or UTCDateTime
t1:str or UTCDateTime
targetSamplingRate:int
allowedLocGainList:list
dataWindowRange:Range
phasesOrPhaseGroupList:str
networkStationList:list
stationRestrictionArea:AreaRange
eventRestrictionArea:AreaRange, optional
magnitudeRange:Range, optional
depthRange:Range, optional
distanceRange:Range, optional
Returns
requestA request object (dict of list of tuples)
e_fdsn_client =

This is the saved instance of the FDSN station client

s_fdsn_client =

This is the saved instance of the FDSN event client

@staticmethod
def _choose(item, channel, targetsps, instcode):

Undocumented

@staticmethod
def _getChannelList(station, t0, targetsps, instcode):
def __collect_stations(self, E, O):

Undocumented

def __init__(self, fdsn_event_url, fdsn_station_url=None):
def __str__(self):

Undocumented