Skip to content

Commit

Permalink
Use metadata in remove lightleak (HinodeXRT#288)
Browse files Browse the repository at this point in the history
* Fix paths to spectral model files in temperature response

The path to the model for hybrid abundances and photospheric abundances were switched.

* Fix atol in test_temperature_response_coronal.py

Made atol scaled to temperature response to provide a more stringent test.

* Fix atol in test_temperature_response_hybrid.py

Made atol scaled to temperature response to provide a more stringent test.

* Fix atol in test_temperature_response_photospheric.py

Made atol scaled to temperature response to provide a more stringent test.

* Fix atol in test_temperature_response.py

Made atol scaled to temperature response to provide a more stringent test.

* Fix atol, rtol values in test_temperature_response.py

Use atol and rtol values that should lead to passing all tests.

* Fix atol, rtol values in test_temperature_response_coronal.py

Use atol, rtol values that should lead to passing all tests.

* Fix atol, rtol values in test_temperature_response_hybrid.py

Use atol, rtol values that should lead to passing all tests.

* Fix atol, rtol values in test_temperature_response_photospheric.py

Use atol, rtol values that should lead to passing all tests.

* Another fix to test_temperature_response_hybrid.py

needed to scale atol to max value of temperature response

* Another fix to test_temperature_response_coronal.py

need to scale atol to the max value of temperature response

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Created new directory, image_correction, and moved xrt_remove_lightleak and xrt_deconvolve to that directory. Also moved associated tests and data

* small changes to image_correction/__init__.py

* Changed from print statements to logger in temperature_from_filter_ratio. Also added fits keywords HGLN_OBS and HGLT_OBS to returned map metadata.

* Update remove_lightleak.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jslavin and pre-commit-ci[bot] authored Sep 4, 2024
1 parent 6b0b818 commit e1a30a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions xrtpy/image_correction/remove_lightleak.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,22 @@ def _get_stray_light_phase(date_obs):
def _select_lightleak_file(filter_wheel_1, filter_wheel_2, date):
phase = _get_stray_light_phase(date)
file_dict = {
("open", "al mesh"): {
("open", "al_mesh"): {
2: "term_p2am_20150718_160913.fits",
3: "term_p3am_20170808_180126.fits",
4: "term_p4am_20180712_171919.fits",
5: "term_p5am_20220709_180901.fits",
},
("al poly", "open"): {
("al_poly", "open"): {
2: "term_p2ap_20150620_172818.fits",
3: "term_p3ap_20170809_183821.fits",
4: "term_p4ap_20180712_171928.fits",
5: "term_p5ap_20220709_180910.fits",
},
("c poly", "open"): {
("c_poly", "open"): {
2: "term_p2cp_20150620_190645.fits",
},
("open", "ti poly"): {
("open", "ti_poly"): {
1: "term_p1tp_20140515_182503.fits",
2: "term_p2tp_20150718_160921.fits",
},
Expand Down Expand Up @@ -206,9 +206,9 @@ def remove_lightleak(in_map, scale=1.0, leak_map=None):
warnings.warn("HISTORY indicates light leak subtraction already done on image.") # noqa: B028

if leak_map is None:
leak_filename = _select_lightleak_file(
*in_map.measurement.split("-"), in_map.date
)
fw1 = in_map.meta["EC_FW1_"]
fw2 = in_map.meta["EC_FW2_"]
leak_filename = _select_lightleak_file(fw1, fw2, in_map.date)

# NOTE: This function is being defined inline because the filename is only known once
# the date and filter wheel combination are known.
Expand Down

0 comments on commit e1a30a7

Please sign in to comment.