class BaseBuilder(object):
Known subclasses: fetchtool.Builders.CSVBuilder, fetchtool.Builders.FDSNBuilder, fetchtool.BuildersSc3.ArcLinkFDSNBuilder
This is the Builders Super Class
All Builders should implement the BaseBuilder class
| Static Method | event |
Generate a printout list of individual events in the request |
| Static Method | filter |
Filter channels to be requested. |
| Static Method | filter |
Filter the request based on the items, mode and operation. |
| Static Method | filter_net |
Filter out request lines that are already listed in the existing list. |
| Static Method | filter |
Filter out request lines not overlaping with this datetime range |
| Static Method | load |
Load a request from file |
| Static Method | map |
Make a map using cartopy representing the request. |
| Static Method | reqlen |
Count the total number of lines in request |
| Static Method | request |
Show some stats from the request |
| Static Method | save |
Save a built request to file |
| Static Method | show |
Write a summary of the request to the screen |
| Static Method | station |
Generate a printout list of individual stations in the request |
| Static Method | stev |
Generate a printout list of events and stations in the request |
| Method | set |
Enable of disable the use of restricted station while building the request |
| Method | set |
Show events obtained from server before continuing to build the request. |
| Static Method | __x |
Undocumented |
| Static Method | _get |
Undocumented |
| Method | __build |
t0 is a UTCDateTime eventLatitude is degrees eventLongitude is degrees eventDepth is in Meters |
| Method | __build |
Undocumented |
| Method | __build |
networkCode is String stationCode is String stationLatitude is degrees stationLongitude is degrees stationElevation is Meters |
| Method | __find_arrival |
delta is in degrees depth is in meters |
| Method | __init__ |
Undocumented |
| Method | _build |
Undocumented |
| Method | _build |
Undocumented |
| Method | _check |
Undocumented |
| Method | _fill |
Undocumented |
| Method | _fill |
Undocumented |
| Method | _get |
Undocumented |
| Method | _organize |
Undocumented |
| Method | _organize |
Undocumented |
| Method | _resolve |
Undocumented |
| Instance Variable | __include |
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 event_list(request, fields=[
Generate a printout list of individual events in the request
This method can be used to generate a print out list of the events in the request. Its output can be customized using the fields parameters. Aditionaly it also returns a list with the output that can be consumed into your program.
| Parameters | |
request:request | The input request |
fields:list | A list of fields to be reported and returned. |
separator:str, default " " | A character that will be used as field separator (like "," to make a csv) |
formats:dict, default {} | A dictionary of formats to change each field number formating. |
destination:file, default sys.stdout | An open file for destination of the print out. |
| Returns | |
list | A data list including the selected fields. |
def filter_channels(request, allowedChannels='Z'):
Filter channels to be requested.
This method will filter OUT all channels that are not in the allowedChannels variable.
Warning
Request is filtered inplace.
| Parameters | |
request:request | The input request for filtering |
allowedstr, default "Z" | A string with all allowed channel codes. Examples are: "Z", "12", "NE" |
| Returns | |
request | The filtered request |
def filter_netsta(request, items, mode='N.S', operation='keep'):
Filter the request based on the items, mode and operation.
This method can be used to filter IN (operation="keep") or filter OUT (operation="remove") request lines from request based on its network/station values. The mode parameter indicate if items is a list of networks, stations of network.station values. Items is always a list.
Warning
Requests is filtered inplace.
| Parameters | |
request:request | A request to process. This will be modified. |
items:list | A list of items to keep in the request. |
mode:str | A string to indicate the mode of operation, can be N.S, N or S to indicate Network and Stations, Network or Station. |
operation:str, default "keep" | A parameter to indicate if we should keep the supplied values (operation="keep", default) or remove (operation="remove") from the request. |
| Returns | |
request | The request |
def filter_netStationEvent(request, existing, useNetwork=False, precision=60.0):
Filter out request lines that are already listed in the existing list.
existing is a list of (Network.Station, EventId ) tuples. Network can be ommited if useNetwork = False.
eventIds encodes event origin times, when comparing a tolerance of precision is assumed due to changes in event location between built requests.
def filter_timewindow(request, start=None, end=None):
Filter out request lines not overlaping with this datetime range
This method will remove request lines from the request that do not overlap the indicated time interval. The time interval can be open to the left or right.
Warning
Requests are filtered inplace.
| Parameters | |
request:request | The input request to be filtered |
start:str or UTCDateTime, default None | The start of the interval to consider. None value indicates that the interval is open to the left. |
end:str or UTCDateTime, default None | The end of the interval to consider. None value indicates that the interval is open to the right. |
| Returns | |
request | The filtered request |
def load_request(filename):
Load a request from file
| Parameters | |
filename:str | A filename to read request from |
| Returns | |
request | The request object loaded from filename |
def map_request(request, add_lines=False, enhance=None, showonly=None, global_map=True, grids_on=True):
Make a map using cartopy representing the request.
It plots all individual stations and events in the request. Map can be customized from the input parameters.
Parameter
- request : request
- The input request to plot
- add_lines : bool, default False
- Show a line connecting events and stations on the request
- enhance : str, default None
- A list of stations ids and/or events ids to be enhanced on the map
- showonly : str, default None
- One eventid or one stationid to be shown.
- global_map : bool, default True
- Show a global map (True) or a map around stations and events (False)
- grids_on : bool, default True
- Enable or disable the display of grids on the map
def reqlen(request):
Count the total number of lines in request
| Parameters | |
request:request | The request |
| Returns | |
int | The number of lines of request in request |
def request_stats(request):
Show some stats from the request
Parameter
- request : request
- The input request
def save_request(filename, request, overwrite=False):
Save a built request to file
| Parameters | |
filename:str | The filename to write to. |
request:request | The request to be written. |
overwrite:bool, default True | If the could should overwrite the file if it exists. |
def show_request(request, compact=True):
Write a summary of the request to the screen
| Parameters | |
request:request | A request |
compact:bool, default True | Use a compact mode to save space on screen |
def station_list(request, fields=[
Generate a printout list of individual stations in the request
This method can be used to generate a print out list of the stations in the request. Its output can be customized using the fields parameters. Aditionaly it also returns a list with the output that can be consumed into your program.
| Parameters | |
request:request | The input request |
fields:list | A list of fields to be reported and returned. |
separator:str, default " " | A character that will be used as field separator (like "," to make a csv) |
formats:dict, default {} | A dictionary of formats to change each field number formating. |
destination:file, default sys.stdout | An open file for destination of the print out. |
| Returns | |
list | A data list including the selected fields. |
def stev_list(request, fields=[
Generate a printout list of events and stations in the request
This method can be used to generate a print out list of the stations and events in the request. Its output can be customized using the fields parameters. Aditionaly it also returns a list with the output that can be consumed into your program.
| Parameters | |
request:request | The input request |
fields:list | A list of fields to be reported and returned. |
separator:str, default " " | A character that will be used as field separator (like "," to make a csv) |
formats:dict, default {} | A dictionary of formats to change each field number formating. |
destination:file, default sys.stdout | An open file for destination of the print out. |
| Returns | |
list | A data list including the selected fields. |
Enable of disable the use of restricted station while building the request
| Parameters | |
truebool | A flag to enable (true) disable (false) the use of restricted stations. |
Show events obtained from server before continuing to build the request.
Parameter
- true_false : bool
- A True or False value that will activate or disable the Show Event feature.
def __x_list(data, fields, formats, validfields, formatrule, separator, destination):
Undocumented
def _getChannelList(station, t0, targetsps, instcode):
fetchtool.Builders.CSVBuilder, fetchtool.Builders.FDSNBuilder, fetchtool.BuildersSc3.ArcLinkFDSNBuilderUndocumented
t0 is a UTCDateTime eventLatitude is degrees eventLongitude is degrees eventDepth is in Meters
networkCode is String stationCode is String stationLatitude is degrees stationLongitude is degrees stationElevation is Meters
fetchtool.Builders.CSVBuilder, fetchtool.Builders.FDSNBuilder, fetchtool.BuildersSc3.ArcLinkFDSNBuilderUndocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented