access
- Module for computing the intersection of the various accessibility maps for all targets for the following constraints:
telescope pointing
telescope allocation
sky brightness
moon separation
internight cadence from past history
PI custom windows
simulated weather loss
enough time to complete the exposure tonight
The Access class is saved as an attribute of the splan object and used again in plotting.
- class astroq.access.Access(semester_start_date, semester_length, n_nights_in_semester, today_starting_night, current_day, all_dates_dict, all_dates_array, slot_size, slots_needed_for_exposure_dict, custom_file, allocation_file, past_history, output_directory, run_weather_loss, run_band3, observatory_string, request_frame)[source]
Bases:
objectThe Access class encapsulates all the parameters needed for accessibility computation and provides an object-oriented interface to the accessibility computation.
- compute_allocated()[source]
Compute boolean mask of is_allocated for all targets according to the allocated times.
- compute_altaz(tel_min)[source]
Compute boolean mask of is_altaz for targets according to a minimum elevation. May be superceded by a specific compute_altaz method for a specific observatory, see astroq/queue/ modules.
- Parameters:
tel_min (float) – the minimum elevation for the telescope
- Returns:
boolean mask of is_altaz for targets
- Return type:
is_altaz (array)
- compute_clear(weather_loss_file=None)[source]
Compute boolean mask of is_clear for all targets according to the clear times.
- Parameters:
weather_loss_file – Path to file with weather loss statistics information
- compute_custom()[source]
Compute boolean mask of is_custom for all targets according to the custom times.
- compute_future()[source]
Compute boolean mask of is_future for all targets according to today’s current_day.
Args: :returns: boolean mask of is_altaz for targets :rtype: is_altaz (array)
- compute_inter()[source]
Compute boolean mask of is_inter for all targets according to the internight cadence.
- compute_moon()[source]
Compute boolean mask of is_moon for all targets according to the moon’s position.
- get_loss_stats(weather_loss_file)[source]
Gather the loss probabilities for each night in the semester from the saved historical weather data.
- observability(requests_frame, access=None)[source]
Extract a dictionary of the available indices from the record array returned by produce_ultimate_map
- Parameters:
requests_frame – DataFrame containing request information
access – Optional record array from produce_ultimate_map (if None, this function will compute it)
- Returns:
Dictionary where keys are target names and values are lists of available slots per night
- Return type:
df (dict)
- produce_ultimate_map(running_backup_stars=False)[source]
Compute boolean mask of is_observable for all targets according to the ultimate map.
- simulate_weather_losses(covariance=0.14)[source]
Simulate nights totally lost to weather using historical data
- Parameters:
covariance (float) – the added percent chance that tomorrow will be lost if today is lost
- Returns:
Trues represent clear nights, Falses represent weathered nights
- Return type:
is_clear (array)
- astroq.access.build_twilight_allocation_file(semester_planner)[source]
Build an allocation.csv file where every night of the semester is allocated from evening to morning 12-degree twilight times. This is used exclusively by the football plot in the webapp.
- Parameters:
semester_planner (SemesterPlanner) – a semester planner object from splan.py
- Returns:
Path to the created allocation.csv file
- Return type:
twilight_file (str)