-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
The start of a normalization module #964
Conversation
ping @rhewett I think we could add other "normal" normalisation methods here, maybe sqrt and gamma as two very easy ones? |
Also for comparison with the PDF, see |
Recently read that paper. What's the proper series of imports to try this out? |
For most purposes, the weights can be set | ||
equal for all scales. | ||
""" | ||
if not weights: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline before here
Scipy, numpy are the only external python dependencies. @rhewett Added some new lines! |
from sunpy.image.normalization import multiscale_gaussian You will have to pull @nabobalis's branch to test it before we merge it though. |
Yeah. I've not tested the output with the other normalise functions. There will be nans in the output from the function. Could that be the issue? |
@@ -22,7 +22,7 @@ def resample_method(method): | |||
assert resample_meta((2056, 2056), method, True, True) == (2056, 2056) | |||
|
|||
def test_resample_neighbor(): | |||
resample_method('neighbor') | |||
resample_method('neighbor') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are tabs everywhere in this file, so you just made it inconsistent. I will fix the whole file in an extra PR, I think it's cleaner if you leave like it was before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll put it back.
@nabobalis the easiest thing to do would be suppress the nan's but I don't know if that is sensible. Maybe the |
@nabobalis NANs aren't the issue. I wrote an equivalent to 'aia_intscale.pro' (not contributed yet) to do the LMSAL "standard" intensity scaling and clipping for the visuals, had to remove _get_mpl_normalizer on my local code for peek and plot to work. |
@larrymanley oh so it is p.s. use ` for the code type setting. |
The value used to calulcate the global gamma-transformed image. | ||
Ideally should be betwen 2.5 to 4. | ||
|
||
h : float, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not descriptive enough.
@Cadair With regard to peek and plot, _get_mpl_normalizer is breaking intscale and multiscale_gaussian |
|
||
Returns | ||
------- | ||
image: numpy.ndarray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space before :
@larrymanley Interesting. @nabobalis can you see if you can work out why this is breaking |
import scipy.ndimage as ndimage | ||
|
||
|
||
def multiscale_gaussian(data, sigma=[1.25, 2.5, 5, 10, 20, 40], k=0.7, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so I've sorted this some. It needs to be more clear that this sigma
is the
I'd also note in the docs that this is for visualization only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigma
takes a list and should be sigmas
to be consistent with weights
.
Also, the inputs are not sanitized. Does it break if the argument sigma=7
is passed? It should, because 7
is not iterable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the code does break if sigma=7 is passed.
It breaks at the first if statement.
if not weights:
weights = np.ones(len(sigmas))
I'm wondering if these visualization specific normalization functions should be under either sunpy.vis.image.normalization or sunpy.image.vis.normalization |
@rhewett that might not be a bad idea, make it clearer it is a vis tool |
So, what would be better, sunpy.vis.image.normalization or sunpy.image.vis.normalization? |
How are you crating the new map for the gaussian processed data? |
@nabobalis I think |
Conflicts: CHANGELOG.md
Conflicts: CHANGELOG.md
Conflicts: CHANGELOG.md
ITS DEAD JIM! |
The implementation of this http://arxiv.org/pdf/1403.6613v1.pdf
Eventually, I will add more methods.