Package atmopy :: Package observation :: Module location :: Class Station
[show private | hide private]
[frames | no frames]

Class Station


Stores information about an observation station
Method Summary
  __init__(self, str, type)
Initializes the instance in case 'str' and 'type' are not empty.
  __str__(self)
  FromAirparifString(self, str)
Sets station attributes from a string.
  FromBdqaString(self, str)
Sets station attributes from a string.
  FromDefaultString(self, str)
Sets station attributes from a string.
  FromEmepString(self, str)
Sets station attributes from a string.
  FromFile(self, filename, station_name, type)
Loads station attributes from a text file.
  FromPioneerString(self, str)
Sets station attributes from a string.
float GetAltitude(self)
Returns the altitude of the station.
list GetClosestIndex(self, origins, deltas)
Returns the indices of the closest grid center to the station.
string GetCountry(self)
Returns the country of the station.
float GetLatitude(self)
Returns the latitude of the station.
float GetLongitude(self)
Returns the longitude of the station.
string GetName(self)
Returns the name of the station.
string GetNetwork(self)
Returns the network name of the station.
string GetRealName(self)
Returns the real name of the station.
string GetType(self)
Returns the type of the station.
Boolean IsInsideBox(self, lat_min, lat_max, lon_min, lon_max)
Checks wether the station is inside a given area.
Boolean IsInsideGridBox(self, origins, deltas, lengths)
Checks wether the station is located inside a given area defined by (lat, lon) origins, deltas and lengths of cells.

Method Details

__init__(self, str='', type='')
(Constructor)

Initializes the instance in case 'str' and 'type' are not empty.
Parameters:
str - The string to initialize the station with.
           (type=string)
type - The type of the initialization string 'str'. It could be Pioneer or Emep.
           (type=string)

FromAirparifString(self, str)

Sets station attributes from a string.
Parameters:
str - The string in Airparif format that defines the station. The string contains the following fields (separated by comas):
  1. the station name;
  2. the longitude (format: DD MM SS);
  3. the latitude (format: DD MM SS);
  4. the type.
where coordinates are provided with degrees (DD), minutes (MM) and seconds (SS).
           (type=string)

FromBdqaString(self, str)

Sets station attributes from a string.
Parameters:
str - The string in BDQA format that defines the station. The string contains the following fields (separated by blank spaces):
  1. the station name (BDQA code);
  2. the station real-name;
  3. the latitude (float);
  4. the longitude (float);
  5. the type.

           (type=string)

FromDefaultString(self, str)

Sets station attributes from a string.
Parameters:
str - The string in default format that defines the station. The string contains the following fields (separated by semicolons):
  1. the station name;
  2. the station real name;
  3. the latitude (float);
  4. the longitude (float);
  5. altitude (float);
  6. the country;
  7. the station type;
  8. the network.
If the latitude, the longitude or the altitude is not available, it can be replaced, in the string, with any non-numerical value -- then it will be set to -1.e10.
           (type=string)

FromEmepString(self, str)

Sets station attributes from a string.
Parameters:
str - The string in Emep format that defines the station. The string contains the following fields (separated by blank spaces):
  1. the station name (Emep code);
  2. the station real-name;
  3. the latitude (DD MM SS [NS]);
  4. the longitude (DD MM SS [EO]);
  5. altitude (float).

           (type=string)

FromFile(self, filename, station_name, type)

Loads station attributes from a text file.
Parameters:
filename - The text file in which station attributes are to be found.
           (type=string)
station_name - The name of the station.
           (type=string)
type - The type of station file: Pioneer or Emep.
           (type=string)

FromPioneerString(self, str)

Sets station attributes from a string.
Parameters:
str - The string in Pioneer format that defines the station. The string contains the following fields (separated by blank spaces):
  1. the longitude (float);
  2. the latitude (float);
  3. discarded field;
  4. discarded field;
  5. country;
  6. station type;
  7. discarded field;
  8. station name;
  9. AASQA (network);
  10. other fields (discarded).

           (type=string)

GetAltitude(self)

Returns the altitude of the station.
Returns:
The altitude of the station.
           (type=float)

GetClosestIndex(self, origins, deltas)

Returns the indices of the closest grid center to the station.
Parameters:
origins - Coordinates of the lower-left grid center, i.e. (y_min, x_min).
           (type=(float, float) tuple)
deltas - Cell widths, i.e. (delta_y, delta_x).
           (type=(float, float) tuple)
Returns:
The indices along y and x, i.e. [index_y, index_x].
           (type=list)

GetCountry(self)

Returns the country of the station.
Returns:
The country of the station.
           (type=string)

GetLatitude(self)

Returns the latitude of the station.
Returns:
The latitude of the station.
           (type=float)

GetLongitude(self)

Returns the longitude of the station.
Returns:
The longitude of the station.
           (type=float)

GetName(self)

Returns the name of the station.
Returns:
The name of the station.
           (type=string)

GetNetwork(self)

Returns the network name of the station.
Returns:
The network name of the station.
           (type=string)

GetRealName(self)

Returns the real name of the station.
Returns:
The real name of the station.
           (type=string)

GetType(self)

Returns the type of the station.
Returns:
The type of the station.
           (type=string)

IsInsideBox(self, lat_min, lat_max, lon_min, lon_max)

Checks wether the station is inside a given area.
Parameters:
lat_min - Minimum latitude for area.
           (type=float)
lat_max - Maximum latitude for area.
           (type=float)
lon_min - Minimum longitude for area.
           (type=float)
lon_max - Maximum longitude for area.
           (type=float)
Returns:
True if Station is in given area, False otherwise.
           (type=Boolean)

IsInsideGridBox(self, origins, deltas, lengths)

Checks wether the station is located inside a given area defined by (lat, lon) origins, deltas and lengths of cells.
Parameters:
origins - (latitude, longitude) coordinates of the SW origin for the area.
           (type=(float, float) tuple)
deltas - (deltax, deltay) distance between two cells on latitude and longitude.
           (type=(float, float) tuple)
lengths - (sizex, sizey) number of cells on latitude and longitude.
           (type=(int, int) tupe)
Returns:
True if station is in given area, False otherwise.
           (type=Boolean)

Generated by Epydoc 2.1 on Tue May 19 10:37:12 2009 http://epydoc.sf.net