class documentation
class ShStation(object):
Class to handle Seismic Handler station data inside a STATINF.DAT like file.
| Parameters | |
| filename | The filename of the file to handle. |
| append | A 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:str | The station code |
lat:float | The station latitude in degrees |
lon:float | The station lonigtude in degrees |
elevation:float | The station elevation in meters |
array:int, default None | The number of the array |
xrel:float, default None | The xoffset inside the array |
yrel:float, default None | The yoffset inside the array |
name:str, default None | The name/description of the station |
def get(self, stcode):
Returns a record from the class
| Parameters | |
stcode:str | The code of the station to fetch |
| Returns | |
dict | A dictionary with station information |
def has(self, stcode):
Check that stcode is defined
| Parameters | |
stcode:str | The station code to check |
| Returns | |
bool | True (exists) or False (don't exist) |