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

Fix SkyCube.spectral_index function #606

Closed
wants to merge 2 commits into from

Conversation

OlgaVorokh
Copy link
Member

@cdeil Hello!

Can you explain a little bit, what this function is supposed to do? Because there is no tests and usages here and you are the only one who created and modified it. Can you give me some directions in which way I should think and work on?

@cdeil cdeil changed the title Curing broken SkyCube.spectral_image function Fix SkyCube.spectral_index function Jul 4, 2016
@cdeil cdeil added this to the 0.5 milestone Jul 4, 2016
@cdeil cdeil self-assigned this Jul 4, 2016
@cdeil
Copy link
Contributor

cdeil commented Jul 4, 2016

Fermi-LAT has diffuse gamma-ray emission spectral cube models, where the data array is the flux at the given (lon, lat, energy). For every point (lon, lat) this represents a spectrum flux(energy), which is usually roughly a power-law spectrum in energy.

This SkyCube.spectral_index method is supposed to be a convenience method that let's one compute that spectral index for a given spectral cube model ... it's a quantity gamma-ray astronomers care about.

To test this, you should use this example file:
https://github.com/gammapy/gammapy-extra/blob/master/datasets/vela_region/gll_iem_v05_rev1_cutout.fits

You can try to compute the spectral index for two positions (lon, lat) at a few enerview ... the value should be similar, but not exactly the same at different positions / energies ... always roughtly the value 2.5.

And, as you already do, you should use this helper function to compute the spectral index:
http://docs.gammapy.org/en/latest/_modules/gammapy/spectrum/powerlaw.html#power_law_g_from_points

We can work on this together this afternoon if you want. :-)

@OlgaVorokh
Copy link
Member Author

@cdeil, I think code is quite normal according to my understanding of spectral flux. I add a test to this method and also debug output. Maybe there is some logical problem? May you review this?

@cdeil cdeil modified the milestones: 0.6, 0.5 Jul 7, 2016
@cdeil cdeil modified the milestones: 0.5, 0.6 Aug 31, 2016
@cdeil cdeil modified the milestones: never, 0.5 Sep 20, 2016
@cdeil
Copy link
Contributor

cdeil commented Sep 20, 2016

I'm closing this PR now, it doesn't fix the SkyCube.spectral_index method.

We'll have to go through and clean up SkyCube some day ...

@cdeil cdeil closed this Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants