Skip to content

stpsf.setup_sim_to_match_file yields an error on nirspec MSA data #143

Description

@eteq

I ran stpsf.setup_sim_to_match_file(fn) where fn is a fairly vanilla NIRSpec MSA data file. The result was the following:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/home/erik/tmp/stpsf/stpsf_src/stpsf/match_data.py", line 52, in setup_sim_to_match_file
    inst.set_position_from_aperture_name(header['APERNAME'])
  File "/var/home/erik/tmp/stpsf/stpsf_src/stpsf/stpsf_core.py", line 1135, in set_position_from_aperture_name
    self.detector_position = ref_in_sci
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/erik/tmp/stpsf/stpsf_src/stpsf/stpsf_core.py", line 326, in detector_position
    raise ValueError(
ValueError: The maximum allowed detector pixel coordinate value is (X,Y) = (2047, 2047)

While this of course depends on the data file, digging in with the debugger led me to the following snippet (which is not data file-dependent) being the root cause:

nrs = stpsf.NIRSpec()

aperture_name = 'NRS_FULL_MSA'
ap = nrs.siaf[aperture_name]
detname = aperture_name.split('_')[0]
ref_in_tel = ap.V2Ref, ap.V3Ref
nrs_full_aperture = nrs.siaf[nrs.detector + '_FULL']
ref_in_sci = nrs_full_aperture.tel_to_sci(*ref_in_tel)
nrs.detector_position = ref_in_sci

You'll note that seems to mean that any MSA observations will fail for setup_sim_to_match_file right now...

Metadata

Metadata

Assignees

No one assigned

    Labels

    JWSTAffects JWST models in STPSFbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions