Skip to content
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0755f43
Implemented the Fourier Normailizing Radial Gradient Filter
vatch123 Mar 3, 2019
9268712
Updated the variable name
vatch123 Mar 3, 2019
fd5eb43
Added the attenuation coefficients
vatch123 Mar 3, 2019
f4da119
Merge pull request #1 from sunpy/master
vatch123 Mar 3, 2019
51db695
Updated the docstrings
vatch123 Mar 3, 2019
b7d7903
Updated docs, Added tests
vatch123 Mar 7, 2019
13775b5
added the changelog file
vatch123 Mar 7, 2019
a9e7d11
Fixed PEP8 issues
vatch123 Mar 7, 2019
eddd3bd
Update sunkit_image/offlimb_enhance.py
nabobalis Mar 7, 2019
19eaca6
Update sunkit_image/offlimb_enhance.py
nabobalis Mar 7, 2019
73075e0
Update sunkit_image/offlimb_enhance.py
nabobalis Mar 7, 2019
aa87701
Update sunkit_image/offlimb_enhance.py
nabobalis Mar 7, 2019
c75dde9
Apply suggestions from code review
nabobalis Mar 7, 2019
616e4ab
Updated the tests
vatch123 Mar 8, 2019
8c16423
Merge pull request #2 from sunpy/master
vatch123 Mar 12, 2019
1810bfd
Changed the test images to ones with radial profiles
vatch123 May 18, 2019
f97340f
Added one more test to NRGF
vatch123 May 18, 2019
23dbeb3
Spelling Corrected
vatch123 May 19, 2019
abff13b
Minor fixes
vatch123 May 20, 2019
80d6737
Tests added to FNRGF
vatch123 May 20, 2019
2f11ddd
Apply suggestions from code review
vatch123 May 20, 2019
f63d7f0
Resolved merge conflicts
vatch123 May 21, 2019
adbd9f8
Merge pull request #3 from sunpy/master
vatch123 May 24, 2019
5ea0601
Changed the way test maps are created
vatch123 May 25, 2019
32e0fae
Fixed the confest.py
vatch123 May 26, 2019
fd99563
Modules and functions renamed
vatch123 May 27, 2019
319967e
FIxed a corner case
vatch123 May 27, 2019
f5e4e0f
Added examples
vatch123 May 27, 2019
e2680ff
FIxed the docs file of offlimb
vatch123 May 27, 2019
e09fd95
Fixed the doc file again
vatch123 May 27, 2019
cb40301
Minor fixes
vatch123 May 27, 2019
bc7a7e4
Applied the suggestion
vatch123 May 27, 2019
0acfc51
Fixed the examples
vatch123 May 28, 2019
9817ba5
Merge conflicts resolution
vatch123 May 28, 2019
9555beb
Removed offlimb_enhance
vatch123 May 28, 2019
2b1b82d
fixed indentation and tests
vatch123 May 29, 2019
eb2c77c
Added figure tests
vatch123 May 30, 2019
3c41f99
marker for future tests
vatch123 May 30, 2019
bb6d2ab
Minor changes
vatch123 Jun 3, 2019
1e3c22f
Capitalized "Fourier"
vatch123 Jun 6, 2019
c2dc74a
Removed merge conflicts
vatch123 Jun 8, 2019
40af095
Apply suggestions from code review
vatch123 Jun 8, 2019
ec93937
Made changes to the offlimb file
vatch123 Jun 8, 2019
7e095c4
CHanged to radial
vatch123 Jun 8, 2019
a2308d1
Renamed test file
vatch123 Jun 8, 2019
1fcabf8
Added test for helpers
vatch123 Jun 8, 2019
236786b
Fixed the examples and figure hashes
vatch123 Jun 8, 2019
a7e7b22
fixed hash value
vatch123 Jun 8, 2019
71426aa
Docs fixed
vatch123 Jun 9, 2019
e67eb0f
Apply suggestions from code review
vatch123 Jun 9, 2019
c8fed34
added tests
vatch123 Jun 9, 2019
0adcdc1
Apply suggestions from code review
vatch123 Jun 10, 2019
d82fc41
Added the coefficient function and doc changes
vatch123 Jun 10, 2019
72b9566
Docs formatting done
vatch123 Jun 10, 2019
897a9f0
Added tests for warning
vatch123 Jun 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/17.feature.rst
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.
2 changes: 1 addition & 1 deletion docs/code_ref/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Code Reference
:maxdepth: 2

sunkit_image
offlimb_enhance
radial
utils
7 changes: 0 additions & 7 deletions docs/code_ref/offlimb_enhance.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/code_ref/radial.rst
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
66 changes: 66 additions & 0 deletions examples/radial_gradient_filters.py
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.
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, which values?
But I don't think the algorithm does anything other than what was intended

Copy link
Member

Choose a reason for hiding this comment

The 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()

###########################################################################
# 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()
1 change: 0 additions & 1 deletion sunkit_image/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import tempfile
import warnings
import importlib
from sys import version_info

import pytest

Expand Down
284 changes: 0 additions & 284 deletions sunkit_image/offlimb_enhance.py

This file was deleted.

Loading