pynrc.simul.apt.AptInput

class pynrc.simul.apt.AptInput(input_xml=None, pointing_file=None, output_dir=None, output_csv=None, observation_list_file=None)[source]

Bases: object

Summary

exposure_tab

Description

Type:

TYPE

input_xml

Description

Type:

str

observation_list_file

Description

Type:

str

obstab

Description

Type:

TYPE

output_csv

Description

Type:

TYPE

pointing_file

Description

Type:

str

__init__(input_xml=None, pointing_file=None, output_dir=None, output_csv=None, observation_list_file=None)[source]

Methods

__init__([input_xml, pointing_file, ...])

add_epochs(intab)

NOT CURRENTLY USED

add_observation_info(intab)

Add information about each observation.

add_options([parser, usage])

base36encode(integer)

Translate a base 10 integer to base 36

check_aperture_override()

combine_dicts(dict1, dict2)

Combine two dictionaries into a single dictionary.

create_input_table([verbose])

Main function for creating a table of parameters for each exposure

expand_for_detectors(input_dictionary)

Expand dictionary to have one entry per detector, rather than the one line per module that is in the input

extract_grism_aperture(apertures, filter_name)

In the case of a Grism observation (WFSS or GRISM TSO), where a given crossing filter is used, find the appropriate aperture to use.

extract_value(line)

Extract text from xml line

full_path(in_path)

If the input path is not None, expand any environment variables and make an absolute path.

get_pointing_info(file[, propid, verbose])

Read in information from APT's pointing file.

global_alignment_pointing(obs_dict)

Adjust the pointing dictionary information for global alignment observations.

tight_dithers(input_dict)

In NIRCam, when the 'FULL' dither pattern is used, it is possible to set the number of primary dithers to '3TIGHT' rather than just a number (e.g. '3').

add_epochs(intab)[source]

NOT CURRENTLY USED

add_observation_info(intab)[source]

Add information about each observation.

Catalog names, dates, PAV3 values, etc., which are retrieved from the observation list yaml file.

Parameters:

intab (obj) – astropy.table.Table containing exposure information

Returns:

intab (obj) – Updated table with information from the observation list yaml file added.

base36encode(integer)[source]

Translate a base 10 integer to base 36

Parameters:

integer (int) – a base 10 integer

Returns:

integer (int) – The integer translated to base 36

combine_dicts(dict1, dict2)[source]

Combine two dictionaries into a single dictionary.

Parameters:
  • dict1 (dict) – dictionary

  • dict2 (dict) – dictionary

Returns:

combined (dict) – Combined dictionary

create_input_table(verbose=False)[source]

Main function for creating a table of parameters for each exposure

Parameters:

verbose (bool) – If True, extra information is printed to the log

expand_for_detectors(input_dictionary)[source]

Expand dictionary to have one entry per detector, rather than the one line per module that is in the input

Parameters:

input_dictionary (dict) – dictionary containing one entry per module

Returns:

observation_dictionary (dict) – dictionary expanded to have one entry per detector

extract_grism_aperture(apertures, filter_name)[source]

In the case of a Grism observation (WFSS or GRISM TSO), where a given crossing filter is used, find the appropriate aperture to use.

Parameters:
  • apertures (list) – List of possible grism apertures

  • filter_name (str) – Name of crossing filter

Returns:

apertures (list) – Modified list containig the correct aperture

extract_value(line)[source]

Extract text from xml line

Parameters:

line (str) – Line from xml file

Returns:

line (str) – Text between > and < in the input line

full_path(in_path)[source]

If the input path is not None, expand any environment variables and make an absolute path. Return the updated path.

Parameters:

in_path (str) – Path to be expanded

Returns:

in_path (str) – Expanded, absolute path

get_pointing_info(file, propid=0, verbose=False)[source]

Read in information from APT’s pointing file.

Parameters:
  • file (str) – Name of APT-exported pointing file to be read

  • propid (int) – Proposal ID number (integer). This is used to create various ID fields

Returns:

pointing (dict) – Dictionary of pointing-related information

Todo

extract useful information from header? check visit numbers set parallel proposal number correctly

global_alignment_pointing(obs_dict)[source]

Adjust the pointing dictionary information for global alignment observations. Some of the entries need to be changed from NIRCam to FGS. Remember that not all observations in the dictionary will necessarily be WfscGlobalAlignment template. Be sure the leave all other templates unchanged.

Parameters:

obs_dict (dict) – Dictionary of observation parameters, as returned from add_observation_info()

Returns:

obs_dict (dict) – Dictionary with modified values for FGS pointing in Global Alignment templates

tight_dithers(input_dict)[source]

In NIRCam, when the ‘FULL’ dither pattern is used, it is possible to set the number of primary dithers to ‘3TIGHT’ rather than just a number (e.g. ‘3’). If the number of dithers is set to ‘3TIGHT’ remove ‘TIGHT’ from the entries and leave only the number behind.

Parameters:

input_dict (dict) – Dictionary where each key points to a list containing observation details. For example, input_dict[‘PrimarDither’] is a list of the number of primary dithers for all observations

Returns:

input_dict (dict) – Updated dictionary where ‘TIGHT’ has been removed from PrimaryDither list