Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
bb4876a
a better approach to dev
Deus1704 Jun 12, 2024
08a0ff9
added decorator and incorporated suggestions
Deus1704 Jun 19, 2024
e02eb28
Merge branch 'main' into new_coalignment_api
Deus1704 Jun 19, 2024
f25076b
updated the docstring
Deus1704 Jun 20, 2024
98c384e
added tests for majority of all funcs
Deus1704 Jun 21, 2024
47e1256
adds how to guide
Deus1704 Jun 25, 2024
73373fc
temporary de-referencing funcs and methods
Deus1704 Jun 25, 2024
125e78a
fix doc tree
Deus1704 Jun 25, 2024
53fd4d5
added refs again
Deus1704 Jun 25, 2024
4150115
Apply suggestions from code review
Deus1704 Jun 25, 2024
0ac31ab
code review and fixing minor mistakes
Deus1704 Jun 25, 2024
ffe357b
changed doc to ref
Deus1704 Jun 25, 2024
adc8bcb
Update ref
Deus1704 Jun 26, 2024
bc6d2e1
better linking
Deus1704 Jun 26, 2024
31d62fa
Merge remote-tracking branch 'upstream/main' into new_coalignment_api
Deus1704 Jul 12, 2024
5d67806
updated the api, now returns the map with updated metadata
Deus1704 Jul 12, 2024
89f6d99
updated the how_to_guide
Deus1704 Jul 12, 2024
963e476
docstring fix
Deus1704 Jul 12, 2024
ba8ec82
first try at replacing old coalign
Deus1704 Jul 15, 2024
fcf9eae
removing old coalignment completely, refs fixed, old example removed
Deus1704 Jul 15, 2024
7dba720
fix the issue of method not being registered
Deus1704 Jul 15, 2024
93a477b
fix the pixel pair issue
Deus1704 Jul 15, 2024
177173d
Apply suggestions from code review & testing bot
Deus1704 Jul 17, 2024
466f8e8
Merge remote-tracking branch 'upstream/main' into new_coalignment_api
Deus1704 Jul 19, 2024
b7ac50c
fix the order of the reference and target maps
Deus1704 Jul 19, 2024
573d1e3
calm down pre-commit
Deus1704 Jul 19, 2024
0cee8f1
Merge remote-tracking branch 'upstream/main' into new_coalignment_api
Deus1704 Jul 25, 2024
81b7fcb
fixed the method & added examples and tests
Deus1704 Jul 26, 2024
587833b
adding the eis file
Deus1704 Jul 26, 2024
9d6ab7f
Apply suggestions from code review
Deus1704 Aug 2, 2024
ff7b1b2
Merge remote-tracking branch 'upstream/main' into new_coalignment_api
Deus1704 Aug 2, 2024
6f0bc9d
made changes based on suggestions
Deus1704 Aug 2, 2024
7eb84b1
pre-commit
Deus1704 Aug 2, 2024
cfb93ea
Update docs/how_to_guide/using_the_coalignment_interface.rst
Deus1704 Aug 2, 2024
3079671
rename all please
Deus1704 Aug 2, 2024
8ed4173
renamed coalignment to coalign, made example plot better, removed nam…
Deus1704 Aug 7, 2024
f8d1f5a
here too
Deus1704 Aug 7, 2024
eb94a1b
Merge branch 'main' into new_coalignment_api
Deus1704 Aug 7, 2024
64e07ad
minor fix
Deus1704 Aug 7, 2024
6173e57
marked remote test
Deus1704 Aug 9, 2024
8e0508d
testing by including the source
Deus1704 Aug 9, 2024
d02b986
fixed the rst
Deus1704 Aug 9, 2024
1146039
Merge branch 'main' into new_coalignment_api
Deus1704 Aug 9, 2024
b4e54de
updated the handling of cdelt values
Deus1704 Aug 10, 2024
7c64024
fixed the plot bloc
Deus1704 Aug 9, 2024
9ceadbc
added the figure test case1/2 and clean up
Deus1704 Aug 14, 2024
a0e5c6e
fixed the warning list
Deus1704 Aug 14, 2024
40713b7
fix refs and clean
Deus1704 Aug 14, 2024
17998be
adding fixture
Deus1704 Aug 14, 2024
6255c17
trying to suppress warnings
Deus1704 Aug 14, 2024
df21cd6
major changes; confirm affine, fixed test case, removed a guide
Deus1704 Aug 18, 2024
2db2b09
added a note
Deus1704 Aug 18, 2024
2cabfa4
slightly changed the map observation and fig hash
Deus1704 Aug 18, 2024
2634cc8
fixed refs
Deus1704 Aug 18, 2024
49793d0
trying to fix fig hash
Deus1704 Aug 18, 2024
2784fd4
fixed online test, added few more tests, updated coalignment.rst
Deus1704 Aug 21, 2024
b8ae410
trying automodule
Deus1704 Aug 21, 2024
491acbf
docstring fix
Deus1704 Aug 21, 2024
c87a192
fix the online fail by suppressing Astropy Warning
Deus1704 Aug 21, 2024
fcf2ea2
one last try
Deus1704 Aug 21, 2024
44c5c4c
might need a better way
Deus1704 Aug 21, 2024
4e86bd7
for 6.1.2
Deus1704 Aug 21, 2024
a6c1f85
final try
Deus1704 Aug 21, 2024
2688e52
added the comprehensive changelog
Deus1704 Aug 23, 2024
374cf3e
fixed the changelog
Deus1704 Aug 23, 2024
a775b27
Apply suggestions from code review
Deus1704 Aug 23, 2024
7d130bf
fix the test fails and internalized funcs
Deus1704 Aug 24, 2024
33b9428
added the url for eis raster
Deus1704 Aug 24, 2024
2aa5e72
forgot
Deus1704 Aug 24, 2024
8f26dcb
clean up old raster and few lint fixes
Deus1704 Aug 24, 2024
c6f36c4
added a check for astropy version
Deus1704 Aug 25, 2024
8b4696f
Merge branch 'main' of github.com:sunpy/sunkit-image into pr/207
nabobalis Sep 10, 2024
5884fc6
Nabil review
nabobalis Sep 10, 2024
1be344f
Apply suggestions from code review
nabobalis Nov 13, 2024
da81f44
Addressed comments from Albert
nabobalis Nov 13, 2024
88c4c85
Merge branch 'main' of github.com:sunpy/sunkit-image into pr/207
nabobalis Nov 13, 2024
1b02285
fix import
nabobalis Nov 13, 2024
b455b83
Merge branch 'main' of github.com:sunpy/sunkit-image into pr/207
nabobalis Feb 20, 2025
9666bf4
Added second method
nabobalis Feb 22, 2025
14c4a74
Merge branch 'main' of github.com:sunpy/sunkit-image into pr/207
nabobalis Feb 22, 2025
ce378bd
doc
nabobalis Feb 22, 2025
c5a8053
bugfix
nabobalis Feb 22, 2025
0062510
Merge branch 'main' into new_coalignment_api
nabobalis Jun 8, 2025
5a3f0e9
in-progress refactor of order of args
wtbarnes Jun 30, 2025
55986ad
don't allow rotations or scaling for now
wtbarnes Jul 10, 2025
86b7428
actually fetch image
wtbarnes Jul 10, 2025
5f794d6
fix example
wtbarnes Jul 10, 2025
20cc8c8
update figure hashes
wtbarnes Jul 10, 2025
50eee79
adjust imports
wtbarnes Jul 10, 2025
b473d3c
Merge branch 'main' of github.com:sunpy/sunkit-image into pr/207
nabobalis Jul 17, 2025
6f72952
Tweaks to logging
nabobalis Jul 17, 2025
b910153
Merge branch 'main' of github.com:sunpy/sunkit-image into pr/207
nabobalis Oct 7, 2025
536758e
Tweaks from Nabil
nabobalis Oct 7, 2025
286b3a3
Overhaul of where stuff lives to get dict to store stuff in docs
nabobalis Oct 7, 2025
8a9aaae
Merge branch 'main' into new_coalignment_api
nabobalis Nov 14, 2025
db2b056
Minor move around whitespace
nabobalis Nov 18, 2025
6cc4c21
improve the figure test
nabobalis Nov 18, 2025
694d7bd
Redid some tests and added plate scale warning
nabobalis Nov 19, 2025
969aefd
Full disc tests
nabobalis Nov 19, 2025
5b853e8
Update examples/aligning_aia_with_eis_maps.py
nabobalis Nov 19, 2025
d8c326d
Update sunkit_image/coalignment/tests/test_match_template.py
nabobalis Nov 19, 2025
1ba17c4
Update sunkit_image/coalignment/tests/test_match_template.py
nabobalis Nov 19, 2025
10e7315
Update sunkit_image/coalignment/interface.py
nabobalis Nov 19, 2025
107bd7b
Update sunkit_image/coalignment/interface.py
nabobalis Nov 19, 2025
6ce659f
Update sunkit_image/coalignment/interface.py
nabobalis Nov 19, 2025
f6efb28
Update sunkit_image/coalignment/interface.py
nabobalis Nov 19, 2025
53b02ea
Update sunkit_image/coalignment/interface.py
nabobalis Nov 19, 2025
edd7737
Update sunkit_image/coalignment/interface.py
nabobalis Nov 19, 2025
209d30d
Update sunkit_image/coalignment/interface.py
nabobalis Nov 19, 2025
f239d3a
Update sunkit_image/coalignment/interface.py
nabobalis Nov 19, 2025
009cb7f
precommit
nabobalis Nov 19, 2025
01c1344
Fix tests and improve pad_input handling
nabobalis Nov 19, 2025
2917d48
Fixed scale check
nabobalis Nov 19, 2025
345956a
Merge branch 'main' into coalign_pr
wtbarnes Feb 11, 2026
6498533
correct changelog PR
wtbarnes Feb 11, 2026
1e79fc8
extra figure and minor edits to gallery example
wtbarnes Feb 12, 2026
92352d0
minor reorganizaiton of coalignment API docs
wtbarnes Feb 12, 2026
10ec3f4
reorganize how-to guide
wtbarnes Feb 12, 2026
da37e04
docstring cleanup
wtbarnes Feb 12, 2026
1d9a6ef
tighten up test tolerance
wtbarnes Feb 12, 2026
e6114eb
Merge branch 'main' into coalign_pr
Cadair Feb 18, 2026
c525b62
Apply suggestions from code review
nabobalis Feb 18, 2026
7d0adc1
[Fix] Emdashes are important for writing english -- vital even
nabobalis Feb 18, 2026
8e45e74
Update figure env
nabobalis Feb 18, 2026
b731031
Fix formatting
nabobalis Feb 18, 2026
c1bb514
Rename section to Sunspot Tracking And Recognition
nabobalis Feb 20, 2026
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
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
jobname:
type: string
docker:
- image: cimg/python:3.12
- image: cimg/python:3.13
environment: TOXENV=<< parameters.jobname >>
steps:
- run: *no-backports
Expand All @@ -56,7 +56,7 @@ jobs:
jobname:
type: string
docker:
- image: cimg/python:3.12
- image: cimg/python:3.13
environment:
TOXENV: << parameters.jobname >>
GIT_SSH_COMMAND: ssh -i ~/.ssh/id_rsa_6464b6a8248237ca368fd4690777d921
Expand Down Expand Up @@ -97,13 +97,13 @@ workflows:
matrix:
parameters:
jobname:
- "py312-figure"
- "py313-figure"
- deploy-reference-images:
name: baseline-<< matrix.jobname >>
matrix:
parameters:
jobname:
- "py312-figure"
- "py313-figure"
requires:
- << matrix.jobname >>
filters:
Expand Down
3 changes: 3 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ default.extend-ignore-identifiers-re = [
"iy",
"BA",
]

[default.extend-words]
eis = "eis"
2 changes: 1 addition & 1 deletion changelog/290.breaking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Increased the minimum required versions:
- sunpy 7.0.0 (from 6.0.0)
- NumPy 1.26.0 (from 1.23.5)
- Astropy 6.1.0 (from 5.3.0)
- SciPy 1.11.0 (from 1.10.1)
- SciPy 1.12.0 (from 1.10.1)
2 changes: 2 additions & 0 deletions changelog/293.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The previous coalignment API has been deleted and replaced with a new set of imports and functions.
Please see this example: :ref:`sphx_glr_generated_gallery_aligning_aia_with_eis_maps.py`.
6 changes: 6 additions & 0 deletions docs/code_ref/asda.rst
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
ASDA (`sunkit_image.asda`)
**************************

This package contains an implementation of the `Automated Swirl Detection
Algorithm (ASDA) <https://ui.adsabs.harvard.edu/abs/2019ApJ...872...22L/abstract>`__.

.. automodapi:: sunkit_image.asda
15 changes: 15 additions & 0 deletions docs/code_ref/coalignment.rst
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
Coalignment (`sunkit_image.coalignment`)
****************************************

Routines to perform coalignment of solar images.

.. automodapi:: sunkit_image.coalignment

.. automodapi:: sunkit_image.coalignment.interface
:no-inheritance-diagram:
:skip: coalign_map

