Skip to content

Commit

Permalink
Store v2/v3 in arcsec. (#83)
Browse files Browse the repository at this point in the history
* Store v2/v3 in arcsec.
* Add comment with units.
  • Loading branch information
schlafly authored Oct 5, 2023
1 parent b5c6cc6 commit 8f19b60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion romanisim/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
ipc_kernel /= np.sum(ipc_kernel)

# V2/V3 coordinates of "center" of WFI array (convention)
v2v3_wficen = (1546.3846181707652, -892.7916365721071)
v2v3_wficen = (1546.3846181707652, -892.7916365721071) # arcsec

# persistence parameter dictionary
# delete persistence records fainter than 0.01 electron / s
Expand Down
13 changes: 4 additions & 9 deletions romanisim/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ def fill_in_parameters(parameters, coord, roll_ref=0, boresight=True):
parameters['wcsinfo']['v3_ref'] = 0
else:
from .parameters import v2v3_wficen
v2_ref = v2v3_wficen[0] / 3600
v3_ref = v2v3_wficen[1] / 3600
parameters['wcsinfo']['v2_ref'] = v2_ref
parameters['wcsinfo']['v3_ref'] = v3_ref
parameters['wcsinfo']['v2_ref'] = v2v3_wficen[0]
parameters['wcsinfo']['v3_ref'] = v2v3_wficen[1]
parameters['wcsinfo']['roll_ref'] = (
parameters['wcsinfo'].get('roll_ref', 0) + 60)

Expand Down Expand Up @@ -205,12 +203,9 @@ def make_wcs(targ_pos,
ra_ref = targ_pos.ra.to(u.deg).value
dec_ref = targ_pos.dec.to(u.deg).value

# full transformation from romancal.assign_wcs.pointing
# angles = np.array([v2_ref, -v3_ref, roll_ref, dec_ref, -ra_ref])
# axes = "zyxyz"
# rot = RotationSequence3D(angles, axes_order=axes)
# v2_ref, v3_ref are in arcsec, but RotationSequence3D wants degrees.
rot = models.RotationSequence3D(
[v2_ref, -v3_ref, roll_ref, dec_ref, -ra_ref], 'zyxyz')
[v2_ref / 3600, -v3_ref / 3600, roll_ref, dec_ref, -ra_ref], 'zyxyz')

# distortion takes pixels to V2V3
# V2V3 are in arcseconds, while SphericalToCartesian expects degrees.
Expand Down

0 comments on commit 8f19b60

Please sign in to comment.