swirlspy.obs package

Submodules

swirlspy.obs.lightning module

class swirlspy.obs.lightning.Lightning(filenames, proj, start_time, end_time, minutize=True)

Bases: object

A class for storing lightning data. This class is initialised from LLIS text file(s).

Parameters
  • filenames (str of list of str) – Name or path of file(s) to read.

  • proj (str) – Name of projection system.

  • start_time (pandas.Timestamp) – Start time of lightning observation period.

  • end_time (pandas.Timestamp) – End time of lightning observation period.

  • minutize (bool) – If True, timestamps are rounded down to the nearest minute. Defaults to True.

data

An array of tuples, where each tuple contains (time, y, x).

Type

array of tuples

start_time

Start time of lightning observation period.

Type

pandas.Timestamp

end_time

End time of lightning observation period.

Type

pandas.Timestamp

time

Time of lightning strikes.

Type

numpy.1darray

ly

Contains the y coodinates of lightning strikes.

Type

numpy.1darray

lx

Contains the x coodinates of lightning strikes.

Type

numpy.1darray

obs_type

Type of weather observation or parameter.

Type

str

proj

Projection system of y and x coordinates.

Type

str

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 projection system.

  • 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

station

Station IDs of raingauge(s).

Type

numpy.1darray

rg_number

Number of raingauge(s).

Type

int

obs_type

Type of weather observation or parameter.

Type

str

proj

Projection system of y and x coordinates.

Type

str

data

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

Type

numpy.1darray