-
-
Notifications
You must be signed in to change notification settings - Fork 49
Implemented the Fourier Normalizing Radial Gradient Filter #17
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
Changes from 54 commits
0755f43
9268712
fd5eb43
f4da119
51db695
b7d7903
13775b5
a9e7d11
eddd3bd
19eaca6
73075e0
aa87701
c75dde9
616e4ab
8c16423
1810bfd
f97340f
23dbeb3
abff13b
80d6737
2f11ddd
f63d7f0
adbd9f8
5ea0601
32e0fae
fd99563
319967e
f5e4e0f
e2680ff
e09fd95
cb40301
bc7a7e4
0acfc51
9817ba5
9555beb
2b1b82d
eb2c77c
3c41f99
bb6d2ab
1e3c22f
c2dc74a
40af095
ec93937
7e095c4
a2308d1
1fcabf8
236786b
a7e7b22
71426aa
e67eb0f
c8fed34
0adcdc1
d82fc41
72b9566
897a9f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Added a new function (`sunkit_image.radial.fnrgf`) to normalize the radial brightness gradient using a Fourier approximation. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,5 +8,5 @@ Code Reference | |
| :maxdepth: 2 | ||
|
|
||
| sunkit_image | ||
| offlimb_enhance | ||
| radial | ||
| utils | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ****** | ||
| radial | ||
| ****** | ||
|
|
||
| This package implements radial enhancement routines for solar physics data. | ||
|
|
||
| .. automodapi:: sunkit_image.radial |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| """ | ||
| ======================= | ||
| Radial Gradient Filters | ||
| ======================= | ||
|
|
||
| This example applies both the normalizing radial gradient (`sunkit_image.radial.nrgf`) filter and Fourier | ||
| normalizing radial gradient filter (`sunkit_image.radial.fnrgf`) to a sunpy map. | ||
| """ | ||
| # sphinx_gallery_thumbnail_number = 3 | ||
|
|
||
| import numpy as np | ||
| import matplotlib.pyplot as plt | ||
|
|
||
| import astropy.units as u | ||
|
|
||
| import sunpy.map | ||
| import sunpy.data.sample | ||
|
|
||
| import sunkit_image.radial as radial | ||
| from sunkit_image.utils import equally_spaced_bins | ||
|
|
||
| ########################################################################### | ||
| # Sunpy's sample data contain a number of suitable FITS files for this purpose. | ||
| aia_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE) | ||
|
|
||
| # The original image is plotted to showcase the difference. | ||
| fig = plt.figure() | ||
| ax = plt.subplot(projection=aia_map) | ||
| aia_map.plot() | ||
|
|
||
| ########################################################################### | ||
| # Both the NRGF and FNRGF work on radial segments above their application radius. | ||
| # Here we create those segments radial segments. Each segment created will be of | ||
| # equal dimensions radially. The distance between 1 solar radii and 2 solar radii | ||
| # is divided into 100 equal parts by the following two lines. | ||
| radial_bin_edges = equally_spaced_bins() | ||
| radial_bin_edges *= u.R_sun | ||
|
|
||
| # The NRGF filter is applied after it. | ||
| out1 = radial.nrgf(aia_map, radial_bin_edges) | ||
|
|
||
| # The NRGF filtered map is plotted. | ||
| # The image seems a little washed out so you may need to change some plotting settings | ||
| # for a clearer output. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you try to change the plotting values to prevent the image from being so washed out? I do wonder if something is wrong with this version of the algorithm.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, which values?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, some of the plotting values? |
||
| fig = plt.figure() | ||
| ax = plt.subplot(projection=out1) | ||
| out1.plot() | ||
vatch123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ########################################################################### | ||
| # We will need to work out a few parameters for the FNRGF. | ||
| # Order is the number of Fourier coefficients to be used in the approximation. | ||
| # The attentuation coefficient are calculated to be linearly decreasing, you should | ||
| # choose them according to your requirements. | ||
| order = 20 | ||
| attenuation_coefficients = radial.set_attenuation_coefficients(order) | ||
|
|
||
| # The FNRGF filter is applied after it. | ||
| out2 = radial.fnrgf(aia_map, radial_bin_edges, order, attenuation_coefficients) | ||
|
|
||
| # The FNRGF filtered map is plotted. | ||
| fig = plt.figure() | ||
| ax = plt.subplot(projection=out2) | ||
| out2.plot() | ||
|
|
||
| # All the figures are plotted. | ||
| plt.show() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ | |
| import tempfile | ||
| import warnings | ||
| import importlib | ||
| from sys import version_info | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.