.. automodapi:: sunkit_image.coalignment.register

.. automodapi:: sunkit_image.coalignment.match_template

.. automodapi:: sunkit_image.coalignment.phase_cross_correlation
5 changes: 5 additions & 0 deletions docs/code_ref/enhance.rst
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
Enhancement (`sunkit_image.enhance`)
************************************

This package contains enhancement routines for solar physics data.

.. automodapi:: sunkit_image.enhance
5 changes: 5 additions & 0 deletions docs/code_ref/granule.rst
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
Granule Detection (`sunkit_image.granule`)
******************************************

This package contains functions that will segment images for granule detection.

.. automodapi:: sunkit_image.granule
6 changes: 6 additions & 0 deletions docs/code_ref/radial.rst
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
Radial Enhancement (`sunkit_image.radial`)
******************************************

This package contains functions that can be used to enhance the regions above a
given radius.

.. automodapi:: sunkit_image.radial
6 changes: 6 additions & 0 deletions docs/code_ref/stara.rst
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
Sunspot Tracking And Recognition (`sunkit_image.stara`)
*******************************************************

This package contains an implementation of the `Sunspot Tracking And Recognition
Algorithm (STARA) <https://doi.org/10.1007/s11207-009-9420-z>`__.

.. automodapi:: sunkit_image.stara
8 changes: 8 additions & 0 deletions docs/code_ref/time_lag.rst
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
Time lag (`sunkit_image.time_lag`)
**********************************

