producer.plan module

Construct a set of observations by assigning fibers to targetsAllocate apertures to targets.

Contains code originally written by 2021 Akamai intern, Brittany Ann Ramos.

producer.plan.configure_observations(objx, objy, aptype, mode=None, max_nobs=None)[source]

Construct a series of observations to observe a set of targets with a fixed field center.

Parameters
  • objx (numpy.ndarray) – Cartesian x coordinate in tangent plane projection of object coordinates relative to the pointing center. Shape must be 1D and match objy.

  • objy (numpy.ndarray) – Cartesian y coordinate in tangent plane projection of object coordinates relative to the pointing center. Shape must be 1D and match objx.

  • aptype (int, numpy.ndarray) – The aperture type for each object. Can provide a single integer for all targets or an aperture type for each object. The aperture type must be 0 for a single-fiber aperture or 1 for a 37-fiber IFU.

  • mode (int, array-like, optional) – The mode assignment for each spectrograph. Can be 0 to turn off all apertures for a given spectrograph, but otherwise must be 1 for the single-fiber apertures, 2 for multi-IFU mode, or 3 for monolithic IFU mode. If a single integer, all spectrographs are put in the same mode; otherwise must provide the mode for each of the 3 spectrographs separately.

  • max_nobs (int, optional) – Impose a maximum number of observations to configure. If None, observations will be configured until no more objects are within the field of view.

Returns

stuff

producer.plan.empty_configuration_table(nrows=None, objidlen=20)[source]

Construct an empty FOBOS configuration table.

Parameters

nrows (int, optional) – Number of table rows. If None, initialized to 0.

Returns

Empty configuration table.

Return type

astropy.table.Table

producer.plan.parse_configuration(config_file, parse_source=False)[source]

Parse the FOBOS configuration from a configuration file.

Parameters
  • config_file (str) – Name of the configuration file.

  • parse_source (bool, optional) – If possible given the data within the configuration, re-read and return the full target list from the target source file, instead of only those with allocated apertures.

Returns

  • objid (numpy.ndarray) – 1d array with the target ID numbers

  • ra (numpy.ndarray) – Target right ascension in decimal degrees

  • dec (numpy.ndarray) – Target declination in decimal degrees

  • center (tuple) – Two-tuple with the coordinates of the pointing center

  • assigned_obj (numpy.ndarray) – Integer array with the array index in, e.g., objid with the target that has been assigned a FOBOS aperture.

  • ap (FOBOSApertures) – Aperture deployment instance.

  • assigned_ap (numpy.ndarray) – Integer array with the indices of the apertures in ap that have been assigned to a target.

producer.plan.report_configurations(n_in_fov, obs_obj, obs_nap, obs_ap, obs_mode)[source]

Construct a report of the observation configurations.

producer.plan.write_configurations(root, ra, dec, center, obs_obj, obs_ap, obs_mode, objid=None, path=None, ndig=None, tight=False, target_file=None, ra_c=None, dec_c=None)[source]

Write a set of configuration files for each FOBOS observation.

Parameters
  • root (str) – The root name for all output files.

  • ra (numpy.ndarray) – Right ascension coordinates for all considered objects.

  • dec (numpy.ndarray) – Declination coordinates for all considered objects. Shape must match ra.

  • center (tuple) – RA and DEC coordinates for the FOBOS pointing center.

  • obs_obj (list) – List of numpy.ndarray objects identifying the indices of the objects observed from the provided list of coordinates. The number of items in the list sets the number of revisits to the same pointing. This is the same as the second object returned by configure_observations().

  • obs_ap (list) – List of numpy.ndarray objects identifying the indices of the FOBOS apertures used for each object observed. List length must match obs_obj. This is the same as the fourth object returned by configure_observations(). The aperture indices must match indices when instantiating a FOBOSApertures object in the specified mode (obs_mode).

  • obs_mode (list) – List of numpy.ndarray objects identifying the FOBOS mode; see FOBOSApertures. List length must match obs_obj. This is the same as the last object returned by configure_observations().

  • objid (numpy.ndarray, optional) – An array with identifiers for each object. Each array element must convert directly to a string. Uniqueness is not checked. Shape must match ra. If None, just set to the 0-indexed array index.

  • path (str, optional) – Root path for all output files. If None, either set to the parent path provided by root or set to the current directory.

  • ndig (int, optional) – Number of digits to use for the observation number in the output file names. If None, this is set by the number of configurations to write. E.g., 9 observations or less yield ndig=1, 10-99 observations yield ndig=2, etc.

  • tight (bool, optional) – Output the configuration in “tight” format, where unallocated apertures are not included.

  • target_file (str, optional) – Name of the file with the original targets. If provided, will be included in header of output configuration files.

  • ra_c (int, optional) – 1-indexed column number with the RA coordinates in target_file. Ignored if target_file is None.

  • dec_c (int, optional) – 1-indexed column number with the DEC coordinates in target_file. Ignored if target_file is None.