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

Add WCS map cutout method #1446

Merged
merged 9 commits into from Jun 29, 2018

Conversation

3 participants
@AtreyeeS
Contributor

AtreyeeS commented Jun 28, 2018

Hello,

I added a make_cutout() following the one in SkyCube.
This makes only a spatial cutout on all axis of the cube.

But in practise, I think the users will want to be able to make cutouts on all other axes as well, no?
I mean, maybe something like
cutout=cmap.make_cutout(position=pos,radius=rad, energy=(1,3)*u.TeV, time=(t1,t2) )

Or can cutout remain only for spatial cuts, and then other axes extracted as needed?

@cdeil cdeil added the feature label Jun 28, 2018

@cdeil cdeil added this to the 0.8 milestone Jun 28, 2018

@cdeil

@AtreyeeS - I left some quick inline comments.

Suggest to just do the spatial cutout in this PR, and discuss whether we want to combine slicing with other axes in the call tomorrow.

So this already works if you have extra non-spatial axes? If yes, please add a test case, or change the existing one to have one or two small extra axes.

@adonath - I'll leave the rest of the review and putting this in to you.

Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py

@cdeil cdeil added this to To do in Map analysis via automation Jun 28, 2018

@cdeil cdeil changed the title from Added make_cutout() in wcsnd.py to Add WCS map cutout method Jun 28, 2018

@AtreyeeS

This comment has been minimized.

Show comment
Hide comment
@AtreyeeS

AtreyeeS Jun 28, 2018

Contributor

Yes, this works for any number of non-spatial axes. Changed the test to make a cutout on a 4d map now (and other inline corrections implemented)

Contributor

AtreyeeS commented Jun 28, 2018

Yes, this works for any number of non-spatial axes. Changed the test to make a cutout on a 4d map now (and other inline corrections implemented)

Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/tests/test_wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py
Show outdated Hide outdated gammapy/maps/wcsnd.py
@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath Jun 28, 2018

Member

@AtreyeeS Thanks for this PR! Please note my review comments (some of them are marked as outdated by github, but might still be open to address)

Member

adonath commented Jun 28, 2018

@AtreyeeS Thanks for this PR! Please note my review comments (some of them are marked as outdated by github, but might still be open to address)

AtreyeeS added some commits Jun 28, 2018

@AtreyeeS

This comment has been minimized.

Show comment
Hide comment
@AtreyeeS

AtreyeeS Jun 28, 2018

Contributor

Thanks @adonath,

Made the changes as you suggested.
Have not made any additions to the WcsGeom class for now.. lets discuss this tomorrow.

Contributor

AtreyeeS commented Jun 28, 2018

Thanks @adonath,

Made the changes as you suggested.
Have not made any additions to the WcsGeom class for now.. lets discuss this tomorrow.

@adonath

I've made a few final cosmetic changes. Once Travis-CI has passed I'll merge the PR

@registerrier registerrier moved this from To do to In progress in Map analysis Jun 29, 2018

@adonath adonath merged commit 5afddfc into gammapy:master Jun 29, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

Map analysis automation moved this from In progress to Done Jun 29, 2018

@AtreyeeS AtreyeeS deleted the AtreyeeS:cutout branch Jul 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment