2.8.1. vacumm.tide.station_info
– Informations sur les stations et ports¶
Classes: | ||
---|---|---|
Inheritance diagram: | ||
Information about seaports and stations
StationInfo : A class to retrieve alot of information about seaports and stations. MeanSeaLevel : A class dedicated to mean sea level along french coast (more complete than StationInfo).
-
class
MeanSeaLevel
(msl=None, names=None, **kwargs)[source]¶ Bases:
vacumm.bathy.bathy.XYZBathy
Retrieve mean sea level at stations
- Information can be retrieved thanks to the following properties:
- .data: List of internal data, each element being [name, x, y, z] .names: List of seaport and station names .x or .lon: longitudes array (n,) .y or .lat: latitudes array (n,) .xy or coords: array of coordinates (2,n) .z or .sealevel: mean sea level array (n,) .xyz or .block: array combining coordinates and sea levels (3,n)
Example: >>> from vacumm.tide.station_info import MeanSeaLevel >>> msl = MeanSeaLevel() >>> for i in xrange(len(msl)): >>> print msl.names[i], msl.x[i], msl.y[i] >>> print len(msl.clip((-4,44.,0,48)))
See also
-
clip
(zone=None, inverse=False, **kwargs)[source]¶ Geographical selection of part of the data
- zone: (xmin,ymin,xmax,ymax) or a complex polygon (see
polygons()
). - inverse: Inverse the selection.
- zone: (xmin,ymin,xmax,ymax) or a complex polygon (see
-
names
¶ Get name of valid stations
-
exception
MeanSeaLevelError
[source]¶ Bases:
exceptions.Exception
-
class
Station
(*args, **kwargs)[source]¶ Bases:
dict
,vacumm.tide.station_info._StationPlot_
A station with its info as a result from
StationInfo
Example: >>> from vacumm import StationInfo >>> station = StationInfo().find('Brest', nmax=1) >>> print station.longitude
-
class
StationInfo
(nom=None, regexp=True, verbose=True, file=None, *args, **kwargs)[source]¶ Bases:
vacumm.tide.station_info._StationPlot_
Finding information about tidal stations
This class helps finding information on ports and tide jauge measurement stations. It attempts to search for a station using several possible criteria, and returns attributes such as ids, positions, mean sea level, etc (listed using methodattributes()
). See help onsearch()
method.Params: - nom: name or regexp to search for.
- regexp:
- file: File in wich to search for info
- verbose: Verbose mode
- All other keywords are passed to
search()
method after initialization.
-
find
(nom=None, regexp=True, verbose=False, *args, **kwargs)[source]¶ Search for a station using several possible criteria and load it.
- nom: Search within station names using this pattern
- regexp: If True, use regular expression for search within names [default: True]
- position: A two-element iterable ([lon,lat]) for searching for the closest station to this positions
- verbose: Verbose mode [default: True]
-
search
(nom=None, regexp=True, nmax=5, **kwargs)[source]¶ Search for stations using several possible criteria and display results.
- nom: Search within station names using this pattern
- regexp: If True, use regular expression for search within names [default: True]
- position: A two-element iterable ([lon,lat]) for searching for the closest station to this positions
- nmax: Maximal number of stations displayed [default: 5]
-
exception
StationInfoError
[source]¶ Bases:
exceptions.Exception