Skip to content

Commit

Permalink
JP-3334 Commanded Guide Star postion telemetry is always relative to …
Browse files Browse the repository at this point in the history
…FGS1 (#7804)
  • Loading branch information
stscieisenhamer authored Aug 10, 2023
1 parent 9a85cc8 commit 177225e
Show file tree
Hide file tree
Showing 17 changed files with 159 additions and 154 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ residual_fringe
- Use scipy.interpolate.BSpline instead of astropy.modeling.Spline1D in
residual_fringe fitting utils [#7764]

set_telescope_pointing
----------------------

- Commanded Guide Star is always relative to FGS1 [#7804]

1.11.3 (2023-07-17)
===================
Expand Down
29 changes: 19 additions & 10 deletions jwst/lib/set_telescope_pointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ class Transforms:
m_eci2sifov: np.array = None
#: ECI to V
m_eci2v: np.array = None
#: FGS1 to FGSx transformation
m_fgs12fgsx: np.array = None
#: FGSX to Guide Stars transformation
m_fgsx2gs: np.array = None
#: FGS1 to SIFOV
m_fgs12sifov: np.array = None
#: Velocity aberration
Expand Down Expand Up @@ -2233,13 +2233,19 @@ def calc_v3pags(t_pars: TransformParameters):
-------
v3pags : float
The V3 Position Angle at the Guide Star, in degrees
Notes
-----
Modification for `jwst` release post-1.11.3: The commanded position of the guide
star is always relative to FGS1. Hence, the aperture to use for the SIAF
transformation is always FGS1.
"""

# Determine Guides Star estimated WCS information.
gs_wcs = calc_estimated_gs_wcs(t_pars)

# Retrieve the Ideal Y-angle for the desired FGS
fgs_siaf = t_pars.siaf_db.get_wcs(FGSId2Aper[t_pars.fgsid], useafter=t_pars.useafter)
# Retrieve the Ideal Y-angle for FGS1
fgs_siaf = t_pars.siaf_db.get_wcs(FGSId2Aper[1], useafter=t_pars.useafter)

# Calculate V3PAGS
v3pags = gs_wcs.pa - fgs_siaf.v3yangle
Expand Down Expand Up @@ -2279,34 +2285,37 @@ def calc_m_eci2gs(t_pars: TransformParameters):
M_eci_to_gs =
M_z_to_x *
M_gsics_to_gsappics *
M_fgsics_to_gsics *
M_fgs1ics_to_M_fgsics *
M_fgs1ics_to_gsics *
M_j_to_fgs1ics *
M_eci_to_j
where
M_eci_to_gs = ECI to Guide Star Ideal Frame
M_gsics_to_gsappics = Velocity Aberration correction
M_fgsics_to_gsics = Convert from the FGS ICS frame to Guide Star ICS frame
M_fgs1ics_to_fgsics = Convert from the FGS1 ICS frame to the in-use FGS ICS frame
M_fgs1ics_to_gsics = Convert from the FGS1 ICS frame to Guide Star ICS frame
M_j_to_fgs1ics = Convert from J frame to FGS1 ICS frame
M_eci_to_j = ECI (quaternion) to J-frame
Modification for `jwst` release post-1.11.3: The commanded position of the guide
star is always relative to FGS1. Hence, the aperture to use is always FGS1.
The formulae above have been modified appropriately.
However, in the code, note that the transformations go to FGS1, but then
is suddenly referred to thereafter as FGSX. The assumption to make is that X is always 1,
for FGS1.
"""

# Initial state of the transforms
t = Transforms(override=t_pars.override_transforms)

t.m_eci2j = calc_eci2j_matrix(t_pars.pointing.q)
t.m_j2fgs1 = calc_j2fgs1_matrix(t_pars.pointing.j2fgs_matrix, t_pars.j2fgs_transpose)
t.m_fgs12fgsx = calc_m_fgs12fgsx(t_pars.fgsid, t_pars.siaf_db)
t.m_fgsx2gs = calc_m_fgsx2gs(t_pars.pointing.gs_commanded)

# Apply the Velocity Aberration. To do so, the M_eci2gsics matrix must be created. This
# is used to calculate the aberration matrix.
# Also, since the aberration is to be removed, the velocity is negated.
m_eci2gsics = np.linalg.multi_dot([t.m_fgsx2gs, t.m_fgs12fgsx, t.m_j2fgs1, t.m_eci2j])
m_eci2gsics = np.linalg.multi_dot([t.m_fgsx2gs, t.m_j2fgs1, t.m_eci2j])
logger.debug('m_eci2gsics: %s', m_eci2gsics)
t.m_gs2gsapp = calc_gs2gsapp(m_eci2gsics, t_pars.jwst_velocity)

Expand Down
28 changes: 14 additions & 14 deletions jwst/lib/tests/data/add_wcs_with_mast_fgs2.fits

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions jwst/lib/tests/data/tforms_coarse_tr_202107.asdf
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ transforms:
- [-0.5518060482351074, 0.8193850752853762, 0.15530054167014012]
datatype: float64
shape: [3, 3]
m_fgs12fgsx: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
- [0.0, 1.0, 0.0]
- [0.0, 0.0, 1.0]
datatype: float64
shape: [3, 3]
m_gs2gsapp: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
Expand Down
14 changes: 7 additions & 7 deletions jwst/lib/tests/data/tforms_coarse_tr_202111.asdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.1.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 2.12.0}
name: asdf, version: 2.15.0}
history:
extensions:
- !core/extension_metadata-1.0.0
extension_class: asdf.extension.BuiltinExtension
software: !core/software-1.0.0 {name: asdf, version: 2.12.0}
software: !core/software-1.0.0 {name: asdf, version: 2.15.0}
transforms:
m_eci2fgs1: null
m_eci2gs: !core/ndarray-1.0.0
Expand Down Expand Up @@ -41,14 +41,14 @@ transforms:
- [-0.5519434818376673, 0.8193015723378767, 0.1552527009457648]
datatype: float64
shape: [3, 3]
m_fgs12fgsx: !core/ndarray-1.0.0
m_fgs12sifov: null
m_fgsx2gs: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
- [0.0, 1.0, 0.0]
- [0.0, 0.0, 1.0]
- [0.999999994103044, -4.30613613606694e-09, 0.00010859977892459698]
- [0.0, 0.9999999992138822, 3.965142632262306e-05]
- [-0.0001085997790099692, -3.965142608880034e-05, 0.9999999933169261]
datatype: float64
shape: [3, 3]
m_fgs12sifov: null
m_gs2gsapp: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
Expand Down
14 changes: 7 additions & 7 deletions jwst/lib/tests/data/tforms_coarse_tr_202111_any-1.asdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.1.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 2.12.0}
name: asdf, version: 2.15.0}
history:
extensions:
- !core/extension_metadata-1.0.0
extension_class: asdf.extension.BuiltinExtension
software: !core/software-1.0.0 {name: asdf, version: 2.12.0}
software: !core/software-1.0.0 {name: asdf, version: 2.15.0}
transforms:
m_eci2fgs1: null
m_eci2gs: !core/ndarray-1.0.0
Expand Down Expand Up @@ -41,14 +41,14 @@ transforms:
- [-0.5519434818376673, 0.8193015723378767, 0.1552527009457648]
datatype: float64
shape: [3, 3]
m_fgs12fgsx: !core/ndarray-1.0.0
m_fgs12sifov: null
m_fgsx2gs: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
- [0.0, 1.0, 0.0]
- [0.0, 0.0, 1.0]
- [0.999999994103044, -4.30613613606694e-09, 0.00010859977892459698]
- [0.0, 0.9999999992138822, 3.965142632262306e-05]
- [-0.0001085997790099692, -3.965142608880034e-05, 0.9999999933169261]
datatype: float64
shape: [3, 3]
m_fgs12sifov: null
m_gs2gsapp: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
Expand Down
32 changes: 16 additions & 16 deletions jwst/lib/tests/data/tforms_coarse_tr_202111_any-2.asdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.1.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 2.12.0}
name: asdf, version: 2.15.0}
history:
extensions:
- !core/extension_metadata-1.0.0
extension_class: asdf.extension.BuiltinExtension
software: !core/software-1.0.0 {name: asdf, version: 2.12.0}
software: !core/software-1.0.0 {name: asdf, version: 2.15.0}
transforms:
m_eci2fgs1: null
m_eci2gs: !core/ndarray-1.0.0
data:
- [-0.16012149057232664, -0.2908040237793363, 0.9432890514053922]
- [0.8207914404533206, 0.49161608192824224, 0.2908867226991892]
- [-0.5483271146423015, 0.8208207426009019, 0.15997111599758868]
- [-0.1593953868302445, -0.2903579259648071, 0.9435494114968239]
- [0.8059756222312516, 0.5136513245748495, 0.294220421847337]
- [-0.5700846534881251, 0.8073751515451433, 0.15214772206459828]
datatype: float64
shape: [3, 3]
m_eci2j: !core/ndarray-1.0.0
Expand All @@ -28,27 +28,27 @@ transforms:
shape: [3, 3]
m_eci2siaf: !core/ndarray-1.0.0
data:
- [-0.1601269863725518, -0.289801221963818, 0.9435966863108275]
- [-0.8126204209445734, -0.5039697566677751, -0.2926817051183823]
- [-0.5603637254637395, 0.8136521245920312, 0.15479919563646075]
- [-0.15942849151092672, -0.28935415824970223, 0.9438521248535333]
- [-0.7974814680282233, -0.5258018404798147, -0.2958982506456639]
- [-0.581898590273763, 0.799879140490781, 0.1469267490002397]
datatype: float64
shape: [3, 3]
m_eci2sifov: null
m_eci2v: !core/ndarray-1.0.0
data:
- [-0.16201716376125577, -0.28799646682953906, 0.9438265625161674]
- [0.8179907925032919, 0.4957852482668379, 0.29169864009870416]
- [-0.5519434818376673, 0.8193015723378767, 0.1552527009457648]
- [-0.1613654044637797, -0.2875969156954648, 0.944060022804711]
- [0.8030644717531688, 0.5177517995440696, 0.2949924935755193]
- [-0.573627723847564, 0.8057425965480279, 0.14741160053923583]
datatype: float64
shape: [3, 3]
m_fgs12fgsx: !core/ndarray-1.0.0
m_fgs12sifov: null
m_fgsx2gs: !core/ndarray-1.0.0
data:
- [0.9996419130561, -0.026744227336415103, 0.0008899245580707779]
- [0.026744226747233042, 0.999642309117531, 1.2564354962991238e-05]
- [-0.0008899422641357363, 1.124048833745535e-05, 0.9999996039381304]
- [0.999999994103044, -4.30613613606694e-09, 0.00010859977892459698]
- [0.0, 0.9999999992138822, 3.965142632262306e-05]
- [-0.0001085997790099692, -3.965142608880034e-05, 0.9999999933169261]
datatype: float64
shape: [3, 3]
m_fgs12sifov: null
m_gs2gsapp: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
Expand Down
14 changes: 7 additions & 7 deletions jwst/lib/tests/data/tforms_coarse_tr_202111_any-None.asdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.1.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 2.12.0}
name: asdf, version: 2.15.0}
history:
extensions:
- !core/extension_metadata-1.0.0
extension_class: asdf.extension.BuiltinExtension
software: !core/software-1.0.0 {name: asdf, version: 2.12.0}
software: !core/software-1.0.0 {name: asdf, version: 2.15.0}
transforms:
m_eci2fgs1: null
m_eci2gs: !core/ndarray-1.0.0
Expand Down Expand Up @@ -41,14 +41,14 @@ transforms:
- [-0.5519434818376673, 0.8193015723378767, 0.1552527009457648]
datatype: float64
shape: [3, 3]
m_fgs12fgsx: !core/ndarray-1.0.0
m_fgs12sifov: null
m_fgsx2gs: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
- [0.0, 1.0, 0.0]
- [0.0, 0.0, 1.0]
- [0.999999994103044, -4.30613613606694e-09, 0.00010859977892459698]
- [0.0, 0.9999999992138822, 3.965142632262306e-05]
- [-0.0001085997790099692, -3.965142608880034e-05, 0.9999999933169261]
datatype: float64
shape: [3, 3]
m_fgs12sifov: null
m_gs2gsapp: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
Expand Down
32 changes: 16 additions & 16 deletions jwst/lib/tests/data/tforms_coarse_tr_202111_guider1-1.asdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.1.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 2.12.0}
name: asdf, version: 2.15.0}
history:
extensions:
- !core/extension_metadata-1.0.0
extension_class: asdf.extension.BuiltinExtension
software: !core/software-1.0.0 {name: asdf, version: 2.12.0}
software: !core/software-1.0.0 {name: asdf, version: 2.15.0}
transforms:
m_eci2fgs1: null
m_eci2gs: !core/ndarray-1.0.0
data:
- [-0.16012149057232664, -0.2908040237793363, 0.9432890514053922]
- [0.8207914404533206, 0.49161608192824224, 0.2908867226991892]
- [-0.5483271146423015, 0.8208207426009019, 0.15997111599758868]
- [-0.1593953868302445, -0.2903579259648071, 0.9435494114968239]
- [0.8059756222312516, 0.5136513245748495, 0.294220421847337]
- [-0.5700846534881251, 0.8073751515451433, 0.15214772206459828]
datatype: float64
shape: [3, 3]
m_eci2j: !core/ndarray-1.0.0
Expand All @@ -28,27 +28,27 @@ transforms:
shape: [3, 3]
m_eci2siaf: !core/ndarray-1.0.0
data:
- [-0.1601269863725518, -0.289801221963818, 0.9435966863108275]
- [-0.8126204209445734, -0.5039697566677751, -0.2926817051183823]
- [-0.5603637254637395, 0.8136521245920312, 0.15479919563646075]
- [-0.15942849151092672, -0.28935415824970223, 0.9438521248535333]
- [-0.7974814680282233, -0.5258018404798147, -0.2958982506456639]
- [-0.581898590273763, 0.799879140490781, 0.1469267490002397]
datatype: float64
shape: [3, 3]
m_eci2sifov: null
m_eci2v: !core/ndarray-1.0.0
data:
- [-0.16201716376125577, -0.28799646682953906, 0.9438265625161674]
- [0.8179907925032919, 0.4957852482668379, 0.29169864009870416]
- [-0.5519434818376673, 0.8193015723378767, 0.1552527009457648]
- [-0.1613654044637797, -0.2875969156954648, 0.944060022804711]
- [0.8030644717531688, 0.5177517995440696, 0.2949924935755193]
- [-0.573627723847564, 0.8057425965480279, 0.14741160053923583]
datatype: float64
shape: [3, 3]
m_fgs12fgsx: !core/ndarray-1.0.0
m_fgs12sifov: null
m_fgsx2gs: !core/ndarray-1.0.0
data:
- [0.9996419130561, -0.026744227336415103, 0.0008899245580707779]
- [0.026744226747233042, 0.999642309117531, 1.2564354962991238e-05]
- [-0.0008899422641357363, 1.124048833745535e-05, 0.9999996039381304]
- [0.999999994103044, -4.30613613606694e-09, 0.00010859977892459698]
- [0.0, 0.9999999992138822, 3.965142632262306e-05]
- [-0.0001085997790099692, -3.965142608880034e-05, 0.9999999933169261]
datatype: float64
shape: [3, 3]
m_fgs12sifov: null
m_gs2gsapp: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
Expand Down
32 changes: 16 additions & 16 deletions jwst/lib/tests/data/tforms_coarse_tr_202111_guider1-2.asdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.1.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 2.12.0}
name: asdf, version: 2.15.0}
history:
extensions:
- !core/extension_metadata-1.0.0
extension_class: asdf.extension.BuiltinExtension
software: !core/software-1.0.0 {name: asdf, version: 2.12.0}
software: !core/software-1.0.0 {name: asdf, version: 2.15.0}
transforms:
m_eci2fgs1: null
m_eci2gs: !core/ndarray-1.0.0
data:
- [-0.16012149057232664, -0.2908040237793363, 0.9432890514053922]
- [0.8207914404533206, 0.49161608192824224, 0.2908867226991892]
- [-0.5483271146423015, 0.8208207426009019, 0.15997111599758868]
- [-0.1593953868302445, -0.2903579259648071, 0.9435494114968239]
- [0.8059756222312516, 0.5136513245748495, 0.294220421847337]
- [-0.5700846534881251, 0.8073751515451433, 0.15214772206459828]
datatype: float64
shape: [3, 3]
m_eci2j: !core/ndarray-1.0.0
Expand All @@ -28,27 +28,27 @@ transforms:
shape: [3, 3]
m_eci2siaf: !core/ndarray-1.0.0
data:
- [-0.1601269863725518, -0.289801221963818, 0.9435966863108275]
- [-0.8126204209445734, -0.5039697566677751, -0.2926817051183823]
- [-0.5603637254637395, 0.8136521245920312, 0.15479919563646075]
- [-0.15942849151092672, -0.28935415824970223, 0.9438521248535333]
- [-0.7974814680282233, -0.5258018404798147, -0.2958982506456639]
- [-0.581898590273763, 0.799879140490781, 0.1469267490002397]
datatype: float64
shape: [3, 3]
m_eci2sifov: null
m_eci2v: !core/ndarray-1.0.0
data:
- [-0.16201716376125577, -0.28799646682953906, 0.9438265625161674]
- [0.8179907925032919, 0.4957852482668379, 0.29169864009870416]
- [-0.5519434818376673, 0.8193015723378767, 0.1552527009457648]
- [-0.1613654044637797, -0.2875969156954648, 0.944060022804711]
- [0.8030644717531688, 0.5177517995440696, 0.2949924935755193]
- [-0.573627723847564, 0.8057425965480279, 0.14741160053923583]
datatype: float64
shape: [3, 3]
m_fgs12fgsx: !core/ndarray-1.0.0
m_fgs12sifov: null
m_fgsx2gs: !core/ndarray-1.0.0
data:
- [0.9996419130561, -0.026744227336415103, 0.0008899245580707779]
- [0.026744226747233042, 0.999642309117531, 1.2564354962991238e-05]
- [-0.0008899422641357363, 1.124048833745535e-05, 0.9999996039381304]
- [0.999999994103044, -4.30613613606694e-09, 0.00010859977892459698]
- [0.0, 0.9999999992138822, 3.965142632262306e-05]
- [-0.0001085997790099692, -3.965142608880034e-05, 0.9999999933169261]
datatype: float64
shape: [3, 3]
m_fgs12sifov: null
m_gs2gsapp: !core/ndarray-1.0.0
data:
- [1.0, 0.0, 0.0]
Expand Down
Loading

0 comments on commit 177225e

Please sign in to comment.