pydiva.geoms
pydiva.geoms.geoms_loader
load_grasp_geoms
load_grasp_geoms(site_name: str, start_date: str | date | None = None, end_date: str | date | None = None, base_path: str | Path | None = None) -> xr.Dataset
Used to easily load GRASP results GEOMS files stored on the cloud server's archive without needing to know where to find it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
site_name
|
str
|
Full name of the site you are looking for. |
required |
start_date
|
str | date | None
|
Measurement start date of the data you are looking for. |
None
|
end_date
|
str | date | None
|
Measurement end date of the data you are looking for. |
None
|
base_path
|
str | Path | None
|
Default is the GRASP results geoms path on the cloud server, can be adjusted if needed. |
None
|
Returns:
| Type | Description |
|---|---|
Dataset
|
An xarray.Datset of the data in the loaded GEOMS file. |
pydiva.geoms.geoms_writer
TYPE_MAPPINGS
module-attribute
TYPE_MAPPINGS = {dtype('float32'): ('f4', 'REAL'), dtype('float64'): ('f8', 'DOUBLE'), dtype('int32'): ('i4', 'INTEGER')}
GeomsWriter
write
Write a results object in a file in the GEOMS format
This is done in multiple steps: 1. Constant values are written 2. Dimensions and their coordinates are written 3. Data arrays are written 4. File metadata is written
write_dimensions
Create the named dimensions that will later be used for arrays in the dataset
Each dimension has a unique name and is just an integer number describing the size
Also each dimension has coordinates, which are also set here as a 1D Array of the size of the dimension with the proper values
datetime_to_mjd2k
Convert datetime object to modified julian date 2000.
According to GEOMS documentation
The Modified Julian Date, MJD2K, used throughout this document is defined as follows: MJD2K is 0.000000 on January 1, 2000 at 00:00:00 UTC