webbpsf_ext.coords.convert_to_sky

webbpsf_ext.coords.convert_to_sky(coords, siaf_obs_name, radec_ref, pa_v3, frame_in='sci')[source]

Convert coordinates to RA/Dec

Parameters:
  • coord_objs (tuple) – (xvals, yvals) positions, where xvals and yvals can be numpy arrays or single values.

  • siaf_obs_name (str) – Observed SIAF aperture name (e.g., ‘NRCA1_FULL’).

  • radec_ref (tuple) – RA and Dec corresponding to aperture’s reference point.

  • pa_v3 (float) – Position angle in degrees measured from North to V3 axis in North to East direction.

  • frame_in (str) – One of ‘tel’ (arcsec), ‘idl’ (arcsec), ‘sci’ (pixels), or ‘det’ (pixels).

Returns:

RA and Dec arrays.

Example

>>> hdul = fits.open(file)
pheader = hdul[0].header
fheader = hdul[1].header
hdul.close

# Get SIAF info siaf = pysiaf.Siaf(‘NIRCam’) siaf_obs_name = pheader.get(‘APERNAME’)

# V3 PA pa_v3 = fheader.get(‘V3I_YANG’) # RA/Dec located at aperture reference position ra_ref = fheader.get(‘RA_REF’) dec_ref = fheader.get(‘DEC_REF’)

coords_sci = np.random.random_sample(size=(2,100)) * 2040 + 4 ra, dec = convert_to_sky(coords_sci, siaf_obs_name, (ra_ref, dec_ref), pa_v3)