From d22e0f16045facf0a4ab5907017093bd4aaebac8 Mon Sep 17 00:00:00 2001 From: Shane Maloney Date: Tue, 16 Jul 2024 16:44:45 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20bug=20which=20was=20reintroduced=20by=20p?= =?UTF-8?q?revious=20fix=20=F0=9F=A4=A6=20(#137)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix bug which was reintroduced by previous fix 🤦 * Fix codespell and add change log --- changelog/137.bugfix.rst | 1 + setup.cfg | 3 ++- stixpy/calibration/visibility.py | 2 +- stixpy/imaging/em.py | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelog/137.bugfix.rst diff --git a/changelog/137.bugfix.rst b/changelog/137.bugfix.rst new file mode 100644 index 0000000..4fc7177 --- /dev/null +++ b/changelog/137.bugfix.rst @@ -0,0 +1 @@ +Fix bug reintroduce by last fix in `~stixpy.imaging.em.em`, update code in `~stixpy.calibration.visibility.calibrate_visibility` and imaging demo to use Tx, Ty rather than Ty, Tx as before. diff --git a/setup.cfg b/setup.cfg index d363229..6e15ed8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -95,7 +95,8 @@ ignore-words-list = precessed, process, livetime, - technik + technik, + thirdparty [coverage:run] omit = diff --git a/stixpy/calibration/visibility.py b/stixpy/calibration/visibility.py index 72431ed..f1f7877 100644 --- a/stixpy/calibration/visibility.py +++ b/stixpy/calibration/visibility.py @@ -405,7 +405,7 @@ def calibrate_visibility(vis: Visibilities, flare_location: SkyCoord = STIXImagi solo_coord = HeliographicStonyhurst(solo_heeq, representation_type="cartesian", obstime=tr.center) flare_location = flare_location.transform_to(STIXImaging(obstime=tr.center, observer=solo_coord)) - phase_mapcenter_corr = -2 * np.pi * (flare_location.Ty * vis.u + flare_location.Tx * vis.v) * u.rad + phase_mapcenter_corr = -2 * np.pi * (flare_location.Tx * vis.u + flare_location.Ty * vis.v) * u.rad ovis = vis.visibilities[:] ovis_real = np.real(ovis) diff --git a/stixpy/imaging/em.py b/stixpy/imaging/em.py index ece39ed..3d5917f 100644 --- a/stixpy/imaging/em.py +++ b/stixpy/imaging/em.py @@ -144,7 +144,7 @@ def em( solo_coord = HeliographicStonyhurst(solo_heeq, representation_type="cartesian", obstime=tr.center) flare_location = flare_location.transform_to(STIXImaging(obstime=tr.center, observer=solo_coord)) - flare_xy = np.array([flare_location.Ty.value, flare_location.Tx.value]) * apu.arcsec + flare_xy = np.array([flare_location.Tx.value, flare_location.Ty.value]) * apu.arcsec H = get_transmission_matrix(vis.u[ii], vis.v[ii], shape=shape, pixel_size=pixel_size, center=flare_xy, pixel_sum=1) y = countrates[idx, ...] @@ -184,4 +184,4 @@ def em( m, n = shape.to_value("pix").astype(int) # Note the order keyword here to match `y.flatten(order='F')` above at line 108 x_im = x.reshape(m, n, order="F") - return x_im + return x_im.T