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

Impact intersection #778

Merged
merged 11 commits into from
Oct 10, 2018
Merged

Impact intersection #778

merged 11 commits into from
Oct 10, 2018

Conversation

kbruegge
Copy link
Member

@kbruegge kbruegge commented Sep 7, 2018

While discussing with @TarekHC, @moralejo and @kpfrang I also came up with a fix for the impact parameter. A quick comparison between #777 and this PR on a small sample (1000 events) can be seen below.

I will try and get more statistics next week.
impact_compare

@kbruegge
Copy link
Member Author

I added the same method to estimate max height. Seems to be better than the current method. At least on a small sample (1000 events). Also it is much faster since its only matrix operations.

@kbruegge
Copy link
Member Author

Alright I added some changes to make this work properly. Note that I fixed the coordinate conversion by changing the sign of the azimuth direction when conversion to cartesian. Since the astropy convention is spinning in the other direction.

See the attached plots. Where I compare old reconstrunction (orange )to this fix (yellow).

h_max
impact

@TarekHC
Copy link
Contributor

TarekHC commented Sep 13, 2018

Hi @mackaiver

With old reconstrunction method you mean before the fix? It probably makes more sense to compare the method you implemented with the one @kpfrang fixed in #777 and #785. The changes are so minimal, that it would probably be easy to add them and compare the methods again.

@kbruegge
Copy link
Member Author

@TarekHC @kpfrang did the plots you asked for. For now just ~3000 events each.

h_max
impact

Runtime on my machine is improving by about 50% for the matrix method.

@kbruegge
Copy link
Member Author

I guess the optimal solution would be to put the conversion between clockwise and counter clockwise somehere here

class HorizonFrame(BaseCoordinateFrame):

@kosack
Copy link
Contributor

kosack commented Sep 21, 2018

So what is the final decision about these? Will somebody make the change in the coordinate code, or should we merge one of these PRs? If not, we should close these ones. I guess now that the coordinates are done in a more central way, it might be better to do it there rather than to hack minus signs in several places, but it's up to you which you think is cleaner.

@kbruegge
Copy link
Member Author

I think it should be fixed in the HorizonFrame class. This might take some time however to test it. Maybe we can also discuss next week in person.

@codecov
Copy link

codecov bot commented Oct 8, 2018

Codecov Report

Merging #778 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #778      +/-   ##
==========================================
+ Coverage   71.78%   71.78%   +<.01%     
==========================================
  Files         202      202              
  Lines       10968    10967       -1     
==========================================
  Hits         7873     7873              
+ Misses       3095     3094       -1
Impacted Files Coverage Δ
ctapipe/reco/HillasReconstructor.py 97% <100%> (+0.5%) ⬆️
ctapipe/reco/tests/test_HillasReconstructor.py 94.59% <100%> (+1.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b40b1de...adb79b5. Read the comment docs.

@kosack
Copy link
Contributor

kosack commented Oct 8, 2018

I'd like to at least merge this one (which seems more general than #785, even if not as general as a fix in the coordinate transform), as a stop-gap so that we can make some end-to-end tests with correct h_max very soon. We can then open another issue to do this fix in a better way.

Do you have any problem with that?

@kbruegge
Copy link
Member Author

kbruegge commented Oct 8, 2018

Fine for me. Not sure why the Travis tests failed though.

@jjlk
Copy link
Contributor

jjlk commented Oct 9, 2018

Hi @mackaiver ,
It might be better to return the integrality of the impact parameter and not only the first two components in estimate_core_position. It's needed if someone is interested to compute the impact distance in the tilted frame via coordinate transformations implemented in ctapipe (e.g., for the energy estimation), right?

Could you add it? Thanks!

@kosack
Copy link
Contributor

kosack commented Oct 9, 2018

Ok the travis tests work now - can you just add the 3D vector return as @jjlk mentioned, and I will merge it and we can do some tests on the grid.

@kosack kosack merged commit baaf1fd into master Oct 10, 2018
watsonjj added a commit to watsonjj/ctapipe that referenced this pull request Nov 9, 2018
* master: (60 commits)
  Add test that shows slicing breaks cam geom and fix it (cta-observatory#782)
  fix ctapipe build failure (cta-observatory#811)
  fix package name for yaml (should be pyyaml) (cta-observatory#810)
  Implement number of islands (cta-observatory#801)
  fixed ranges of cam-display so they correspond to fixed toymodel sims (cta-observatory#808)
  Fix unknown section example warning (cta-observatory#800)
  Fix timing parameters for case when there are negative values in image (cta-observatory#804)
  Update Timing Parameters (cta-observatory#799)
  speed up unit tests that use test_event fixture (cta-observatory#798)
  Add unit to h_max in HillasReconstructor (cta-observatory#797)
  Codacy code style improvements (cta-observatory#796)
  Minor changes: mostly deprecationwarning fixes (cta-observatory#787)
  Array plotting (cta-observatory#784)
  added a config file for github change-drafter plugin (cta-observatory#795)
  Simple HESS adaptations (cta-observatory#794)
  add test for sliced geometries for hillas calculation (cta-observatory#781)
  Impact intersection (cta-observatory#778)
  updated main documentation page (cta-observatory#792)
  Implement concentration image features (cta-observatory#791)
  Fix bad builds by changing channel name (missing pyqt package) (cta-observatory#793)
  ...

# Conflicts:
#	ctapipe/calib/camera/dl1.py
@kosack kosack deleted the impact_intersection branch January 25, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants