pypeit / PypeIt

The Python Spectroscopic Data Reduction Pipeline
BSD 3-Clause "New" or "Revised" License
158 stars 101 forks source link

Incorrect WCS for KCWI datacubes #1674

Open ddobie opened 11 months ago

ddobie commented 11 months ago

Running pypeit_coadd_datacube on KCWI data produces a datacube that has an incorrect WCS - what should be the central coordinate ends up in the top left of the image. It's not clear to me whether this problem stems from pypeit or the WCS of the fits files that come off the telescope.

As a short-term hacky workaround you can update the CRPIX values to be CRPIX1=CRPIX1+NAXIS1/2 and CRPIX2=CRPIX2-NAXIS2/2.

The issue is reproducible with the keck_kcwi_medium_bl example from the pypeit dev suite. Run the example as-provided and then run pypeit_coadd_datacube with the following parameter file

# User-defined execution parameters
[rdx]
    spectrograph = keck_kcwi
    detnum = 1
[reduce]
    [[cube]]
        combine = True
        output_filename = Science/feige110_datacube.fits
        save_whitelight = True

# Read in the data
spec2d read
filename
Science/spec2d_kb210705_00051-feige110_KCWI_20210705T145034.858.fits
spec2d end
rcooke-ast commented 11 months ago

Thanks for raising this @ddobie - I will look into it and report back... fwiw, I have cross-checked the KCWI cubes with HST imaging.

kbwestfall commented 8 months ago

@rcooke-ast , @ddobie . Is this issue solved now?

rcooke-ast commented 8 months ago

The issue is not yet solved.

The WCS of KCWI does appear to be incorrect, but it's been set correctly according to what is expected from the WCS. I think this needs to be looked at using different PAs (e.g. a standard star taken at different PAs).