Skip to content

replace the trim_image call in combine with direct slicing to avoid logging. - #393

Merged
crawfordsm merged 1 commit into
astropy:masterfrom
MSeifert04:fix-390
Sep 8, 2016
Merged

crawfordsm merged 1 commit into
astropy:masterfrom
MSeifert04:fix-390

Conversation

@MSeifert04

Copy link
Copy Markdown
Contributor

Closes #390

The reason why the exception in #390 occured was because for some reason (haven't investigated it) it wasn't possible to create a HIERARCH card for the compressed image. For normal calls to ccdproc.core functions one could disable logging by setting the add_keywords parameter but that's currently not possible for ccdproc.combine.

However it's just not necessary to add the logging message for the trimming to Header because the trimming is not really done, it's just there to avoid using too much memory.

So instead of trimming the ccddata object it's just sliced in combine. This fixes the error locally but I haven't been able to create a test case for this.

@crawfordsm

Copy link
Copy Markdown
Member

@MSeifert04 I think I'd prefer to keep trim_image but use add_keyword=False to it. Just in case there is some behavior or change in terms of how the slicing is done. No keywords need to be added and so this can be skipped.

@MSeifert04

MSeifert04 commented Sep 8, 2016 •

Copy link
Copy Markdown
Contributor Author

@crawfordsm Yes, there will be one (but I thought that might be advisable) change in behaviour: The array isn't copied twice.

The trim_image function copies the slice but it's copied once more directly afterwards in Combiner. Otherwise this is - in this case - equivalent to using slicing directly.

@MSeifert04

Copy link
Copy Markdown
Contributor Author

@crawfordsm If no fits_section is given the trim_image function only copies and returns the CCDData object. And providing a fits_section makes no sense at this point in combine because it's only sliced to avoid overflowing the RAM.

So I'm pretty certain this won't change the behaviour in any way.

@crawfordsm

Copy link
Copy Markdown
Member

Actually that's a good point and probably optimizes it a bit more. Okay merging.

@crawfordsm
crawfordsm merged commit 6b73892 into astropy:master Sep 8, 2016
@MSeifert04
MSeifert04 deleted the fix-390 branch September 8, 2016 13:07
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.

Combine fits.fz fails with hdu argument

2 participants