polyfemos.back.station.Station — polyfemos 0.3.29 documentation

# polyfemos.back.station.Station

class `polyfemos.back.station.` `Station`(network_code='', station_code='', location_code='', locy=0.0, locx=0.0, epsg='', digitizer='', sensor='', starttime='', endtime='')

  Bases: `object`

  Class for handling information of one station

  Public Methods

  `__init__`(network_code='', station_code='', location_code='', locy=0.0, locx=0.0, epsg='', digitizer='', sensor='', starttime='', endtime='')
    Parameters

      - network_code (str) – Network code, e.g. “FN”

      - station_code (str) – Code of the station, e.g. “MSF”

      - location_code (str) – Location of the station, e.g. “00” or empty

      - locy (float) – Y coordinate

      - locx (float) – X coordinate

      - epsg (str) – EPSG number for `locx` and `locy` coordinates

      - digitizer (str) – Model/name of the station’s digitizer

      - sensor (str) – Model/name of the station’s sensor

      - starttime (`Ordinal`) –

      - endtime (`Ordinal`) –

  `add_parameter`(parameter)
    Parameters

      parameter (`Parameter`) –

  `covers_time`(t0)
    Parameters

      t0 (`Ordinal`) –

    Return type

      bool

    Returns

      `True` if `t0` is between `self.starttime` and `self.endtime`

  `create_header`()

    Creates the soh text file header

  `filter_parameters`(**kwargs)

    Filters `self.parameters` according to given `kwargs`. The values of the kwargs should be list of values, or one value. If given keyword argument is attribute of the `Parameter` class, and the given value(s) are not equal to the the parameter, the parameter is excluded.

  `get_header`(force=False)
    Parameters

      force (bool, optional) – defaults to `False`, if `True` the header is recreated even if it already exists

    Return type

      str

    Returns

      the header of the ‘stf’ file

  `get_id`()
    Return type

      str

    Returns

      e.g. “FN.MSF”

  Private Methods

  `_add_to_header`(field, *args)

    Any number of `args` can be provided, and are processed into a string repsentation of a list. Each arg is converted into a string as follows: `None` -> `""`, empty string `float('nan')` -> `"NaN"` `""` -> `"NaN"` `stringvalue -> "stringvalue"` `123 -> "123"`

    Parameters

      field (str) –

  `_compare`(op, other)

    Compares starttimes of the stations `self` and `other`. If station ids do not match, always returns `False`.

    Parameters

      - op (func) – comparison operation, e.g. `lt()`

      - other (`Station`) –

    Return type

      bool

    Returns

  Special Methods

  `__eq__`(other)
    Parameters

      other (`Station`) –

    Return type

      bool

    Returns

      returns `True` if ids of `self` and `other` are identical

  `__ge__`(other)

    see `_compare()` for more info

    Parameters

      other (`Station`) –

    Return type

      bool

    Returns

  `__gt__`(other)

    see `_compare()` for more info

    Parameters

      other (`Station`) –

    Return type

      bool

    Returns

  `__le__`(other)

    see `_compare()` for more info

    Parameters

      other (`Station`) –

    Return type

      bool

    Returns

  `__len__`()
    Return type

      int

    Returns

      How many parameters the station has

  `__lt__`(other)

    see `_compare()` for more info

    Parameters

      other (`Station`) –

    Return type

      bool

    Returns

  `__ne__`(other)
    Parameters

      other (`Station`) –

    Return type

      bool

    Returns

      opposite of `__eq__()`

  `__str__`()
    Return type

      str

    Returns

      somekind of string to represent the station