ExospecoCalibration is a Julia package used for calibrating long-slit spectroscopy data (Vigan et al., 2008) from the SPHERE/IRDIS instrument (Dohlen et al., 2008).
To install the package, write down the following code after hitting the key ] to activate Pkg mode:
add https://github.com/SJJThe/ExospecoCalibrationGiven a LAMP calibration d_cal given by the IRDIS instrument and formed by illuminating the slit by 6 monochromatic sources, the spatial and spectral dispersion maps of the detector can be generated following simple commands.
Choose the parameters of the polynomial dispersion laws in the form of tuples containing the number of dimensions of the polynomial (1 for 1D polynomial, 2 for 2D) and the degree of the polynomial. Then call the calibrate_geometry method which yields the dispersion maps in the form of a GeoCalib structure.
A bad pixels map bpm can be given to the method in order to take into account bad pixels in the detection of the calibrated spectral lines in d_cal. A study keyword can be set to Val(:log) which makes the method plots the results of the calibration so the user can validate the dispersion laws.
using ExospecoCalibration
spatial_pol_carac = (2,1)
spectral_pol_carac = (2,5)
Geo = calibrate_geometry(d_cal, bpm; spatial_law_carac= spatial_pol_carac,
spectral_law_carac=spectral_pol_carac, study=Val(:log))It is possible to select the region of interest that will be taken into account in further post-processing methods. Given a GeoCalib structure, it will create a new structure with masked regions outside the rho_bnds and lambda_bnds boundaries.
# Boundaries of region of interest
lambda_bnds = (920.0, 1870.0) .* ExospecoCalibration.nm
rho_bnds = (-15.0, 15.0) .* ExospecoCalibration.rho_pixel
Geo_masked = select_region_of_interest(Geo; rho_bnds=rho_bnds, lambda_bnds=lambda_bnds)The package also allows writing and reading fits files based on GeoCalib structures.
# Reading Geometric calibration
path_to_struct = "..."
Geo = readfits(path_to_struct)
# Writing GeoCalib structure
writefits(path_to_struct, Geo; overwrite=true)ExospecoCalibration depends on the following packages:
For more details, see the Project.toml file.