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 image profile class #833

Merged
merged 9 commits into from Jan 9, 2017

Conversation

Projects
None yet
2 participants
@adonath
Member

adonath commented Jan 7, 2017

This PR implements a generic ImageProfile class, which offers plotting, smoothing and renormalization methods. The main data structure is an astropy table, which stores the coordinate values x_ref or x_min and x_max and the profile data values profile and profile_err.

@adonath adonath added the feature label Jan 7, 2017

@adonath adonath added this to the 0.6 milestone Jan 7, 2017

@adonath adonath self-assigned this Jan 7, 2017

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jan 8, 2017

Member

👍

This is almost independent of image and angles, so this could be changed to a more general "Profile1D" class. Not sure, maybe keep as-is for now?

Member

cdeil commented Jan 8, 2017

👍

This is almost independent of image and angles, so this could be changed to a more general "Profile1D" class. Not sure, maybe keep as-is for now?

@cdeil

I've left a bunch of inline comments.

Only one is really a bug (profile -> profile_err copy & paste error), the rest is up to debate (do what you think best for now, no need for discussion / further review).

Adding one example in the docstring of high-level docs to advertise this would be great!

"""
Image profile class.
The image profile data is stored in `~astropy.table.Table` object, with the

This comment has been minimized.

@cdeil

cdeil Jan 8, 2017

Member

I'd suggest to put a Parameters section, even if there's just one parameter in __init__.
Keeping the table column description in the docstring is fine, I think.

@cdeil

cdeil Jan 8, 2017

Member

I'd suggest to put a Parameters section, even if there's just one parameter in __init__.
Keeping the table column description in the docstring is fine, I think.

This comment has been minimized.

@cdeil

cdeil Jan 8, 2017

Member

Does this work for tables with columns that don't have units?
Or are there certain requirements on units for certain columns?

(my suggestion would be to not hard-code ImageProfile specific behaviour, and make this more of a general Profile1D class)

@cdeil

cdeil Jan 8, 2017

Member

Does this work for tables with columns that don't have units?
Or are there certain requirements on units for certain columns?

(my suggestion would be to not hard-code ImageProfile specific behaviour, and make this more of a general Profile1D class)

This comment has been minimized.

@adonath

adonath Jan 9, 2017

Member

I agree there's nothing special about this class, that would restrict the use to image based profile measurements. For now I'd like to keep it as is, but let's keep in mind the class could be used for acceptance or other profiles as well...

@adonath

adonath Jan 9, 2017

Member

I agree there's nothing special about this class, that would restrict the use to image based profile measurements. For now I'd like to keep it as is, but let's keep in mind the class could be used for acceptance or other profiles as well...

Show outdated Hide outdated gammapy/image/profile.py Outdated
Show outdated Hide outdated gammapy/image/profile.py Outdated
Show outdated Hide outdated gammapy/image/profile.py Outdated
Parameters
----------
**kwargs : dict
Keyword arguments passed to plt.plot()

This comment has been minimized.

@cdeil

cdeil Jan 8, 2017

Member

Link to plot function in MPL, so that people can quickly look up the valid parameters?

@cdeil

cdeil Jan 8, 2017

Member

Link to plot function in MPL, so that people can quickly look up the valid parameters?

This comment has been minimized.

@adonath

adonath Jan 9, 2017

Member

Done

@adonath

adonath Jan 9, 2017

Member

Done

Show outdated Hide outdated gammapy/image/tests/test_profile.py Outdated
@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath Jan 9, 2017

Member

@cdeil Thanks for the review, I've addressed your comments with the latest commits. I'll merge once Travis-CI passed.

Member

adonath commented Jan 9, 2017

@cdeil Thanks for the review, I've addressed your comments with the latest commits. I'll merge once Travis-CI passed.

@adonath adonath merged commit 49f8b97 into gammapy:master Jan 9, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@adonath

This comment has been minimized.

Show comment
Hide comment
@adonath

adonath Jan 9, 2017

Member

Travis fails were unrelated.

Member

adonath commented Jan 9, 2017

Travis fails were unrelated.

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