-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
cta-lstchain/lstchain/reco/utils.py
Lines 104 to 132 in 9aaa78b
| def extract_source_position( | |
| data, observed_source_name, equivalent_focal_length=28 * u.m | |
| ): | |
| """ | |
| Extract source position from data | |
| Parameters | |
| ---------- | |
| pandas.DataFrame data: input data | |
| str observed_source_name: Name of the observed source | |
| astropy.units.m equivalent_focal_length: Equivalent focal length of a telescope | |
| Returns | |
| ------- | |
| 2D array of coordinates of the source in form [(x),(y)] in astropy.units.m | |
| """ | |
| observed_source = SkyCoord.from_name(observed_source_name) | |
| obstime = pd.to_datetime(data["dragon_time"], unit="s") | |
| pointing_alt = u.Quantity(data["alt_tel"], u.rad, copy=False) | |
| pointing_az = u.Quantity(data["az_tel"], u.rad, copy=False) | |
| source_pos_camera = radec_to_camera( | |
| observed_source, | |
| obstime, | |
| pointing_alt, | |
| pointing_az, | |
| focal=equivalent_focal_length, | |
| ) | |
| source_position = [source_pos_camera.x, source_pos_camera.y] | |
| return source_position |
For cases in which the name solver of astropy does not work (e.g. GRBs, GW, neutrino alerts) one needs to pass the coordinates directly to make this function work. Used in the explore DL2 notebook (theta2 distribution calculation)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed