Skip to content

Add thin wrapper for block_reduce and block_replicate functions - #402

Merged
crawfordsm merged 6 commits into
astropy:masterfrom
MSeifert04:block_x_wrapper
Oct 17, 2016
Merged

crawfordsm merged 6 commits into
astropy:masterfrom
MSeifert04:block_x_wrapper

Conversation

@MSeifert04

@MSeifert04 MSeifert04 commented Oct 13, 2016 •

Copy link
Copy Markdown
Contributor

This puts these astropy.nddata.utils functions into the namespace of ccdproc and deprecates rebin.

I'm not sure about the deprecation but block_replicate does almost the same and the name is more descriptive.

Closes #388 (maybe)

I'm not sure if it should have the log_to_metadata decorator?

@MSeifert04 MSeifert04 changed the title add thin wrapper for block_reduce and block_replicate Add thin wrapper for block_reduce and block_replicate functions Oct 13, 2016

@mwcraig mwcraig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to me. I agree that this is both clearer and more complete than the current rebin. Thanks, @MSeifert04.

@crawfordsm

Copy link
Copy Markdown
Member

One question: should there be either a warning in the documentation or a warning raised if the original source has a mask or uncertainty set?

@MSeifert04

Copy link
Copy Markdown
Contributor Author

The block_replicate and block_reduce functions are wrapped by support_nddata. This decorator will print a Warning about all set but unprocessed attribute:

>>> from astropy.nddata import block_reduce
>>> block_reduce(CCDData(np.random.random((20, 20)), 
                         unit='adu', 
                         mask=np.random.random((20, 20))>0.5),
                 (2, 2))
WARNING: The following attributes were set on the data object, but will be ignored by the function: mask, unit [astropy.nddata.decorators]

@crawfordsm
crawfordsm merged commit 41b8f1c into astropy:master Oct 17, 2016
@crawfordsm

Copy link
Copy Markdown
Member

Thanks @MSeifert04 !

@MSeifert04
MSeifert04 deleted the block_x_wrapper branch October 17, 2016 13:11
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.

3 participants