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 SkyImageList #582

Merged
merged 4 commits into from Jul 1, 2016

Conversation

Projects
None yet
3 participants
@OlgaVorokh
Member

OlgaVorokh commented Jun 19, 2016

Initial pull request for SkyImageList -- bridge between SkyMap and SkyCube
Now it's possible to do

cube = SkyCube.read()
sky_image_list = cube.to_image_list()
cube2 = sky_image_list.to_cube()

 cube2 == cube1

and to access individual skymaps like 'sky_image_list.skymaps[i]`

Hi @cdeil,
please take a look and say how close it to what you have imagined and what other functionality should I add :)

Show outdated Hide outdated gammapy/image/tests/test_lists.py Outdated

@cdeil cdeil added the feature label Jun 19, 2016

@cdeil cdeil added this to the 0.5 milestone Jun 19, 2016

@cdeil cdeil self-assigned this Jun 19, 2016

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 19, 2016

Member

@OlgaVorokh - Thanks!

I will have to think about this and discuss with @adonath before giving comments.
The main question is what the use cases are for this class, compared to SkyMapCollection (related: #578) and whether those should be merged or not.

For now, the main use case for this class will be to implement PSF convolution of a cube.

Member

cdeil commented Jun 19, 2016

@OlgaVorokh - Thanks!

I will have to think about this and discuss with @adonath before giving comments.
The main question is what the use cases are for this class, compared to SkyMapCollection (related: #578) and whether those should be merged or not.

For now, the main use case for this class will be to implement PSF convolution of a cube.

Show outdated Hide outdated gammapy/image/tests/test_lists.py Outdated
Show outdated Hide outdated gammapy/image/tests/test_lists.py Outdated
Show outdated Hide outdated gammapy/cube/core.py Outdated
Show outdated Hide outdated gammapy/cube/core.py Outdated
Show outdated Hide outdated gammapy/cube/core.py Outdated

@OlgaVorokh OlgaVorokh referenced this pull request Jun 24, 2016

Merged

Add SkyCube.sky_image() #586

Show outdated Hide outdated gammapy/cube/core.py Outdated
@OlgaVorokh

This comment has been minimized.

Show comment
Hide comment
@OlgaVorokh

OlgaVorokh Jun 29, 2016

Member

@cdeil, I have rebased this branch on master

Member

OlgaVorokh commented Jun 29, 2016

@cdeil, I have rebased this branch on master

Show outdated Hide outdated gammapy/image/lists.py Outdated
@@ -0,0 +1,44 @@
from __future__ import absolute_import, division, print_function, unicode_literals

This comment has been minimized.

@cdeil

cdeil Jun 30, 2016

Member

Please add the license comment line that's at the top of any file in the Gammapy to gammapy/image/lists.py and gammapy/image/tests/test_lists.py.

@cdeil

cdeil Jun 30, 2016

Member

Please add the license comment line that's at the top of any file in the Gammapy to gammapy/image/lists.py and gammapy/image/tests/test_lists.py.

Show outdated Hide outdated gammapy/image/lists.py Outdated
@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 30, 2016

Member

I've left some minor comments inline.
Once those are addressed, I would suggest we merge this.

It's still not clear how this SkyImageList and the existing SkyMapCollection are related. Probably they should be merged into one class. But figuring this out will take longer and is already under discussion in #578.

@adonath - Are you OK if we merge this for now and then continue the image list discussion / implementation in other issues / pull requests?

Member

cdeil commented Jun 30, 2016

I've left some minor comments inline.
Once those are addressed, I would suggest we merge this.

It's still not clear how this SkyImageList and the existing SkyMapCollection are related. Probably they should be merged into one class. But figuring this out will take longer and is already under discussion in #578.

@adonath - Are you OK if we merge this for now and then continue the image list discussion / implementation in other issues / pull requests?

@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath Jun 30, 2016

Member

@cdeil For me the SkyImageList class will be the main class to handle images of one data type e.g. counts, exposure etc. with different binning for every energy band (or even the same energy band, as a kind of "scale-space" image list). This is not reflected in the API yet (e.g. the to_cube() method probably needs an additional call to .reproject() to reproject all the images to a common wcs).
Whereas the SkyMapCollection is meant to be a generic higher level data container for maps, cubes or image lists of different type. I.e. bundle counts, background, exposure data for simple FITS I/O and convenient bunch style attribute access for users. And to bundle the data in a single container for input and output of other functions such as compute_ts_map or adaptive_smooth.

Yes, I'm totally fine with merging this PR and further develop the API of SkyImageList in future PRs.

Member

adonath commented Jun 30, 2016

@cdeil For me the SkyImageList class will be the main class to handle images of one data type e.g. counts, exposure etc. with different binning for every energy band (or even the same energy band, as a kind of "scale-space" image list). This is not reflected in the API yet (e.g. the to_cube() method probably needs an additional call to .reproject() to reproject all the images to a common wcs).
Whereas the SkyMapCollection is meant to be a generic higher level data container for maps, cubes or image lists of different type. I.e. bundle counts, background, exposure data for simple FITS I/O and convenient bunch style attribute access for users. And to bundle the data in a single container for input and output of other functions such as compute_ts_map or adaptive_smooth.

Yes, I'm totally fine with merging this PR and further develop the API of SkyImageList in future PRs.

@OlgaVorokh

This comment has been minimized.

Show comment
Hide comment
@OlgaVorokh

OlgaVorokh Jun 30, 2016

Member

@cdeil I fixed all you asked me

Member

OlgaVorokh commented Jun 30, 2016

@cdeil I fixed all you asked me

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jul 1, 2016

Member

Looks good to me. Thanks!

Member

cdeil commented Jul 1, 2016

Looks good to me. Thanks!

@cdeil cdeil merged commit 02842b1 into gammapy:master Jul 1, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment