Dataset Module¶
+Bounds¶
+-
+
-
+class
dataset.
Bounds
(lat_min, lat_max, lon_min, lon_max, start=None, end=None)¶
+ Container for holding spatial and temporal bounds information.
+Certain operations require valid bounding information to be present for +correct functioning. Bounds guarantees that a function receives well +formed information without the need to do the validation manually.
+Spatial and temporal bounds must follow the following guidelines.
+-
+
- Latitude values must be in the range [-90, 90] +
- Longitude values must be in the range [-180, 180] +
- Lat/Lon Min values must be less than the corresponding Lat/Lon Max +values. +
- Temporal bounds must a valid datetime object +
Default Bounds constructor
++
++ + + +Parameters: +-
+
- lat_min (
float
) – The minimum latitude bound.
+ - lat_max (
float
) – The maximum latitude bound.
+ - lon_min (
float
) – The minimum longitude bound.
+ - lon_max (
float
) – The maximum longitude bound.
+ - start (
datetime.datetime
) – An optional datetime object for the starting +datetime bound.
+ - end (
datetime.datetime
) – An optional datetime object for the ending datetime bound.
+
+ +Raises: +ValueError
+
Dataset¶
+-
+
-
+class
dataset.
Dataset
(lats, lons, times, values, variable=None, units=None, origin=None, name='')¶
+ Container for a dataset’s attributes and data.
+Default Dataset constructor
++
++ + + +Parameters: +-
+
- lats (
numpy.ndarray
) – One dimensional numpy array of unique latitude values.
+ - lons (
numpy.ndarray
) – One dimensional numpy array of unique longitude values.
+ - times (
numpy.ndarray
) – One dimensional numpy array of unique python datetime +objects.
+ - values (
numpy.ndarray
) – Three dimensional numpy array of parameter values with +shape [timesLength, latsLength, lonsLength].
+ - variable (
string
) – Name of the value variable.
+ - units (
string
) – Name of the value units
+ - name (
string
) – An optional string name for the Dataset.
+ - origin (
dict
) – An optional object used to specify information on where +this dataset was loaded from.
+
+ +Raises: +ValueError
+-
+
-
+
spatial_boundaries
()¶
+ Calculate the spatial boundaries.
++
++ + + +Returns: The Dataset’s bounding latitude and longitude values as a +tuple in the form (min_lat, max_lat, min_lon, max_lon) + + +Return type: +tuple()
of the form (float
,float
, +float
,float
).
-
+
-
+
spatial_resolution
()¶
+ Calculate the latitudinal and longitudinal spatial resolution.
++
+If self.lats and self.lons are from curvilinear coordinates, +the output resolutions are approximate values.+
++ + + +Returns: The Dataset’s latitudinal and longitudinal spatial resolution +as a tuple of the form (lat_resolution, lon_resolution). + + +Return type: ( +float
,float
)
-
+
-
+
temporal_resolution
()¶
+ Calculate the temporal resolution.
++
++ + + +Raises ValueError: +If timedelta.days as calculated from the sorted list of times is an unrecognized value a ValueError is raised. + +Returns: The temporal resolution. + + +Return type: +string
-
+
-
+
time_range
()¶
+ Calculate the temporal range
++
++ + + +Returns: The start and end date of the Dataset’s temporal range as +a tuple in the form (start_time, end_time). + + +Return type: +tuple()
of the form (datetime.datetime
, +datetime.datetime
)
- lats (