191 """Construct an IntrinsicZernikes from dictionary of properties.
196 Dictionary of properties.
200 calib : `lsst.ip.isr.IntrinsicZernikes`
201 Constructed calibration.
206 Raised if the supplied dictionary is for a different
211 if calib._OBSTYPE != dictionary[
"metadata"][
"OBSTYPE"]:
213 f
"Incorrect intrinsic zernikes supplied. "
214 f
"Expected {calib._OBSTYPE}, found {dictionary['metadata']['OBSTYPE']}"
217 calib.setMetadata(dictionary[
"metadata"])
221 calib.field_x = np.array(dictionary[
"field_x"])
222 calib.field_y = np.array(dictionary[
"field_y"])
223 calib.values = np.array(dictionary[
"values"])
224 calib.field_x_ocs = np.array(dictionary.get(
"field_x_ocs", []))
225 calib.field_y_ocs = np.array(dictionary.get(
"field_y_ocs", []))
226 calib.values_ocs = np.array(dictionary.get(
"values_ocs", []))
227 calib.noll_indices = np.array(dictionary[
"noll_indices"])
229 calib.field_x, calib.field_y, calib.values
232 calib.field_x_ocs, calib.field_y_ocs, calib.values_ocs
235 calib.updateMetadata()
354 self, field_x, field_y, rotTelPos=0.0, noll_indices=None
357 Get the intrinsic Zernike coefficients at a given field position.
359 The returned coefficients are the sum of the CCS contribution
360 (heights_ccs), interpolated at the requested field position,
361 and the OCS contribution (measured_intrinsics),
362 interpolated at the field position rotated by
363 ``rotTelPos``. For calibrations that only store one
364 coordinate system (e.g. version 1 files, which only carry CCS),
365 the missing OCS contribution is simply omitted from the sum.
369 field_x : `array-like`
370 x-field positions in degrees (CCS).
371 field_y : `array-like`
372 y-field positions in degrees (CCS).
373 rotTelPos : `float`, optional
374 Rotation angle in degrees applied to the query point before
375 interpolating the OCS contribution. Defaults to 0.
376 noll_indices : `list` [`int`], optional
377 List of Noll indices to return. If None, return all.
381 zernikes : `array-like`
382 Array of Zernike coefficient values in microns corresponding to the
383 requested Noll indices and field positions.
385 if noll_indices
is None:
390 noll_indices = np.array(noll_indices)
393 field_x = np.asarray(field_x)
394 field_y = np.asarray(field_y)
396 point = np.array([field_x, field_y]).T
401 theta = np.deg2rad(rotTelPos)
402 cos_a, sin_a = np.cos(theta), np.sin(theta)
403 x_ocs = cos_a * field_x - sin_a * field_y
404 y_ocs = sin_a * field_x + cos_a * field_y
405 point_ocs = np.array([x_ocs, y_ocs]).T
411 return total[..., noll_mask]