Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D Throughput calibration (Throughput correction + flat field in wavelength direction) #417

Open
angelrls opened this issue May 14, 2024 · 0 comments

Comments

@angelrls
Copy link
Contributor

angelrls commented May 14, 2024

Hi everyone,

Please, check the 2D Throughput calibration using "get_throughput_2D()" task within koala_ifu.py in my branch to get the 2D Throughput calibration (Throughput correction + flat field in wavelength direction).

This is needed for KOALA as we can't trust 2dFdr to do the flat fielding in wavelength direction as it will use the "flappy flat" instead of the skyflat / domeflat, that is the good one.

Below the documentation of the task:

"""
```
Adaptation of Angel's get_throughput_2D for 2024 PyKOALA.
Get a 2D array with the throughput 2D using a COMBINED skyflat / domeflat.
It is important that this is a COMBINED file, as we should not have any cosmics/nans left.
A COMBINED flappy flat could be also used if skyflat/domeflats were not available, but these are NOT as good as the dome / sky flats and should be avoided.

Parameters
----------
file_skyflat: string
    The fits file containing the skyflat/domeflat
path: string
    Path to file
rss: object with the skyflat/domeflat 
rss_object_name : string, optional
    name of the rss object
mask: list of arrays
    if a mask is given, apply the mask. If not using KOALA mask in skyflat.koala.mask    
correct_ccd_deffects: boolean
    If True, it corrects for ccd defects when reading the skyflat fits file
kernel_throughput: odd integer 
    If not 0, the 2D throughput will be smoothed with a this kernel
index_fit_throughput: integer
    index of the polynomium to fit each spectrum. If none it uses index_fit_throughput = 11
throughput_2D_file: string
    the name of the fits file to be created with the output throughput 2D
plot_final_rss: boolean
    If True plot the final rss
also_return_skyflat
    If True it also returns the skyflats

**kwargs : kwargs
    where we can find verbose, warnings, plot...

Returns
-------
if also_return_skyflat: 
    throughput, skyflat
else:
    throughput
    """
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants