sdss / lvmdrp

Local Volume Mapper (LVM) Data Reduction Pipeline
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

shadow height header keyword wrong #110

Open kreckel opened 1 month ago

kreckel commented 1 month ago

The header currently contains keywords 'HIERARCH GEOCORONAL SKYE SHADOW_HEIGHT' (also for SKYW and SCI), however these do not agree with what I calculate myself from the shadow_calc python code that is part of the lvmsurveysim package (e.g. https://sdss-lvmsurveysim.readthedocs.io/en/latest/utils.html#lvmsurveysim.utils.shadow_height_lib.shadow_calc) . Since I get reasonable correlations with the geocoronal Ha when compared with my calculated shadow heights, I suspect that what is calculated for this header keyword is not correct.

kreckel commented 1 month ago

@ymamay pointed out on slack that the code is using the MJD and not the time to calculate the shadowheight. My code snippet for doing this is below:

from astropy.time import Time from shadow_height_lib import shadow_calc

initialize the shadow height calculation

s=shadow_calc()

whichever object

cc = SkyCoord(hdr['POSKYERA'],hdr['POSKYEDE'],frame='icrs',unit=u.deg)

time = Time(hdr['OBSTIME'],format='isot', scale='utc') jj = time.jd s.set_coordinates(cc.ra.deg,cc.dec.deg) s.update_time(jd=jj) hz = s.get_heights(return_heights=True, unit="km")

ymamay commented 1 month ago

The function for calculating the shadow height is here: ttps://github.com/sdss/lvmdrp/blob/master/python/lvmdrp/core/sky.py#L725

And these line for calculating 'jd' need to change to something like kreckel has above that uses the time information (not just date) header["JD"] = header["MJD"] + 2400000.5 jd = header["JD"]

Plan to update the code this week with change and will update this issue