class documentation

class ShStation(object):

View In Hierarchy

Class to handle Seismic Handler station data inside a STATINF.DAT like file.

Parameters
filenameThe filename of the file to handle.
appendA flag to indicate if new stations should be appended to the file.
Method add Add a station record
Method get Returns a record from the class
Method has Check that stcode is defined
Method save Save the data to the original open file or to a new file
Method __init__ Undocumented
Method _import Undocumented
Method _parseline Undocumented
Instance Variable _file Undocumented
Instance Variable _keys Undocumented
Instance Variable _modified Undocumented
Instance Variable _rawdata Undocumented
def add(self, stcode, lat, lon, elevation, array=None, xrel=None, yrel=None, name=None):

Add a station record

This method add a station record to the module. If it already in record an exception is raised.

Parameters
stcode:strThe station code
lat:floatThe station latitude in degrees
lon:floatThe station lonigtude in degrees
elevation:floatThe station elevation in meters
array:int, default NoneThe number of the array
xrel:float, default NoneThe xoffset inside the array
yrel:float, default NoneThe yoffset inside the array
name:str, default NoneThe name/description of the station
def get(self, stcode):

Returns a record from the class

Parameters
stcode:strThe code of the station to fetch
Returns
dictA dictionary with station information
def has(self, stcode):

Check that stcode is defined

Parameters
stcode:strThe station code to check
Returns
boolTrue (exists) or False (don't exist)
def save(self, filename=None):

Save the data to the original open file or to a new file

Parameters
filename:strThe optional filename to save data to. If it is None, the filename indicated on class instance is used.
def __init__(self, filename, append=True):

Undocumented

def _import(self):

Undocumented

def _parseline(self, line, linec):

Undocumented

_file =

Undocumented

_keys: dict =

Undocumented

_modified: bool =

Undocumented

_rawdata: list =

Undocumented