Skip to content

Commit

Permalink
Fix bug which was reintroduced by previous fix 🤦 (#137)
Browse files Browse the repository at this point in the history
* Fix bug which was reintroduced by previous fix 🤦

* Fix codespell and add change log
  • Loading branch information
samaloney authored Jul 16, 2024
1 parent 2e9bc85 commit d22e0f1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/137.bugfix.rst
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ ignore-words-list =
precessed,
process,
livetime,
technik
technik,
thirdparty

[coverage:run]
omit =
Expand Down
2 changes: 1 addition & 1 deletion stixpy/calibration/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions stixpy/imaging/em.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...]
Expand Down Expand Up @@ -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

0 comments on commit d22e0f1

Please sign in to comment.