Note
This module needs a lot of cleanups !
Catalogue class manages coherency of the database and underlying storage (i.e. storagesets).
A Catalogue instance has a connection to database (conn) and is able to insert a new dataset (Catalogue.register()) or query database with DAP-like projection and selection constraints (Catalogue.getQueryFileList()).
All configuration parameters are read from pyctoh.ini.
A connection to a database.
Check if dataset is already registered in database.
Returns: | dataset_id if dataset is in db, None otherwise |
---|
Get ids of datasets that match the given constraints.
Parameters: |
|
---|---|
Returns: | a list of dataset_ids matching the given projection and constraints. |
Note
This module needs a lot of cleanups !
Dataset is PyCTOH’s pivot format for data from GDR.
Dataset loosely maps netCDF concepts of globals, variables, dimensions and attributes.
Bases: object
Convert native GDR to netCDF.
Parameters: |
|
---|
Get dataset bounding box.
Return (lat_min, lon_min, lat_max, lon_max), or None for empty dataset. lon_min means western bound. lon_max, eastern.
Crop dataset to bounding box.
TODO: handle time_hf (using lon_hf and lat_hf) as well... : if a variable is independant from lon and lat, it is kept as it.
Get min and max values of variable. If variable is “lon”, min and max are the western and eastern bounds longitudes, respectively.
Parameter: | variable – variable name |
---|---|
Returns: | (min, max ) tuple |
Reduce dataset according to selection
TODO : handle projection
Bases: object
Dimension object
Bases: object
PyCTOH’s representation of a variable.
Parameters: |
|
---|
Utility converter : convert type to netCDF type name.
>>> np2cdf(bool)
'i1'