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

Consolidate camera calibration in a single class #1048

Merged
merged 14 commits into from
Apr 29, 2019

Conversation

watsonjj
Copy link
Contributor

@watsonjj watsonjj commented Apr 14, 2019

As #1046 was well received, I have proceeded with further simplifying the calibration chain. This PR consolidates the calibration chain into a single class. The CameraCalibrator class is repurposed from a "helper" class, into the main calibration chain class.

The CameraDL0Reducer and CameraDL1Calibrator are deleted. The individual calibration levels are still apparent inside the class (as individual functions), providing structure and direction.

The arguments to CameraCalibrator now operate similar to how the CameraDL1Calibrator worked, where the classes responsible for each of the calibration steps are individually constructed outside the CameraCalibrator, before being passed to the CameraCalibrator to be applied in the correct order to fill the event container. If a calibration-step-class is not passed to the CameraCalibrator the default classes are used.

By changing to this approach, it makes the process of adding additional steps in the calibration chain more easier and clear. Two additional steps that I intend to be add in future PRs are a gain selector and a charge calibrator (flat-field and absolute calibration), for which additional arguments to the class will be added.

Some TODOs exist in the CameraCalibrator indicating changes I intend for future PRs. I wanted to approach this in smaller steps to prevent errors in the results of the calibration chain, and to make reviews more digestible. This PR therefore keeps the calibration operations identical to the existing chain for the time being.

@watsonjj watsonjj added this to the v0.7 milestone Apr 14, 2019
@watsonjj
Copy link
Contributor Author

Also the calibrate method was replaced with __call__ in line with #1024

@codecov
Copy link

codecov bot commented Apr 14, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@b010cf6). Click here to learn what that means.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1048   +/-   ##
=========================================
  Coverage          ?   83.26%           
=========================================
  Files             ?      181           
  Lines             ?    10410           
  Branches          ?        0           
=========================================
  Hits              ?     8668           
  Misses            ?     1742           
  Partials          ?        0
Impacted Files Coverage Δ
ctapipe/calib/camera/__init__.py 100% <ø> (ø)
ctapipe/tools/muon_reconstruction.py 43.54% <0%> (ø)
ctapipe/tools/extract_charge_resolution.py 71.42% <100%> (ø)
ctapipe/tools/display_dl1.py 90% <100%> (ø)
ctapipe/tools/display_summed_images.py 91.07% <100%> (ø)
ctapipe/image/reducer.py 100% <100%> (ø)
ctapipe/tools/display_events_single_tel.py 71.95% <100%> (ø)
ctapipe/plotting/tests/test_bokeh_event_viewer.py 100% <100%> (ø)
ctapipe/image/tests/test_reducer.py 100% <100%> (ø)
ctapipe/image/muon/tests/test_muon_reco.py 100% <100%> (ø)
... and 5 more

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 b010cf6...2de0f9b. Read the comment docs.

kosack
kosack previously approved these changes Apr 23, 2019
* master:
  Create numba ufunc for sum of samples within charge extraction window (cta-observatory#1038)
  Implement nan-handling like matplotlib high-level api (cta-observatory#1050)
  Fix See Also docs for sphinx 2 (cta-observatory#1051)
  Correct function name
  Create extract_pulse_time_around_peakpos
  Correct min to max
  Fix test
  Update bokeh plotters to handle nan
@thomasarmstrong
Copy link
Contributor

Do we no longer need the check_x_exists functionality to prevent containers being overwritten?

@watsonjj
Copy link
Contributor Author

Do we no longer need the check_x_exists functionality to prevent containers being overwritten?

You are right, I've restored them now

Copy link
Contributor

@thomasarmstrong thomasarmstrong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now.

@kosack kosack merged commit 2a2d38b into cta-observatory:master Apr 29, 2019
@watsonjj watsonjj deleted the camera_calibrator_new branch April 29, 2019 13:52
@kosack kosack mentioned this pull request May 2, 2019
17 tasks
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.

3 participants