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

Add scaling to average_combine and median_combine #123

Merged
merged 5 commits into from Jun 21, 2014

Conversation

mwcraig
Copy link
Member

@mwcraig mwcraig commented Jun 17, 2014

No description provided.

@crawfordsm
Copy link
Member

Thanks for putting something together! However, I think the way that I was viewing this is that scaling would be handled the same way as rejection or as the weighting and wouldn't be a separate thing that is passed to the median or averaging tasks.

So my suggestion would be actually something easier than what you have done, which would just have a self.scalings and that if it wasn't None it would be multiplied by the scalings.

I could see that the scale functions could be complicated (needing sections or keywords or something else entirely in parameters passed to it), but at the same time, we didn't really define anything before hand so I could also be convinced of this method.

@mwcraig
Copy link
Member Author

mwcraig commented Jun 17, 2014

ok, we can hash it out during the call today

@mwcraig
Copy link
Member Author

mwcraig commented Jun 19, 2014

@crawfordsm -- looking over this again I realized I still have a question: do you see scaling as a method or as an attribute?

I could see advantages either way: an attribute lets the user do anything they want, but a method maybe allows for more convenience in the case where the scaling is determined by applying the same operation to all of the images.

A property would almost do the trick, so that the user could do something like:

combiner.scaling = np.ma.median   # apply this function to each image to determine its scaling
combiner.scaling = my_complicated_function  # as needed
combiner.scaling = [1, 2, 3]    # or a ndarray or anything convertible to an ndarray
combiner.scaling = None  # to turn it back off, this would be the default on initialization

@mwcraig
Copy link
Member Author

mwcraig commented Jun 20, 2014

@crawfordsm -- I updated this to make scaling a property; let me know what you think!

print("len", len(self._scaling))
self._scaling = np.array(self._scaling)
print(self._scaling.shape)
print(n_images)
Copy link
Member

Choose a reason for hiding this comment

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

Do you still need the print statements?

Copy link
Member Author

Choose a reason for hiding this comment

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

oops. Thought I caught all of those...

@crawfordsm
Copy link
Member

Looks good! You've left in some print statements that could be removed I think and I've added an inline comment. After that, I would be happy to have this merged.

mwcraig added a commit that referenced this pull request Jun 21, 2014
Add scaling to average_combine and median_combine
@mwcraig mwcraig merged commit 3d28838 into astropy:master Jun 21, 2014
@mwcraig mwcraig deleted the scale-combine branch July 5, 2014 21:34
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.

None yet

2 participants