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

changes for parallel and non parallel pointings #38

Closed
wants to merge 452 commits into from

Conversation

vuillaut
Copy link
Member

Small change to better handle non-parallel array pointing.

  • In the case of parallel pointing, the predict methods should be faster without passing all tels pointings.
  • User can pass a global array pointing in case of non-parallel pointings (because in this case, simtel always sets a global one to (0,pi/2))

# pointing to predict
for tel_id in tels_pointing:
if tels_pointing[tel_id].alt != event.mcheader.run_array_direction[1]:
tels_pointing = None
Copy link
Contributor

Choose a reason for hiding this comment

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

should you really set your loop variable to None inside the loop? That seems to be bad form. This is just checking that the telescopes are parallel right? I would suggest either using something like

all(x.alt==dir[1] and x.az==dir[0] for x in tels_pointing.values())

or just dropping this case. In real data, there will always be a mispointing, so generally we never have it perfectly equal (and of course this check only works if this is mcdata anyhow).

Copy link
Member

Choose a reason for hiding this comment

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

could we fix this? It shouldn't change anything for parallel simulations, but it would solve #17 for divergent pointing


parser.add_argument(
"--array_direction_altaz", type=tuple, default=None,
help="set an array pointing direction. Required for non parallel pointing"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it's not better to just compute the array direction as the barycenter of the telescope pointings? Then it's automatic and works for both mis-pointing and divergent pointing.

Copy link
Member Author

Choose a reason for hiding this comment

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

The desired array direction could be anything, not necessarily the barycenter of the actual telescopes pointings.

Copy link
Member Author

Choose a reason for hiding this comment

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

However, I can add it as an option? 'barycenter' could be passed for this argument.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably a good "default" behavior at least, so the user doesn't have to choose it themselves. I think for divergent pointing, the optimal will always be the barycenter, though, right? At least if you want a roughly circular FOV

Copy link
Member

Choose a reason for hiding this comment

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

This CL arguments change has to be replicated also to write_dl2.py

Copy link
Member

Choose a reason for hiding this comment

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

Ah, and could you also update the docs accordingly?
You just need to copy-paste the new --help output in these 2 places,

protopipe/docs/scripts/data_training.rst
protopipe/docs/scripts/DL2.rst

@HealthyPear HealthyPear added this to Review in progress in Pipeline features and enhancements Jan 31, 2020
@HealthyPear HealthyPear removed this from Review in progress in Pipeline features and enhancements Feb 5, 2020
@HealthyPear HealthyPear added this to Review in progress in Pipeline applications Feb 5, 2020
@HealthyPear HealthyPear added pipeline applications Application of the pipeline to specific studies enhancement New feature or request labels Jun 8, 2020
@HealthyPear
Copy link
Member

HealthyPear commented Jun 8, 2020

What is the status of this PR @vuillaut ?

It seems that some details are to be specified, am I right?

Copy link
Member

@HealthyPear HealthyPear left a comment

Choose a reason for hiding this comment

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

Before continuing it is better to update the master branch base for this branch.
Since soon I will make the 0.3.0 and I found a bugfix for 0.2.2 it seems the right time to finish this


parser.add_argument(
"--array_direction_altaz", type=tuple, default=None,
help="set an array pointing direction. Required for non parallel pointing"
Copy link
Member

Choose a reason for hiding this comment

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

This CL arguments change has to be replicated also to write_dl2.py

# pointing to predict
for tel_id in tels_pointing:
if tels_pointing[tel_id].alt != event.mcheader.run_array_direction[1]:
tels_pointing = None
Copy link
Member

Choose a reason for hiding this comment

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

could we fix this? It shouldn't change anything for parallel simulations, but it would solve #17 for divergent pointing

@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #38 (c545980) into master (ee7d8cb) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head c545980 differs from pull request most recent head 8a7583d. Consider uploading reports for the commit 8a7583d to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##           master     #38      +/-   ##
=========================================
- Coverage    0.39%   0.39%   -0.01%     
=========================================
  Files          20      20              
  Lines        2268    2279      +11     
=========================================
  Hits            9       9              
- Misses       2259    2270      +11     
Impacted Files Coverage Δ
protopipe/pipeline/event_preparer.py 0.00% <0.00%> (ø)
protopipe/scripts/write_dl1.py 0.00% <0.00%> (ø)

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 ee7d8cb...8a7583d. Read the comment docs.

HealthyPear and others added 27 commits March 17, 2021 14:44
…pdate_TRAINING_integration_test_diffuse

Update training integration tests
…ve_build_models_and_mva

Small improvements to modeling script
…ntegration_test_pipeline_up_to_models

Setup of pipeline integration testing up to modeling
…on-tests

Fix pipeline integration test workflow
@vuillaut vuillaut mentioned this pull request Mar 30, 2021
Pipeline applications automation moved this from Review in progress to Done Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
divergent pointing enhancement New feature or request pipeline applications Application of the pipeline to specific studies
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants