from prose import FitsManager, Telescope from prose import simulations
Astronomical observations often generate highly disorganised fits images folders. To know the content of these files, file names can be used but have their limitations. At the end it is not rare to start opening these files to acces the information in their headers.
To solve this issue, prose features the FitsManager object, a conveniant tool to ease the sorting process.
Generating fake fits#
To demonstrate the use of the FITS manager, lets’ generate a set of fake data from telescope
B, defined with
_ = Telescope(name="A", save=True) _ = Telescope(name="B", save=True)
Telescope 'a' saved Telescope 'b' saved
Images will be located in a single folder, featuring different sizes, filters and associated calibration files, with no way to distinguish them from their file names
destination = "./fake_observations" simulations.disorganised_folder(destination)
The Fits Manager object#
To dig into these disorganised folder, let’s instantiate a FitsManager object
fm = FitsManager(destination) fm
The keywords of all images have been parsed and associated with different telescopes. The advantage is that specific keywords from specific telescopes are recognized and standardized to common namings. This is useful to define telescope agnostic pipelines.
Picking an observation#
From there let say we want to keep the files from an observation using its
files = fm.observation_files(1)
flats with the right filter have been kept, as well as darks
Telescope specific keywords#
The information retained by FitsManager was taken from images headers. To know which keywords to use, we had to register telescopes
B with a dictionary. Whenever their names appear in a fits header, their dictionary is loaded to read their header keywords.
Since we just specified the telescope names all the rest is default. For example the filter is taken from the keyword
FILTER and the image type from
IMAGETYP, knowing that
IMAGETYP=light is a light (a.k.a science) frame. These keywords can be set in more details when registering the telescope.
For more details, chcek the Telescope object
Show code cell content Hide code cell content
# hidden from shutil import rmtree rmtree(destination)