geoips.plugins.modules.readers.utils package#
Submodules#
geoips.plugins.modules.readers.utils.geostationary_geolocation module#
Generalized geolocation calculations for geostationary satellites.
- exception geoips.plugins.modules.readers.utils.geostationary_geolocation.AutoGenError[source]#
Bases:
Exception
Raise exception on auto generated geolocation error.
- exception geoips.plugins.modules.readers.utils.geostationary_geolocation.CachedGeolocationIndexError[source]#
Bases:
IndexError
Raise exception on cached geolocation IndexError.
- geoips.plugins.modules.readers.utils.geostationary_geolocation.calculate_solar_angles(metadata, lats, lons, dt, resource_tracker=None, area_def=None, geolocation_cache_backend=None, chunk_size=None, cache_solar_angles=False, scan_datetime=None)[source]#
Calculate solar angles.
- geoips.plugins.modules.readers.utils.geostationary_geolocation.check_geolocation_cache_backend(cache_backend, supported_backends=('memmap', 'zarr'))[source]#
Check if requested geolocation cache backend is supported.
Perhaps this should be converted to a decorator later on?
- Parameters:
cache_backend (str) – Library name used to create cached geolocation files (e.g. zarr or memmap)
supported_backends (list or tuple, optional) – Supported cache backends, by default (“memmap”, “zarr”)
- Raises:
ValueError – If cache_backend is not in supported_backends
- geoips.plugins.modules.readers.utils.geostationary_geolocation.construct_cache_filename(pref, metadata, area_def=None, cache_backend='memmap', chunk_size=None)[source]#
Construct a cached file name.
- Parameters:
pref (str) – Prefix to identify type of cached data
metadata (dict) – Top level metadata for dataset
area_def (pyresample.area_definition, optional) – Area definition subsector of data, by default None
cache_backend (str, optional) – Specify to use either numpy.memmao or zarray for cache, by default “memmap”
chunk_size (int, optional) – zarray cache chunk size, by default None
- Returns:
File name for cached data
- Return type:
str
- geoips.plugins.modules.readers.utils.geostationary_geolocation.get_data_cache_filename(pref, metadata, area_def=None, cache_backend='memmap', chunk_size=None, scan_datetime=None)[source]#
Get the full file path for a cached calibrated data file.
- Parameters:
pref (str) – Prefix to identify type of cached data
metadata (dict) – Top level metadata for dataset
area_def (pyresample.area_definition, optional) – Area definition subsector of data, by default None
cache_backend (str, optional) – Specify to use either numpy.memmao or zarray for cache, by default “memmap”
chunk_size (int, optional) – zarray cache chunk size, by default None
- Returns:
Full file path for cached data
- Return type:
str
- geoips.plugins.modules.readers.utils.geostationary_geolocation.get_geolocation(dt, gmd, fldk_lats, fldk_lons, BADVALS, area_def=None, resolution=None, geolocation_cache_backend='memmap', chunk_size=None, cache_solar_angles=False, scan_datetime=None, resource_tracker=None)[source]#
Gather and return the geolocation data for the input metadata.
Input metadata should be the metadata for a single ABI data file.
If latitude/longitude have not been calculated with the metadata form the input data file they will be recalculated and stored for future use. They shouldn’t change often. This will be slow the first time it is called after a metadata update, but fast thereafter.
The same is true for satellite zenith and azimuth angles.
Solar zenith ang azimuth angles are always calculated on the fly. This is because they actually change. This may be slow for full-disk images.
- geoips.plugins.modules.readers.utils.geostationary_geolocation.get_geolocation_cache_filename(pref, metadata, area_def=None, geolocation_cache_backend='memmap', chunk_size=None, solar_angles=False)[source]#
Set the location and filename format for the cached geolocation files.
There is a separate filename format for satellite latlons and sector latlons
Notes
Changing geolocation filename format will force recreation of all files, which can be problematic for large numbers of sectors.
- geoips.plugins.modules.readers.utils.geostationary_geolocation.get_indexes(metadata, lats, lons, area_def, geolocation_cache_backend='memmap', chunk_size=None, resource_tracker=None)[source]#
Return two 2-D arrays containing the X and Y indexes.
These are indices that should be used from the raw data for the input sector definition.
geoips.plugins.modules.readers.utils.hrit_reader module#
Utility for reading HRIT datasets.
- class geoips.plugins.modules.readers.utils.hrit_reader.HritDtype[source]#
Bases:
object
HRIT data type.
- types = {'byte': 'B', 'int16': '>i2', 'int32': '>i4', 'int64': '>i8', 'int8': 'i1', 'uint16': '>u2', 'uint32': '>u4', 'uint64': '>u8', 'uint8': 'u1', 'unicode': 'U'}#
- exception geoips.plugins.modules.readers.utils.hrit_reader.HritError(msg, code=None)[source]#
Bases:
Exception
Raise exception when errors occur in reading xRIT data files.
- class geoips.plugins.modules.readers.utils.hrit_reader.HritFile(fname)[source]#
Bases:
object
Hrit File class.
- property annotation_metadata#
Return annotation metadata (ie, platform, start time, etc).
- property band#
Return band specified in block_128, if it exists.
- property basename#
Return file basename.
- property block_info#
Block info.
- property block_map#
Return block map.
- property compressed#
Return True if compressed, False if not.
- decompress(outdir)[source]#
Decompress an xRIT file and return a file handle.
The file will be decompressed to outdir and read from there.
Returns an HritFile instance for the decompressed file. If already decompressed, raises an HritError.
- property dirname#
Return file dirname.
- property epilogue#
Return epilogue.
- property file_type#
Return file_type.
- property geolocation_metadata#
Return geolocation metadata.
- property metadata#
Return metadata.
- property name#
Return name.
- property prologue#
Return prologue.
- property segment#
Return segment specified in block_128, if it exists.
- property start_datetime#
Return start_datetime.
geoips.plugins.modules.readers.utils.remss_reader module#
Read derived surface winds from REMSS SMAP, WINDSAT, and AMSR netcdf data.
Module contents#
geoips reader utils init file.