auromat.mapping.iss module

class auromat.mapping.iss.ISSMappingProvider(cacheFolder, id_=None, useRaw=True, altitude=110, sequenceInParallel=False, fastCenterCalculation=False, maxTimeOffset=3, raw_white_balance=None, raw_gamma=(1, 1), raw_bps=16, raw_auto_bright=False, noRawPostprocessCaching=True, baseUrl='http://arrrgh-tools.cosmos.esa.int/api/georef_seqs/', offline=False)[source]

Bases: auromat.mapping.mapping.BaseMappingProvider

Provider for ESA’s ISS Auroral Photography Mappings.

Parameters:
  • cacheFolder – folder where images and WCS files are downloaded to Note that each sequence must be in its own folder!
  • id (int) – sequence id, can be omitted in later calls due to caching
  • useRaw – If True, download raw images and apply necessary pre-processing locally if necessary (rotation, lens distortion correction, bad pixel removal). This requires rawpy and lensfunpy. If the sequence is not available in RAW format, then JPEGs will be downloaded instead.
  • altitude – in km
  • raw_white_balance – (r,g,b) tuple of multipliers for each color. If not given, uses white balance from data set (corresponds to daylight).
  • raw_gamma – (inv_gamma,toe_slope) tuple. For visually pleasing images, use (1/2.222,4.5), see recommendation BT.709. For linear images (photon count corresponds linearly to color values), use (1,1).
  • raw_bps – 8 or 16, bits per color sample
  • raw_auto_bright – If True, automatically brightens the image such that 1% of all pixels are fully saturated. Note that this may destroy useful image information.
  • noRawPostprocessCaching – If True, then postprocessed RAW files are not written to disk as .tiff files. This saves disk space but requires re-computation if a mapping is requested multiple times. If False, then postprocessed images are cached and must be deleted with removePostProcessedImages() if different RAW postprocessing settings should be used.
  • baseUrl – API base url to the mapping sequences
  • offline – if True, then missing data is not automatically downloaded, instead an exception is raised
contains(date)[source]

Return True if there is a mapping for the given date within +-maxTimeOffset.

Parameters:date (datetime) –
Return type:bool
download(dateBegin=None, dateEnd=None)[source]

Download part of or the whole sequence to the cache folder. An error is raised if self.offline is True and data has not been downloaded yet.

get(date)[source]

Returns the mapping which is closest to the given date within +-maxTimeOffset.

Parameters:date (datetime) –
Return type:BaseMapping or MappingCollection
Raises ValueError:
 when no mapping exists for the given date
getById(identifier)[source]

Returns the mapping with the given identifier.

Parameters:identifier (string) –
Return type:BaseMapping or MappingCollection
Raises ValueError:
 when no mapping with the given identifier exists
getSequence(dateBegin=None, dateEnd=None)[source]

Returns a generator of mappings ordered by date for the given date range. If dateBegin and dateEnd are None, then all available mappings are returned.

Parameters:
  • dateBegin (datetime) –
  • dateEnd (datetime) – inclusive
Return type:

list of BaseMapping or MappingCollection objects

range

The dates of the first and last available mappings.

Return type:datetime tuple (from, to)
removePostProcessedImages()[source]

Removes postprocessed RAW images. Useful when noRawPostprocessCaching=False and different RAW postprocessing settings need to be applied.