This package contains functions for calculating the cross-correlation and time
lag between intensity cubes.

Useful for understanding time variability in EUV light curves.

.. automodapi:: sunkit_image.time_lag
5 changes: 5 additions & 0 deletions docs/code_ref/trace.rst
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
Loop tracing (`sunkit_image.trace`)
***********************************

This package contains functions that will the trace out coronal loop-like structures in an image.

.. automodapi:: sunkit_image.trace
3 changes: 3 additions & 0 deletions docs/code_ref/utils.rst
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Utilities (`sunkit_image.utils`)
********************************

.. automodapi:: sunkit_image.utils
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
elif _version.is_devrelease:
version = release = f"{_version.base_version}.dev{_version.dev}"
is_development = _version.is_devrelease
is_release = not(_version.is_prerelease or _version.is_devrelease)
is_release = not (_version.is_prerelease or _version.is_devrelease)

project = "sunkit_image"
author = "The SunPy Community"
Expand Down Expand Up @@ -105,7 +105,7 @@
),
"matplotlib": ("https://matplotlib.org/stable", None),
"sunpy": ("https://docs.sunpy.org/en/stable/", None),
"ndcube": ('https://docs.sunpy.org/projects/ndcube/en/stable/', None),
"ndcube": ("https://docs.sunpy.org/projects/ndcube/en/stable/", None),
"astropy": ("https://docs.astropy.org/en/stable/", None),
"dask": ("https://docs.dask.org/en/latest", None),
"skimage": ("https://scikit-image.org/docs/stable/", None),
Expand Down
57 changes: 57 additions & 0 deletions docs/how_to_guide/adding_a_coalignment_method.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. _sunkit-image-how-to-guide-add-a-new-coalignment-method:

****************************
Add a New Coalignment Method
****************************

In addition to the coalignment methods provided in sunkit-image, users can also write their own
coalignment methods and "register" these methods with sunkit-image such that they can be used through the same interface as the builtin methods without having to alter the underlying
sunkit-image package.

At a minimum, your new coalignment function should do the following:

1. Take the following inputs:

- ``target_array`` : The 2D array to be coaligned.
- ``reference_array`` : The 2D array to align to.
- ``**kwargs``: Optional keyword arguments used by your method

2. Decide the values of the affine transformation - translation, scale and rotation. In most cases, this means calculating the shifts in the x- and y-directions needed to align ``input_array`` with ``target_array``.

3. Return an instance of `~sunkit_image.coalignment.interface.AffineParams` with the results of your coalignment procedure.

Additionally, registered methods are expected to handled NaNs and Infs should they arise as a result of your coalignment procedure.
The :func:`~sunkit_image.coalignment.coalign_map` function does not make any attempt to filter out
these non-finite values.

To register your new coalignment method, you can use the :func:`~sunkit_image.coalignment.register.register_coalignment_method` decorator to register your new method with a custom name. An example of how to use this decorator is shown below:

.. code-block:: python

from sunkit_image.coalignment.interface import AffineParams, register_coalignment_method

