webbpsf_ext.coords.jwst_point

class webbpsf_ext.coords.jwst_point(ap_obs_name, ap_ref_name, ra_ref, dec_ref, pos_ang=0, base_offset=(0, 0), dith_offsets=[(0, 0)], exp_nums=None, base_std=None, dith_std=None, rand_seed=None, rand_seed_base=None)[source]

Bases: object

JWST Telescope Pointing information

Holds pointing coordinates and dither information for a given telescope visit.

Parameters
  • ap_obs_name (str) – Name of the observed instrument aperture.

  • ap_ref_name (str) – Name of the reference instrument aperture. Can be the same as observed, but not always.

  • ra_ref (float) – RA position (in deg) of the reference aperture.

  • dec_ref (float) – Dec position (in deg) of the reference aperture.

Keyword Arguments
  • pos_ang (float) – Position angle (positive angles East of North) in degrees.

  • exp_nums (ndarray or None) – Option to specify exposure numbers associated with each dither position. Useful fro Visit book-keeping. If not set, then will simply be a np.arange(self.ndith) + 1

  • base_offset (array-like) – Corresponds to (BaseX, BaseY) columns in .pointing file (arcsec).

  • dith_offset (array-like) – Corresponds to (DithX, DithY) columns in .pointing file (arcsec).

  • base_std (float or array-like or None) – The 1-sigma pointing uncertainty per axis for telescope slew. If None, then standard deviation is chosen to be either 5 mas or 100 mas, depending on use_ta attribute (default: True).

  • dith_std (float or array-like or None) – The 1-sigma pointing uncertainty per axis for dithers. If None, then standard deviation is chosen to be either 2.5 or 5 mas, depending on use_sgd attribute (default: True).

  • rand_seed (None or int) – Random seed to use for generating repeatable random offsets.

  • rand_seed_base (None or int) – Use a separate random seed for telescope slew offset. Then, rand_seed corresponds only to relative dithers. Useful for multiple exposures with same initial slew, but independent dither pattern realizations.

__init__(ap_obs_name, ap_ref_name, ra_ref, dec_ref, pos_ang=0, base_offset=(0, 0), dith_offsets=[(0, 0)], exp_nums=None, base_std=None, dith_std=None, rand_seed=None, rand_seed_base=None)[source]

Methods

__init__(ap_obs_name, ap_ref_name, ra_ref, ...)

ap_radec([idl_off, get_cenpos, get_vert, ...])

Aperture reference point(s) RA/Dec

attitude_matrix([idl_off, ap_siaf_ref, ...])

Return an attitutde correction matrix

gen_random_offsets([rand_seed, ...])

Generate randomized pointing offsets for each dither position

plot_inst_apertures([subarrays, fill])

Plot all apertures in this instrument's SIAF.

plot_main_apertures([fill])

Plot main SIAF telescope apertures.

plot_obs_aperture([fill])

Plot observed aperture

plot_ref_aperture([fill])

Plot reference aperture

radec_to_frame(coord_objs[, frame_out, ...])

RA/Dec to aperture coordinate frame

Attributes

base_std

Target pointing uncertainty (mas)

dith_std

Dither pointing uncertainty (mas)

exp_nums

Exposure Numbers associated with each dither position

ndith

Number of dither positions

ap_radec(idl_off=(0, 0), get_cenpos=True, get_vert=False, ap_siaf_obs=None, **kwargs)[source]

Aperture reference point(s) RA/Dec

Given the (RA, Dec) and position angle some reference aperture, return the (RA, Dec) associated with the reference point (usually center) of a different aperture. Can also return the corner vertices of the aperture.

Typically, the reference aperture (self.siaf_ap_ref) is used for the telescope pointing information (e.g., NRCALL), but you may want to determine locations of the individual detector apertures (NRCA1_FULL, NRCB3_FULL, etc).

Parameters
  • idl_off (list or tuple) – X/Y offset of overall aperture offset. Usually a combination of base_off + dith_off (both in idl coordinates)

  • get_cenpos (bool) – Return aperture reference location coordinates?

  • get_vert (bool) – Return closed polygon vertices (useful for plotting)?

  • ap_siaf_obs (pysiaf aperture) – Specify the aperture for which to obtain RA/Dec reference point. The default is self.siaf_ap_obs.

attitude_matrix(idl_off=(0, 0), ap_siaf_ref=None, coord_ref=None, **kwargs)[source]

Return an attitutde correction matrix

Parameters
  • idl_off (list or tuple) – X/Y offset of overall aperture offset. Usually a combination of base_off + dith_off (both in idl coordinates).

  • ap_siaf_ref (pysiaf aperture) – Aperture reference being offset (uses it’s V2/V3 ref/center coords). By default, uses self.siaf_ap_ref.

  • coord_ref (tuple) – RA/Dec (in deg) reference coordinate nominally placed at aperture’s reference location prior to dither offset. Default is (self.ra_ref, self.dec_ref).

property base_std

Target pointing uncertainty (mas)

property dith_std

Dither pointing uncertainty (mas)

property exp_nums

Exposure Numbers associated with each dither position

gen_random_offsets(rand_seed=None, rand_seed_base=None, first_dith_zero=True)[source]

Generate randomized pointing offsets for each dither position

property ndith

Number of dither positions

plot_inst_apertures(subarrays=False, fill=False, **kwargs)[source]

Plot all apertures in this instrument’s SIAF.

Other matplotlib standard parameters may be passed in via **kwargs to adjust the style of the displayed lines.

