swirlspy.obs package

Submodules

swirlspy.obs.rain module

class swirlspy.obs.rain.Rain(filename, proj, duration=Timedelta('0 days 01:00:00'), NAN=3276.7)

Bases: object

A class for storing raingauge data. Rain object can represent just one raingauge, or a network of raingauges, depending on how many raingauges are inputted. Rain objects can be initialised from text files containing rainfall data.

Format of the text files should adhere to the following:

First line: Timestring (%Y%m%d%H%M) indicating the end time
of rainfall accumulation over a period of time.
Starting from second line, each line has four columns:
First column: Name of station.
Second column: Latitude (or y coordinate) of raingauges.
Third column: Longitude (or x coordinate) of raingauges.
Fourth column: Accumulated rainfall value.
Parameters
  • filename (str or list of strings) – Name(s) of text files to read for data to create a Rain object.

  • proj (str) – Name of coordinate system used in locating the observation.

  • duration (pandas.Timedelta) – Accumulation period of each file. Equivalent to the time interval between each file. Defaults to 60 minutes.

  • NAN (list of floats) – Data values to be ignored when reading the text file. Defaults to 3276.7.

start_time

Starting time when raingauge(s) start accumulating rainfall.

Type

pandas.Timestamp

end_time

Ending time when raingauge(s) stop accumulating rainfall.

Type

pandas.Timestamp

gauge_x

x-coordinate of raingauge(s) in given projection.

Type

numpy.1darray

gauge_y

y_coordinate of raingauge(s) in given projection.

Type

numpy.1darray

rainfall

Accumulated rainfall value of each raingauge(s), between start_time and end_time.

Type

numpy.1darray

rg_number

Number of raingauge(s).

Type

int

obs_type

Type of weather observation or parameter.

Type

str

proj

Name of observation used in locating the observation.

Type

str

data

An array of tuple(s), where each tuple contains (y_coord, x_coord, rainfall, station).

Type

numpy.1darray