Skip to content
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

Use divide method (and fix a couple errors that uncovered) #116

Merged
merged 6 commits into from Jun 12, 2014

Conversation

mwcraig
Copy link
Member

@mwcraig mwcraig commented Jun 10, 2014

The main change was intended to fix #92, but it turns out that running the tests of `flat_correct`` with perfectly uniform flats was masking a couple of errors.

One was that the arithmetic methods return a new array, but flat correct was returning the original array. The other was that it isn't always the case that flat_data.data.mean() == ccd_data.data.mean() after flat correction, because the mean of a ratio isn't the ratio of the means (though this had me going in circles for about 15 minutes).

The tests were also change to almost_equal-type tests.

… same

When the flat has values that are all the same, the flat_correct ends up just dividing by 1.
The methods return a new CCDData, leaving the original unchanged.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling c123252 on mwcraig:fix-divide into c2de563 on astropy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling 80bf577 on mwcraig:fix-divide into c2de563 on astropy:master.

@crawfordsm
Copy link
Member

Instead of copying the data, multiply flat_corrected by the normalization value so a copy doesn't need to be created.

However, a copy (or other similar type solution ) for when min value is passed in.

mwcraig added a commit that referenced this pull request Jun 12, 2014
Use divide method (and fix a couple errors that uncovered)
@mwcraig mwcraig merged commit 864cbb2 into astropy:master Jun 12, 2014
@mwcraig mwcraig deleted the fix-divide branch June 12, 2014 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use .divide instead of / in flat_correct normalization
3 participants