@register_coalignment_method("my_custom_coalignment_method")
def my_coalignment_method(target_array, reference_array, **kwargs):
# Your coalignment code goes here
# This should encompass calculating the shifts,
# handling NaN values appropriately.
# Return the shifts in an affine style, such as the scale, rotation and translation.
return AffineParams(scale, rotation, translation)


To check if your method is registered, you can check if it is present in the registered methods dictionary ``REGISTERED_METHODS`` using the following code:

.. code-block:: python

from sunkit_image.coalignment.interface import REGISTERED_METHODS

print(REGISTERED_METHODS)

If your coalignment method has been successfully registered, you should now be able to call it
through the `~sunkit_image.coalignment.coalign_map` interface:

.. code-block:: python

from sunkit_image.coalignment import coalign_map

coaligned_map = coalign_map(target_map, reference_map, method='my_custom_coalignment_method')
10 changes: 10 additions & 0 deletions docs/how_to_guide/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _sunkit-image-how-to-reference:

*************
How To Guide
*************

.. toctree::
:maxdepth: 1

adding_a_coalignment_method
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sunkit-image
:maxdepth: 1

code_ref/index
how_to_guide/index

.. grid-item-card:: Other info

Expand Down
22 changes: 12 additions & 10 deletions examples/advanced_wow.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,29 @@
# gamma-stretched input, with weight "h".

gamma = 4
bilateral_denoised_merged_wow = enhance.wow(submap_193, bilateral=1, denoise_coefficients=denoise_coefficients, gamma=gamma, h=0.99)
bilateral_denoised_merged_wow = enhance.wow(
submap_193, bilateral=1, denoise_coefficients=denoise_coefficients, gamma=gamma, h=0.99
)

###########################################################################
# Finally, we will plot the full set of outputs created and
# compare that to the original image.

fig = plt.figure(figsize=(8, 12))
variations = {
f'Input | Gamma = {gamma} stretch': {'map': submap_193, 'stretch': PowerStretch(1 / gamma)},
'WOW | Linear stretch': {'map': default_wow, 'stretch': LinearStretch()},
'Denoised WOW': {'map': denoised_wow, 'stretch': LinearStretch()},
'Edge-aware WOW': {'map': bilateral_wow, 'stretch': LinearStretch()},
'Edge-aware & denoised WOW': {'map': bilateral_denoised_wow, 'stretch': LinearStretch()},
'Merged with input': {'map': bilateral_denoised_merged_wow, 'stretch': LinearStretch()}
f"Input | Gamma = {gamma} stretch": {"map": submap_193, "stretch": PowerStretch(1 / gamma)},
"WOW | Linear stretch": {"map": default_wow, "stretch": LinearStretch()},
"Denoised WOW": {"map": denoised_wow, "stretch": LinearStretch()},
"Edge-aware WOW": {"map": bilateral_wow, "stretch": LinearStretch()},
"Edge-aware & denoised WOW": {"map": bilateral_denoised_wow, "stretch": LinearStretch()},
"Merged with input": {"map": bilateral_denoised_merged_wow, "stretch": LinearStretch()},
}
interval = AsymmetricPercentileInterval(1, 99.9)
for i, (title, image) in enumerate(variations.items()):
ax = fig.add_subplot(3, 2, i + 1, projection=image['map'])
image['map'].plot(norm=ImageNormalize(image['map'].data, interval=interval, stretch=image['stretch']))
ax = fig.add_subplot(3, 2, i + 1, projection=image["map"])
image["map"].plot(norm=ImageNormalize(image["map"].data, interval=interval, stretch=image["stretch"]))
ax.set_title(title)
ax.axis('off')
ax.axis("off")

fig.tight_layout()

Expand Down
92 changes: 92 additions & 0 deletions examples/aligning_aia_with_eis_maps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
"""
=====================
Coaligning EIS to AIA
=====================

This example shows how to coalign EIS rasters to AIA images in order correct for the pointing
uncertainty in EIS.
"""

import matplotlib.pyplot as plt

import astropy.units as u
from astropy.visualization import AsinhStretch, ImageNormalize

import sunpy.map

from sunkit_image.coalignment import coalign_map

###################################################################################
# For this example, we will use a preprocessed EIS raster image of the Fe XII
# 195.119 Å line.
# This raster image was prepared using the `eispac <https://eispac.readthedocs.io/en/latest/>`__ package.

