Open kreckel opened 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
s=shadow_calc()
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")
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
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.