Parameters
  • names (list of strings) – A subset of aperture names, if you wish to plot only a subset

  • subarrays (bool) – Plot all the minor subarrays if True, else just plot the “main” apertures

  • label (bool) – Add text labels stating aperture names

  • units (str) – one of ‘arcsec’, ‘arcmin’, ‘deg’. Only set for ‘idl’ and ‘tel’ frames.

  • clear (bool) – Clear plot before plotting (set to false to overplot)

  • show_frame_origin (str or list) – Plot frame origin (goes to plot_frame_origin()): None, ‘all’, ‘det’, ‘sci’, ‘raw’, ‘idl’, or a list of these.

  • mark_ref (bool) – Add markers for the reference (V2Ref, V3Ref) point in each apertyre

  • frame (str) – Which coordinate system to plot in: ‘tel’, ‘idl’, ‘sci’, ‘det’

  • ax (matplotlib.Axes) – Desired destination axes to plot into (If None, current axes are inferred from pyplot.)

  • fill (bool) – Whether to color fill the aperture

  • fill_color (str) – Fill color

  • fill_alpha (float) – alpha parameter for filled aperture

  • color (matplotlib-compatible color) – Color specification for this aperture’s outline, passed through to matplotlib.Axes.plot

plot_main_apertures(fill=False, **kwargs)[source]

Plot main SIAF telescope apertures.

Other matplotlib standard parameters may be passed in via **kwargs to adjust the style of the displayed lines.

Parameters
  • darkbg (bool) – Plotting onto a dark background? Will make white outlines instead of black.

  • detector_channels (bool) – Overplot the detector amplifier channels for all apertures.

  • label (bool) – Add text labels stating aperture names

  • units (str) – one of ‘arcsec’, ‘arcmin’, ‘deg’.

  • show_frame_origin (str or list) – Plot frame origin (goes to plot_frame_origin()): None, ‘all’, ‘det’, ‘sci’, ‘raw’, ‘idl’, or a list of these.

  • mark_ref (bool) – Add markers for the reference (V2Ref, V3Ref) point in each apertyre

  • ax (matplotlib.Axes) – Desired destination axes to plot into (If None, current axes are inferred from pyplot.)

  • fill (bool) – Whether to color fill the aperture

  • fill_color (str) – Fill color

  • fill_alpha (float) – alpha parameter for filled aperture

  • color (matplotlib-compatible color) – Color specification for this aperture’s outline, passed through to matplotlib.Axes.plot

plot_obs_aperture(fill=False, **kwargs)[source]

Plot observed aperture

Parameters
  • names (list of strings) – A subset of aperture names, if you wish to plot only a subset

  • subarrays (bool) – Plot all the minor subarrays if True, else just plot the “main” apertures

  • label (bool) – Add text labels stating aperture names

  • units (str) – one of ‘arcsec’, ‘arcmin’, ‘deg’. Only set for ‘idl’ and ‘tel’ frames.

  • clear (bool) – Clear plot before plotting (set to false to overplot)

  • show_frame_origin (str or list) – Plot frame origin (goes to plot_frame_origin()): None, ‘all’, ‘det’, ‘sci’, ‘raw’, ‘idl’, or a list of these.

  • mark_ref (bool) – Add markers for the reference (V2Ref, V3Ref) point in each apertyre

  • frame (str) – Which coordinate system to plot in: ‘tel’, ‘idl’, ‘sci’, ‘det’, ‘sky’

  • ax (matplotlib.Axes) – Desired destination axes to plot into (If None, current axes are inferred from pyplot.)

  • fill (bool) – Whether to color fill the aperture

  • fill_color (str) – Fill color

  • fill_alpha (float) – alpha parameter for filled aperture

  • color (matplotlib-compatible color) – Color specification for this aperture’s outline, passed through to matplotlib.Axes.plot

plot_ref_aperture(fill=False, **kwargs)[source]

Plot reference aperture

Parameters
  • names (list of strings) – A subset of aperture names, if you wish to plot only a subset

  • subarrays (bool) – Plot all the minor subarrays if True, else just plot the “main” apertures

  • label (bool) – Add text labels stating aperture names

  • units (str) – one of ‘arcsec’, ‘arcmin’, ‘deg’. Only set for ‘idl’ and ‘tel’ frames.

  • clear (bool) – Clear plot before plotting (set to false to overplot)

  • show_frame_origin (str or list) – Plot frame origin (goes to plot_frame_origin()): None, ‘all’, ‘det’, ‘sci’, ‘raw’, ‘idl’, or a list of these.

  • mark_ref (bool) – Add markers for the reference (V2Ref, V3Ref) point in each apertyre

  • frame (str) – Which coordinate system to plot in: ‘tel’, ‘idl’, ‘sci’, ‘det’, ‘sky’.

  • ax (matplotlib.Axes) – Desired destination axes to plot into (If None, current axes are inferred from pyplot.)

  • fill (bool) – Whether to color fill the aperture

  • fill_color (str) – Fill color

  • fill_alpha (float) – alpha parameter for filled aperture

  • color (matplotlib-compatible color) – Color specification for this aperture’s outline, passed through to matplotlib.Axes.plot

radec_to_frame(coord_objs, frame_out='tel', idl_offsets=None)[source]

RA/Dec to aperture coordinate frame

Convert a series of RA/Dec positions to desired telescope SIAF coordinate frame within the observed aperture. Will return a list of SIAF coordinates for all objects at each position.

Parameters
  • coord_objs (tuple) – (RA, Dec) positions (deg), where RA and Dec are numpy arrays.

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

  • idl_offsets (None or list of 2-element array) – Option to specify custom offset locations. Normally this is set to None, and we return RA/Dec for all telescope point positions defined in self.position_offsets_act. However, we can specify offsets here (in ‘idl’) coordinates if you’re only interested in a single position or want a custom location.