Closed steob92 closed 4 weeks ago
This is related to #60 and #66.
Looks like the RA_PNT isn't getting correctly set. I'm using v0.5.2-preprocessing-v490.7. Here's what the datastore.obs_table reports for both point like and full enclosure IRFs:
v0.5.2-preprocessing-v490.7
https://github.com/VERITAS-Observatory/V2DL3/blob/ee2a5fc6a06cfe1a826db9073fb09536357033b9/pyV2DL3/eventdisplay/fillEVENTS.py#L194-L209
Replacing the arctan2 function with scipy.stats.circmean seems to give a consistent answer:
arctan2
scipy.stats.circmean
def __get_average_pointing(file, runNumber): """ Return circular mean RA and average DEC of telescope pointing """ pointingDataReduced = file[ f"run_{runNumber}/stereo/pointingDataReduced"].arrays(library="np") avRA = np.rad2deg( np.arctan2( np.sum(np.sin(pointingDataReduced["TelRAJ2000"])), np.sum(np.cos(pointingDataReduced["TelRAJ2000"])), ) ) avDec = np.mean(np.rad2deg(pointingDataReduced["TelDecJ2000"])) return avRA, avDec def __get_average_pointing2(file, runNumber): """ Return circular mean RA and average DEC of telescope pointing """ pointingDataReduced = file[ f"run_{runNumber}/stereo/pointingDataReduced"].arrays(library="np") n = len(pointingDataReduced["TelRAJ2000"]) avRA = np.rad2deg( circmean(pointingDataReduced["TelRAJ2000"]) ) avDec = np.mean(np.rad2deg(pointingDataReduced["TelDecJ2000"])) return avRA, avDec
__get_average_pointing(file,run) > (-107.18294548529406, 39.75928023998721) __get_average_pointing2(file,run) > (252.81705451470597, 39.75928023998721)
I didn't look too much into it but it looks like circmean applies a phase correction. See: https://github.com/scipy/scipy/blob/44e4ebaac992fde33f04638b99629d23973cb9b2/scipy/stats/_morestats.py#L4338-L4417
circmean
04617c5 seems to be working:
This is related to #60 and #66.
Looks like the RA_PNT isn't getting correctly set. I'm using
v0.5.2-preprocessing-v490.7
. Here's what the datastore.obs_table reports for both point like and full enclosure IRFs:https://github.com/VERITAS-Observatory/V2DL3/blob/ee2a5fc6a06cfe1a826db9073fb09536357033b9/pyV2DL3/eventdisplay/fillEVENTS.py#L194-L209
Replacing the
arctan2
function withscipy.stats.circmean
seems to give a consistent answer:I didn't look too much into it but it looks like
circmean
applies a phase correction. See: https://github.com/scipy/scipy/blob/44e4ebaac992fde33f04638b99629d23973cb9b2/scipy/stats/_morestats.py#L4338-L4417