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

Using circmean to get circular mean #214

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Using circmean to get circular mean #214

merged 1 commit into from
Jun 10, 2024

Conversation

steob92
Copy link
Contributor

@steob92 steob92 commented Jun 7, 2024

Resolves #213

Using scipy.stats.circmean to get the circular mean when getting the average RA.

@steob92 steob92 requested a review from GernotMaier June 7, 2024 21:13
Copy link
Collaborator

@tobiaskleiner tobiaskleiner left a comment

Choose a reason for hiding this comment

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

Thanks @steob92! The scipy implementation now adds the phase shift res[res < 0] += 2*pi. (Previous negative values are also working with gammapy/astropy.) You can merge.

@GernotMaier
Copy link
Member

@steob92 , @tobiaskleiner - does this require a re-processing? How significant is the change? Does it justify a new release of V2DL3?

@tobiaskleiner
Copy link
Collaborator

@GernotMaier @steob92 not sure it is needed. There is no effect on the coordinate, the calculation was the same implementation as in scipy except for the phase shift (i.e. Ra coordinate Ra=-150 --> Ra=210). Maybe we can wait for another major release (if happening) otherwise we reprocess in a few months?

@GernotMaier
Copy link
Member

running v2dl3 takes a day, so it is not a computing issue. I just need to know.

@steob92
Copy link
Contributor Author

steob92 commented Jun 10, 2024

@GernotMaier I originally started looking into this because when querying a large datastore, I wouldn't find the correct number of runs.

When using the high level interface (config + Analysis, for example: https://docs.gammapy.org/1.2/tutorials/analysis-2d/ring_background.html). The coordinates passed to the obs_cone will be used to query the observation table which will use RA/DEC_PNT. See:
https://docs.gammapy.org/1.2/_modules/gammapy/data/obs_table.html#ObservationTable.select_observations

With the current pre-processed files, one needs to generate a runlist for a region of interest using VLISTBUILDER. I think VLISTBUILDER is still semi offline. We lost the ability to automatically update it, I'm also not sure if it was updated with runs beyond 2018...

I think it's worth reprocessing... This fix would remove the need for VLISTBUILDER when running a gammapy analysis. But I'm also not the one who will have to babysit the scripts!

@steob92 steob92 merged commit e8d6e6e into main Jun 10, 2024
4 checks passed
@GernotMaier
Copy link
Member

@steob92 - could you release a new version? 0.6.0?

@steob92
Copy link
Contributor Author

steob92 commented Jun 10, 2024

Sure, are the automatically generated release notes okay, or would you like a comment about circmean? I also see some VEGAS changes by @matthew-w-lundy and @deividribeiro.

@GernotMaier GernotMaier deleted the circmean branch June 16, 2024 09:44
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.

Incorrect telescope pointing
3 participants