auromat.solving.eol module¶
This module allows to easily download images from NASA’s Earth Observation website in JPEG and RAW format.
As there is no API on NASA’s end, we have to rely on a certain URL structure, and, in case of RAW files, HTML structure. As this is not robust, it may fail if the website is restructured. In that case, the code has to be adapted.
Notes on JPEGs¶
JPEGs from the EOL archive are produced from the RAW camera files. Different post-processing settings have been applied during the production of these JPEGs, e.g. colour or exposure correction, or 180 degree rotation. This is also true for images that belong to a single sequence of images, that is, colour/exposure might change suddenly. The JPEGs are therefore not suitable for scientific purposes. On the other hand, they often have hot pixels removed. A lens distortion correction is typically not applied.
In theory the JPEGs can be used for astrometry while later using the RAW files for scientic purposes. This is however a risky process as it has to be guaranteed that the image orientation matches and that the lens distortion was not corrected in the JPEGs already. To prevent checking these things each time, it is better to use the RAW files in the first place and prepare them for astrometry ourselves, that is, removing hot pixels and possibly noise.
-
class
auromat.solving.eol.
LensDistortionCorrectionParams
(cameraMaker, cameraModel, cameraVariant, lensMaker, lensModel, focalLength, aperture)[source]¶ Bases:
object
-
class
auromat.solving.eol.
Sequence
¶ Bases:
tuple
Sequence(mission, roll, fromFrame, toFrame, title, urlAnchor)
-
fromFrame
¶ Alias for field number 2
-
mission
¶ Alias for field number 0
-
roll
¶ Alias for field number 1
-
title
¶ Alias for field number 4
-
toFrame
¶ Alias for field number 3
-
urlAnchor
¶ Alias for field number 5
-
-
class
auromat.solving.eol.
SequenceMetadata
(mission, roll, fromFrame, toFrame, pattern, frameGaps, lensDistortionCorrected, lensDistortionCorrectionParams=None)[source]¶ Bases:
object
-
auromat.solving.eol.
correctLensDistortion
(folderPath, undistFolderPath, lensfunDbObj=None)[source]¶ Corrects the lens distortion of all images in folderPath using lensfun’s distortion profile database.
It is assumed that all images have the same camera and lens. Images are skipped whose corrected version already exists in undistFolderPath.
-
auromat.solving.eol.
downloadImageSequence
(folderPath, mission, fromFrame, toFrame, format_, roll='E', lensDistortionCorrected=False)[source]¶ Download an image sequence in the specified format and return a tuple (metadata, []) on success or (False, errors) in case of errors.
Parameters: - folderPath – download location
- format – jpg or raw
Return type: tuple (SequenceMetadata, failure list)
-
auromat.solving.eol.
downloadImages
(folderPath, ids, format_)[source]¶ Download images given by (mission,roll,frame) tuples in the specified format.
Note: Use
downloadImageSequence()
to download a consecutive sequence of images. This function handles frame gaps (gaps in numbering) properly.Parameters: - folderPath – download location
- ids – list of tuples (mission,roll,frame)
- format – jpg or raw
-
auromat.solving.eol.
downloadImagesJpg
(folderPath, ids)[source]¶ Download JPEG images given by (mission,roll,frame) tuples and return paths if successfull. On any error, False is returned. Files that are already existing are not downloaded again.
Parameters: - folderPath – download location
- ids – list of tuples (mission,roll,frame)
Return type: list of str | False
-
auromat.solving.eol.
extractAuroraSequences
()[source]¶ Extracts metadata of all sequences found on http://eol.jsc.nasa.gov/ForFun/CrewEarthObservationsVideos/Aurora.htm.