eis_map = sunpy.map.Map(
"https://github.com/sunpy/data/raw/main/sunkit-image/eis_20140108_095727.fe_12_195_119.2c-0.int.fits"
)

###################################################################################
# Next, let's download the AIA data we will use as a reference image.
# We want AIA data near the beginning of the EIS raster and we'll use the
# 193 Å channel of AIA as it sees plasma at approximately the same temperature as
# the 195.119 Å line in our EIS raster.
# We have stored this file on Github so we can download it directly.

aia_map = sunpy.map.Map(
"https://github.com/sunpy/data/raw/refs/heads/main/sunkit-image/aia.lev1.193A_2014_01_08T09_57_30.84Z.image_lev1.fits"
)

####################################################################################
# Before coaligning the images, we first resample the AIA image to the same plate
# scale as the EIS image. This will ensure better results from our coalignment.

nx = (aia_map.scale.axis1 * aia_map.dimensions.x) / eis_map.scale.axis1
ny = (aia_map.scale.axis2 * aia_map.dimensions.y) / eis_map.scale.axis2

aia_downsampled = aia_map.resample(u.Quantity([nx, ny]))

####################################################################################
# Now we can coalign EIS and AIA using cross-correlation. By default, this function
# uses the "match_template" method. For details of the implementation refer to the
# documentation of `skimage.feature.match_template`.

coaligned_eis_map = coalign_map(eis_map, aia_downsampled)

####################################################################################
# To check now effective this has been, we will plot the EIS data and
# overlap the bright regions from AIA before and after the coalignment.

fig = plt.figure(figsize=(10, 7.5), layout="constrained")
ax = fig.add_subplot(121, projection=eis_map)
eis_map.plot(
axes=ax,
title="Before coalignment",
aspect=eis_map.scale.axis2 / eis_map.scale.axis1,
cmap="Blues_r",
norm=ImageNormalize(stretch=AsinhStretch()),
)
aia_map.draw_contours([800] * aia_map.unit, axes=ax)
ax = fig.add_subplot(122, projection=coaligned_eis_map, sharex=ax, sharey=ax)
coaligned_eis_map.plot(
axes=ax,
title="After coalignment",
aspect=coaligned_eis_map.scale.axis2 / coaligned_eis_map.scale.axis1,
cmap="Blues_r",
norm=ImageNormalize(stretch=AsinhStretch()),
)
aia_map.draw_contours([800] * aia_map.unit, axes=ax)

####################################################################################
# We can also visualize this shift by overlaying the extent of the two EIS
# maps on the AIA image we used to perform the coalignment.

fig = plt.figure(figsize=(8, 8))
ax = fig.add_subplot(projection=aia_map)
aia_map.plot(axes=ax)
eis_map.draw_extent(axes=ax, color="C0", label="Original")
coaligned_eis_map.draw_extent(axes=ax, color="C1", label="Coaligned")
ax.set_xlim(1700, 2500)
ax.set_ylim(1200, 2200)
ax.legend()

plt.show()
7 changes: 1 addition & 6 deletions examples/radial_gradient_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@
# choose them according to your requirements. These can be changed by tweaking the following keywords: ``mean_attenuation_range`` and ``std_attenuation_range``.

order = 20
base_fnrgf = radial.fnrgf(
aia_map,
radial_bin_edges=radial_bin_edges,
order=order,
application_radius=1 * u.R_sun
)
base_fnrgf = radial.fnrgf(aia_map, radial_bin_edges=radial_bin_edges, order=order, application_radius=1 * u.R_sun)

###########################################################################
# Now we will also use the final filter, RHEF.
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ watroo = ["watroo"]
tests = [
"sunkit_image[all]",
"dask",
# NumPy>=2.4 not compatible with some helpers in astropy<7.2
"numpy<2.4",
"pytest-astropy",
"pytest-mpl",
"pytest-xdist",
Expand Down
4 changes: 2 additions & 2 deletions sunkit_image/_dev/scm_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
try:
from setuptools_scm import get_version

version = get_version(root=Path('../..'), relative_to=__file__)
version = get_version(root=Path("../.."), relative_to=__file__)
except ImportError:
raise
except Exception as e:
raise ValueError('setuptools_scm can not determine version.') from e
raise ValueError("setuptools_scm can not determine version.") from e
5 changes: 0 additions & 5 deletions sunkit_image/asda.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
"""
This module contains an implementation of the Automated Swirl Detection
Algorithm (ASDA).
"""

import warnings
from itertools import product

Expand Down
Loading
Loading