Survey¶
- class DeepSurveySim.Survey.Survey(observatory_config, survey_config)¶
Run a survey in sequence, selecting new sites to observe and few the assocaited variables
- Args:
obseravtory_config (dict): Setup parameters for Survey.ObservationVariables, the telescope configuration, as read by IO.ReadConfig survey_config (dict): Parameters for the survey, including the stopping conditions, the validity conditions, the variables to collect, as read by IO.ReadConfig
- Examples:
>>> survey = Survey(observatory_config, survey_config) action_generator = ActionGenerator() # Attributary function to produce time, location pairs for step in range(10): action_time, action_location = action_generator() update_action = {"time":[action_time], "location":{"ra":[action_location["ra"]], "decl":[action_location["decl"]]}} observation, reward, stop, log = survey.step(update_action)
>>> survey = Survey(observatory_config, survey_config) # Run without changing the location, only stepping time forward survey_results = survey()
- Parameters:
observatory_config (dict) –
survey_config (dict) –
- reset()¶
Return the observer to its inital position, the time to the start time, and the timestep to 0.
- step(action)¶
Move the observator forward with one action and add the reward and stop condition to the returned observation.
- Parameters:
action (dict) – Dictionary containing “time” (array in units Mean Julian Date) “location”(dict with ra, decl, in degrees as arrays) (optional), “band” (str of the represention of the optical filter) (optional)
- Returns:
observation (dict, containing survey_config[“variables”], vality, Time (in mjd)), reward (array), stop (array), log (dictionary)
- Return type:
Tuple
- class DeepSurveySim.Survey.ObservationVariables(observator_configuration)¶
Calculate the parameters for a specific observation
- Run the program by
specifying the init params, updating the location, band, and time with ObservationVariables.update(), calculating the requested variables Possible calculations are seen with ObservationVariables.variables
All variables are returned with the dimensions (n observation times, n sites) in a dictionary labeled with their variable names
- Parameters:
observator_configuration (dict) – Describes the way the observatory is set up. This contains:
obs_latitude_degrees (float) (required) – Degree location
obs_logitude_degrees (float) (required) – Degree location
obs_elevation_meters (float) (required) – Height above sea level
bands (dict) –
String indication of the band, and its associated wavelength. Default {
”u”: 380.0, “g”: 475.0, “r”: 635.0, “i”: 775.0, “z”: 925.0, “Y”: 1000.0,
}
seeing (float) – [0, 3]; indicates the clarity of the sky. 3 is totally obscured, 0 is totally clear (as if observing through a vacuum). Default 0.9
optics_fwhm (float) – Default 0.45
location (dict) –
- dictionary containing either ‘n_sites’
(Number of sequentically generated sites spanning the whole sky)
or paired “ra” and “decl”, containing lists of locations. Default: 10 sites.
use_skybright (bool) – use the skybright program to add additional variables to the program Requires an outside download of PalPy (Not included with this distirbution) Default: False
Examples
>>> observer = ObservationVariables(configuration) observer.update({"time": [60125], location:{"ra":[20, 35]}, "decl":[0, 0]}) ## Calculate moon location for 6/30/2023 at 20*, 35* along the equator. moon_location = observer.calculate_moon_location() `{"moon_ra":(20,20), "moon_decl":(20,20)}`
>>> observer = ObservationVariables(configuration) observer.update(time = [60125], location = {"ra":[20, 35]}, "decl":[0, 0]}) # Calculate all variables all_stats = {} for function in observator.observation_variables(): all_stats |= function()
- calculate_lst()¶
Calculate the current pointing local sidereal time LST - https://en.wikipedia.org/wiki/Sidereal_time
- Returns:
Local Sideral Time, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_moon_airmass()¶
” Calculate the airmass of the moon at the given point in time https://en.wikipedia.org/wiki/Air_mass_(astronomy)
- Returns:
Moon Airmass, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_moon_brightness()¶
Calculate the brightness of the moon at a the current time, as observated from the current observatory
- Returned dictionary contains
Moon Elongation (seperation from the sun, in degrees)
Moon Phase (quarters of the moon illumated)
Moon Illumation (% of moon face illumated)
Moon V Magnitude: Visible magnitude approximation as defined by Allen’s Astrophysical Quantities
Moon Seperation: Angular distance (degrees) between point and the moon
- Returns:
Array of above moon brightness variables, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_moon_ha()¶
” Calculate the hour angle of the moon at the given point in time https://en.wikipedia.org/wiki/Hour_angle
- Returns:
Moon HA shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_observation_airmass()¶
Calculate the current pointing’s airmass https://en.wikipedia.org/wiki/Air_mass_(astronomy) :returns: Pointing Airmass, shape (n observation times, n sites) :rtype: dict[array]
- calculate_observation_angles()¶
Calculate the altitude and azumultial angle of the current pointing, in degrees
- Returns:
Azimuthal angle (az), Altitude (alt) in degrees, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_observation_ha()¶
Calcate the current point’s Hour Angle https://en.wikipedia.org/wiki/Hour_angle
- Returns:
Pointing HA, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_seeing()¶
Calculate the optical visibality of the observation with the current filter/band fwhw defintion - https://en.wikipedia.org/wiki/Full_width_at_half_maximum
- Returns:
Dictionary of Transverse seeing (pt_seeing), Seeing through the current filter (band_seeing), Full width at half maximum (fwhw) for the light signal, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_sky_magnitude()¶
If skybright is both installed and set up, calculate the sky brightness/magnitude of brightness Please view https://github.com/ehneilsen/skybright/blob/b0e2d7e6e25131393ee76ce334ce1df1521e3659/skybright/skybright.py#L173 for details
- Returns:
Dictionary of “sky magnitude”, “tau”, “teff”, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_sun_airmass()¶
Calculate the Airmass of the sun relative to the current location. https://en.wikipedia.org/wiki/Air_mass_(astronomy)
- Returns:
Sun Airmass, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_sun_ha()¶
Calculate the Sun’s Hour Angle https://en.wikipedia.org/wiki/Hour_angle
- Returns:
Sun HA, shape (n observation times, n sites)
- Return type:
dict[array]
- calculate_sun_location()¶
Calculate the position of the sun in Right Ascension/Declination (degrees)
- Returns:
Dictionary of RA/Decl of the Sun, shape (n observation times, n sites)
- Return type:
dict[array]
- name_to_function()¶
Map between the name of the variable and the function used to produce it. Call this to find what variables are avaliable for your instance of ObservationVaraibles.
- Returns:
map between variable names and their functions.
- Return type:
dict
- update(time, location=None, band=None)¶
Move the simulation forward to the next site. Updates the time (ObservationVariables.time), the delay between pervious time and new time, observation site (ObservationVariables.location), and optial filter band (ObservationVariables.band)
- Parameters:
time (Union[float, list[float]]) – Time to move forward to, in Mean Julian Date
location (Union[dict, None], optional) – Location (paired ra/delc) in degrees to move the telescope pointing. Will not change the pointing if location not specificed. Defaults to None.
band (Union[str, None], optional) – Optical filter to use for observation. Will not be changed if not specified. Select from bands specified by ObservationVariables.band_wavelengths. Defaults to None.