snowex_db.upload.raster_mapping module#
- class snowex_db.upload.raster_mapping.RasterType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
EnumEnum for different types of raster files. value, description, abbreviation
- AMP1 = 'amp1'#
- AMP2 = 'amp2'#
- CANOPY_HEIGHT = 'canopy_height'#
- COR = 'corr'#
- DEM = 'DEM'#
- DEPTH = 'depth'#
- INT = 'int'#
- SWE = 'swe'#
- property abbreviation#
- property description#
- property pass_num#
- snowex_db.upload.raster_mapping.meta_from_annotation_file(annotation_file: Path, raster_type: RasterType, component: str, **kwargs) dict[source]#
Given an annotation file, return the metadata associated with this Args:
annotation_file: Path to the annotation file raster_type: The type of raster file (e.g., interferogram, amplitude, etc.) component: The component of the raster file (e.g., real, imaginary) **kwargs: Additional keyword arguments for metadata
- Returns:
A dictionary containing metadata for the raster file. keys are: - measurement_type: Type of the raster file - date: Date of the acquisition - units: Units of the raster file - comments: Comments about the raster file
- snowex_db.upload.raster_mapping.metadata_from_single_file(raster_file: Path, raster_type: RasterType, **kwargs)[source]#
Create the metadata dictionary from a single raster file and its type. Examples would be depth, dem, etc.
- Args:
raster_file: Path to the raster file raster_type: RasterType enum indicating the type of raster **kwargs: Additional keyword arguments for metadata
- Returns:
A dictionary containing metadata for the raster file. keys are: - type: Type of the raster file - date: Date of the acquisition - units: Units of the raster file - comments: Comments about the raster file
- snowex_db.upload.raster_mapping.rasters_from_annotation(annotation_file: Path, tif_dir: Path, **kwargs) List[Tuple[Dict[str, str], Path]][source]#
Given an annotation file, return the insar raster files associated with the file. Also return the metadata Args:
annotation_file: uavsar annotation file tif_dir: Path to the directory where the tif files are stored **kwargs: Additional keyword arguments for metadata
- Returns:
List of tuples containing metadata and the path to the raster file.