Skip to content

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.

find_grasp_archive_dates

find_grasp_archive_dates(site_name: str, start_date: str | date | None = None, end_date: str | date | None = None, base_path: str | Path | None = None) -> list[datetime.date]

pydiva.geoms.geoms_writer

TYPE_MAPPINGS module-attribute

TYPE_MAPPINGS = {dtype('float32'): ('f4', 'REAL'), dtype('float64'): ('f8', 'DOUBLE'), dtype('int32'): ('i4', 'INTEGER')}

Object

__init__

__init__() -> None

__setattr__

__setattr__(key, value) -> None

GeomsWriter

output_path instance-attribute

output_path = Path(output_path)

site instance-attribute

site = site or 'n.a.'

results instance-attribute

results = None

geoms_file instance-attribute

geoms_file = None

__init__

__init__(output_path: str | Path, site: str | None = None) -> None

write

write(results: PixelResults)

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_constants

write_constants()

write_dimensions

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

write_arrays

write_arrays()

get_datetimes

get_datetimes()

Returns all datetimes in the results in the mjd2k format

get_wavelengths

get_wavelengths()

Returns all wavelengths in the results in nm

get_altitudes

get_altitudes()

Returns all altitudes of the vertical profile in m

get_aerosol_components staticmethod

get_aerosol_components()

get_phase_matrix_angles

get_phase_matrix_angles()

Returns an array of angles for the phase matrices

get_bins

get_bins()

Returns the radiuses of the size distribution bins

get_measurement_types staticmethod

get_measurement_types()

write_file_metadata

write_file_metadata()

datetime_to_mjd2k

datetime_to_mjd2k(date: datetime) -> float

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

results_to_geoms

results_to_geoms(results: PixelResults, site: str, output_path: str | Path)