Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detector coordinates in cluster object #146

Open
153957 opened this issue Jun 17, 2016 · 3 comments
Open

Detector coordinates in cluster object #146

153957 opened this issue Jun 17, 2016 · 3 comments

Comments

@153957
Copy link
Member

153957 commented Jun 17, 2016

In the example below the horizontal station distances are correctly different, however, the detector distances are equal, which is incorrect. Though their total distance should not change, the horizontal distance should be different because the station is further from the ENU origin, and the different ENU plane has a different tilt. This is related #142. This mostly reinforces the argument for using local Cluster objects for coincidence reconstruction and other analyses.

from sapphire import HiSPARCStations

# Only two stations
c = HiSPARCStations([14001, 14002], force_stale=True)
c.calc_horizontal_distance_between_stations(14001, 14002)
#5787.6 m
s = c.get_station(14001)
s.calc_rphiz_for_detectors(0, 1)[0]
#4.456 m
s.calc_rphiz_for_detectors(0, 3)[0]
#14.530 m

# Different reference station far away
c = HiSPARCStations([20001, 14001, 14002], force_stale=True)
c.calc_horizontal_distance_between_stations(14001, 14002)
#5734.1 m
s = c.get_station(14001)
s.calc_rphiz_for_detectors(0, 1)[0]
#4.456 m
s.calc_rphiz_for_detectors(0, 3)[0]
#14.530 m
@153957
Copy link
Member Author

153957 commented Jan 2, 2017

The calculation of the r and phi between the detectors is correct. However, the initial adding of the detector coordinates is wrong. It uses the ENU reference frame of the reference station, keeping the radius/alpha plane within the station parallel to that EN plane. It should use a locally horizontal frame.

@tomkooij
Copy link
Member

tomkooij commented Jan 2, 2017

@153957: I looked through some of the code, and to me it seems an unavoidable side-effect from using ENU coordinate systems: The detectors are added relative to a translated (but not rotated) ENU-coordinate system 'attached to' the GPS of the station.

I agree that the detectors should use a locally horizontal frame (translated and rotated) but I fail to see how that would be implemented in a KISS way.

Will you provide a PR? ;-)

(I'm thinking we should leave this "as is")

@153957
Copy link
Member Author

153957 commented Jan 2, 2017

I wont fix this, since this is mostly an issue for stations at large distances, at the moment not my problem 😉.

I do think this could be fixed 'easily' (i.e. the required transformation functions already exist). Transform the detector positions based on the angle between the reference and the station lla. Or first convert all coordinates to ECEF using the local reference lla + ENU coordinates and then use those to create the cluster object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants