From 219916851057ba1d6bb59b9d2b3fd1f5ac9abbf1 Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Sat, 2 Nov 2024 16:12:07 -0600 Subject: [PATCH 1/7] Bumpt `named-arrays` to 0.14.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3cda02a..26ef34a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ dependencies = [ "astropy", "requests", - "named-arrays==0.14.1", + "named-arrays==0.14.2", ] dynamic = ["version"] From 5afb91a521ea6b3fcd9bd69e5f08562b6bee4a5d Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Sat, 2 Nov 2024 16:38:45 -0600 Subject: [PATCH 2/7] fixes --- iris/sg/background/_background.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iris/sg/background/_background.py b/iris/sg/background/_background.py index 2a86dce..7efd8d2 100644 --- a/iris/sg/background/_background.py +++ b/iris/sg/background/_background.py @@ -73,10 +73,11 @@ def average( ) """ obs = obs.copy_shallow() + shape = obs.shape obs.inputs = na.TemporalSpectralPositionalVectorArray( time=obs.inputs.time.ndarray.jd.mean(), - wavelength=obs.inputs.wavelength.mean(axis), - position=obs.inputs.position.mean(axis), + wavelength=obs.inputs.wavelength.broadcast_to(shape).mean(axis), + position=obs.inputs.position.broadcast_to(shape).mean(axis), ) obs.outputs = np.nanmedian(obs.outputs, axis=axis) return obs From 853955e205c89e86a631ff501de26579f0b37c24 Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Sat, 2 Nov 2024 16:45:43 -0600 Subject: [PATCH 3/7] doc fixes --- docs/index.rst | 2 +- iris/sg/_spectrograph.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 49d445b..a9a1f59 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -61,7 +61,7 @@ and display as a false-color movie. # Take the mean of the wavelength over the spatial # and temporal axes since it is constant - wavelength = obs.inputs.wavelength.mean(axis_txy) + wavelength = obs.inputs.wavelength.mean(obs.axis_time) # Convert to Doppler velocity velocity = wavelength.to( diff --git a/iris/sg/_spectrograph.py b/iris/sg/_spectrograph.py index 34daaea..ed916c2 100644 --- a/iris/sg/_spectrograph.py +++ b/iris/sg/_spectrograph.py @@ -57,7 +57,7 @@ class SpectrographObservation( # red/green/blue channels rgb, colorbar = na.colorsynth.rgb_and_colorbar( spd=obs.outputs, - wavelength=obs.inputs.wavelength.mean(("detector_x", "detector_y")), + wavelength=obs.inputs.wavelength, axis=obs.axis_wavelength, spd_min=0 * u.DN, spd_max=np.nanpercentile( From aad918b30e6e1d3fab1701ce5c89f24282a33e38 Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Sat, 2 Nov 2024 17:51:46 -0600 Subject: [PATCH 4/7] more docfixes --- docs/index.rst | 7 ++----- iris/sg/_spectrograph.py | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index a9a1f59..706a82b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -92,9 +92,6 @@ and display as a false-color movie. wavelength_max=velocity_max, ) - # Isolate the angular position of each RGB point - position = obs.inputs.position.mean(obs.axis_wavelength) - # Display the result as an RGB movie with astropy.visualization.quantity_support(): fig, ax = plt.subplots( @@ -105,8 +102,8 @@ and display as a false-color movie. ) ani = na.plt.pcolormovie( obs.inputs.time, - position.x, - position.y, + obs.inputs.position.x, + obs.inputs.position.y, C=rgb, axis_time=obs.axis_time, axis_rgb=obs.axis_wavelength, diff --git a/iris/sg/_spectrograph.py b/iris/sg/_spectrograph.py index ed916c2..d07ad69 100644 --- a/iris/sg/_spectrograph.py +++ b/iris/sg/_spectrograph.py @@ -70,9 +70,6 @@ class SpectrographObservation( wavelength_max=wavelength_max, ) - # Isolate the angular position of each RGB point - position = obs.inputs.position.mean(obs.axis_wavelength) - # Isolate the first raster of the observation index = {obs.axis_time: 0} @@ -85,7 +82,7 @@ class SpectrographObservation( constrained_layout=True, ) na.plt.pcolormesh( - position[index], + obs.inputs.position[index], C=rgb[index], axis_rgb=obs.axis_wavelength, ax=ax[0], From 645cbd1ef474f561f0fdf21014d82b89a12011fd Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Sat, 2 Nov 2024 23:53:02 -0600 Subject: [PATCH 5/7] doc fixes --- iris/sg/_spectrograph.py | 2 +- iris/sg/background/_background.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iris/sg/_spectrograph.py b/iris/sg/_spectrograph.py index d07ad69..8f0ad72 100644 --- a/iris/sg/_spectrograph.py +++ b/iris/sg/_spectrograph.py @@ -57,7 +57,7 @@ class SpectrographObservation( # red/green/blue channels rgb, colorbar = na.colorsynth.rgb_and_colorbar( spd=obs.outputs, - wavelength=obs.inputs.wavelength, + wavelength=obs.inputs.wavelength.mean(obs.axis_time), axis=obs.axis_wavelength, spd_min=0 * u.DN, spd_max=np.nanpercentile( diff --git a/iris/sg/background/_background.py b/iris/sg/background/_background.py index 7efd8d2..41d34f1 100644 --- a/iris/sg/background/_background.py +++ b/iris/sg/background/_background.py @@ -741,8 +741,8 @@ def estimate( ) ax[0].set_title("original") na.plt.pcolormesh( - obs.inputs.position.x[index].mean(obs.axis_wavelength), - obs.inputs.position.y[index].mean(obs.axis_wavelength), + obs.inputs.position.x[index], + obs.inputs.position.y[index], C=np.nanmean(obs.outputs.value[index], axis=obs.axis_wavelength), ax=ax[0], norm=mappable.norm, @@ -750,8 +750,8 @@ def estimate( ) ax[1].set_title("corrected") na.plt.pcolormesh( - obs_nobg.inputs.position.x[index].mean(obs.axis_wavelength), - obs_nobg.inputs.position.y[index].mean(obs.axis_wavelength), + obs_nobg.inputs.position.x[index], + obs_nobg.inputs.position.y[index], C=np.nanmean(obs_nobg.outputs.value[index], axis=obs.axis_wavelength), ax=ax[1], norm=mappable.norm, From 61a7bdb06668478baab9b6023353386811607f01 Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Sun, 3 Nov 2024 00:03:38 -0600 Subject: [PATCH 6/7] more docfixes --- iris/sg/background/_background.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iris/sg/background/_background.py b/iris/sg/background/_background.py index 41d34f1..21c80e3 100644 --- a/iris/sg/background/_background.py +++ b/iris/sg/background/_background.py @@ -782,12 +782,12 @@ def estimate( with astropy.visualization.quantity_support(): fig, ax = plt.subplots() na.plt.plot( - obs.inputs.wavelength.mean(axis=axis_txy), + obs.inputs.wavelength.mean(obs.axis_time), np.nanmedian(obs.outputs, axis=axis_txy), label="original", ) na.plt.plot( - obs_nobg.inputs.wavelength.mean(axis=axis_txy), + obs_nobg.inputs.wavelength.mean(obs.axis_time), np.nanmedian(obs_nobg.outputs, axis=axis_txy), label="corrected", ) From e4ae41cc6d5c692ba07286b09c479efcd21d6119 Mon Sep 17 00:00:00 2001 From: Roy Smart Date: Sun, 3 Nov 2024 00:16:48 -0600 Subject: [PATCH 7/7] docfixes --- docs/index.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 706a82b..d835355 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -128,6 +128,14 @@ and display as a false-color movie. IPython.display.HTML(ani.to_jshtml()) +References +========== + +.. bibliography:: + +| + + Indices and tables ==================