Closed stscijgbot-jp closed 3 years ago
Comment by James Davies on JIRA:
Looks like the dataset doesn't have the V3I_YANG keyword set. Is the SIAF for this subarray empty for this?
Comment by Tyler Pauly on JIRA:
James Davies It looks like the only keywords populated in the WCS parameters are:
V2_REF = -146.05066 / [arcsec] Telescope v2 coordinate of the referen
V3_REF = -432.206071 / [arcsec] Telescope v3 coordinate of the referen
RA_REF = 0.0 / [deg] Right ascension of the reference point
DEC_REF = 0.0 / [deg] Declination of the reference point
ROLL_REF= 0.0 / [deg] V3 roll angle at the ref point (N over E)
VELOSYS = 5160.29 / [m/s] Radial velocity wrt Barycenter
V3I_YANG is not present.
So yeah, I suspect this is an upstream bug in the creation of the _uncal file. So either a SIAF or database problem.
V3I_YANG is absolutely necessary in all exposures that need WCS, as it describes the orientation of the specified aperture relative to the telescope's V3 axis in the focal plane.
Our set_telescope_pointing
script should raise an error if this is not found in the data
Definitely odd in that V2_REF and V3_REF are populated, which also come from the SIAF. I would expect that either all SIAF values would be available for a given APERNAME or none of them - not some. Check the SIAF entry for that instrument and APERNAME. I note that the pointing values are all zero too - could indicate that set_telescope_pointing could not complete the calculation, perhaps due to missing SIAF values.
Comment by Jonathan Eisenhamer on JIRA:
It is an error occurring in set_telescope_pointing
. The SDP log is attached, but it is reproducible with the command
set_telescope_pointing.py jw00636019001_04101_00001_nrs1_uncal.fits
producing the error found below. There is a schema mismatch somewhere.
2021-06-04 10:08:02,243 - stpipe - INFO - ------Setting pointing for jw00636019001_04101_00001_nrs1_uncal.fits 2021-06-04 10:08:02,243 - stpipe - INFO - ------Setting pointing for jw00636019001_04101_00001_nrs1_uncal.fits Updating WCS info for file jw00636019001_04101_00001_nrs1_uncal.fits 2021-06-04 10:08:02,243 - stpipe - INFO - Updating WCS info for file jw00636019001_04101_00001_nrs1_uncal.fits Cannot determine pointing information: Column names don't match schema. Schema has {'mt_z_helio', 'moving_target_x', 'moving_target_y', 'moving_target_ra', 'mt_jwst_distance', 'mt_y_jwst', 'mt_x_jwst', 'mt_z_jwst', 'mt_y_helio', 'mt_x_helio', 'moving_target_dec', 'mt_sun_distance', 'phase_angle'}. Data has {'mt_apparent_dec', 'mt_apparent_sun_distance', 'mt_apparent_x_jwst', 'mt_true_x_jwst', 'mt_apparent_jwst_distance', 'mt_detector_x', 'mt_true_x_helio', 'mt_true_y_helio', 'mt_true_z_helio', 'mt_true_y_jwst', 'mt_apparent_ra', 'mt_apparent_y_jwst', 'mt_apparent_y_helio', 'mt_apparent_x_helio', 'mt_apparent_z_helio', 'mt_true_z_jwst', 'apparent_phase_angle', 'mt_detector_y', 'mt_apparent_z_jwst', 'apparent_light_travel_time'} 2021-06-04 10:08:02,826 - stpipe - INFO - Cannot determine pointing information: Column names don't match schema. Schema has {'mt_z_helio', 'moving_target_x', 'moving_target_y', 'moving_target_ra', 'mt_jwst_distance', 'mt_y_jwst', 'mt_x_jwst', 'mt_z_jwst', 'mt_y_helio', 'mt_x_helio', 'moving_target_dec', 'mt_sun_distance', 'phase_angle'}. Data has {'mt_apparent_dec', 'mt_apparent_sun_distance', 'mt_apparent_x_jwst', 'mt_true_x_jwst', 'mt_apparent_jwst_distance', 'mt_detector_x', 'mt_true_x_helio', 'mt_true_y_helio', 'mt_true_z_helio', 'mt_true_y_jwst', 'mt_apparent_ra', 'mt_apparent_y_jwst', 'mt_apparent_y_helio', 'mt_apparent_x_helio', 'mt_apparent_z_helio', 'mt_true_z_jwst', 'apparent_phase_angle', 'mt_detector_y', 'mt_apparent_z_jwst', 'apparent_light_travel_time'}
Comment by Jonathan Eisenhamer on JIRA:
Issue has been found. The moving target schema are not covered by the schema_editor
because there is no link to the schema from the top level schema. There will be an issue filed for that.
In the meantime, resolution of this issue will be to update the datamodel schema for moving target.
This is likely due to recent SDP updates to the MT position table columns that did not get corresponding updates in our datamodels schema for that table. It should be an easy schema update.
Comment by James Davies on JIRA:
We need to update the script in scripts/set_telescope_pointing.py
to not consume the traceback. From the SDP log, it's not clear where the "Column names don't match schema." error message is even coming from, because the traceback has been erased in the exception handler in the script. We need the full traceback.
Comment by James Davies on JIRA:
Here's the traceback. It's happening when the file is being loaded as a Level1bModel
.
Traceback (most recent call last):
File "/home/jdavies/miniconda3/envs/jwst/bin/set_telescope_pointing.py", line 7, in <module>
exec(compile(f.read(), __file__, 'exec'))
File "/home/jdavies/dev/jwst/scripts/set_telescope_pointing.py", line 97, in <module>
add_wcs(
File "/home/jdavies/dev/jwst/jwst/lib/set_telescope_pointing.py", line 190, in add_wcs
with Level1bModel(filename) as model:
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/model_base.py", line 232, in __init__
asdffile = fits_support.from_fits(
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/fits_support.py", line 590, in from_fits
known_keywords, known_datas = _load_from_schema(
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/fits_support.py", line 511, in _load_from_schema
mschema.walk_schema(schema, callback)
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/schema.py", line 149, in walk_schema
recurse(schema, [], None, ctx)
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/schema.py", line 137, in recurse
recurse(val, path + [key], combiner, ctx)
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/schema.py", line 124, in recurse
if callback(schema, path, combiner, ctx, recurse):
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/fits_support.py", line 489, in callback
result = _fits_array_loader(
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/fits_support.py", line 441, in _fits_array_loader
return from_fits_hdu(hdu, schema)
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/fits_support.py", line 628, in from_fits_hdu
data = properties._cast(data, schema)
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/properties.py", line 83, in _cast
val = util.gentle_asarray(val, dtype)
File "/home/jdavies/miniconda3/envs/jwst/lib/python3.8/site-packages/stdatamodels/util.py", line 69, in gentle_asarray
raise ValueError(
ValueError: Column names don't match schema. Schema has {'mt_z_jwst', 'phase_angle', 'mt_z_helio', 'mt_jwst_distance', 'moving_target_ra', 'mt_x_helio', 'mt_y_helio', 'moving_target_y', 'moving_target_dec', 'mt_y_jwst', 'mt_x_jwst', 'moving_target_x', 'mt_sun_distance'}. Data has {'mt_apparent_y_helio', 'apparent_phase_angle', 'mt_apparent_y_jwst', 'mt_apparent_x_jwst', 'mt_true_z_jwst', 'apparent_light_travel_time', 'mt_true_z_helio', 'mt_apparent_z_jwst', 'mt_detector_x', 'mt_apparent_x_helio', 'mt_true_y_helio', 'mt_apparent_z_helio', 'mt_apparent_sun_distance', 'mt_true_x_helio', 'mt_true_x_jwst', 'mt_apparent_ra', 'mt_apparent_jwst_distance', 'mt_apparent_dec', 'mt_detector_y', 'mt_true_y_jwst'}
Comment by James Davies on JIRA:
Finally, we should probably not be allowing exceptions on this error in the the pointing script if the file is not valid (relative to our schemas), it should fail at the beginning. It just so happens that it fails on ValueError
in schema validation, probably a different ValueError
than what we were intending to handle in the set_telescope_pointing.py
script.
Comment by Howard Bushouse on JIRA:
Fixed in #6129
Issue JP-2125 was created on JIRA by Tyler Pauly:
During a spec2 run of an NRSFSS association, an error is reported in the wavecorr step:
May or not be relevant: exposure has SUBARRAY = SUBS200A2.