diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/plots.py b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/plots.py index 8b91b487f156fe1ae063d02e6eb558646bb89beb..ff2d448515e5979c5929c920cadf6fa8bdd0f1b6 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/adapters/plots.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/adapters/plots.py @@ -98,6 +98,7 @@ def scheduling_constraints_plot(scheduling_units: Union[models.SchedulingUnitBlu elevation_axes.set_ylim(0, 90) elevation_axes.set_ylabel('elevation [deg]') + # determine x-axis time range and timestamp_to_x_value function if proposed_date is not None: lower_timestamp = datetime(proposed_date.year, proposed_date.month, proposed_date.day, 0, 0, 0) @@ -201,7 +202,7 @@ def scheduling_constraints_plot(scheduling_units: Union[models.SchedulingUnitBlu for constraint, value in scheduling_unit.scheduling_constraints_doc.get('daily',{}).items(): if value: start_end_pairs = ((start_day, end_day),) if constraint=='require_day' else \ - ((start_night, end_night),) if constraint == 'require_night' else \ + ((start_prev_night, end_prev_night), (start_night, end_night),) if constraint == 'require_night' else \ ((start_morning_twilight, end_morning_twilight), (start_evening_twilight, end_evening_twilight)) for start, end in start_end_pairs: @@ -276,7 +277,7 @@ def scheduling_constraints_plot(scheduling_units: Union[models.SchedulingUnitBlu xy=(obs_center_timestamp, 0), xycoords='data', xytext=(obs_center_timestamp, max_elevation_at_center-obs_idx*8), textcoords='data', arrowprops=dict(color="slateblue", arrowstyle="-", linestyle='dashed', alpha=0.75), - horizontalalignment='center', verticalalignment='bottom', alpha=0.8) + horizontalalignment='center', verticalalignment='bottom', alpha=0.8, annotation_clip=None) if single_unit_plot: transit_offset_constraints = scheduling_unit.scheduling_constraints_doc.get('sky', {}).get('transit_offset', {}) @@ -369,7 +370,7 @@ def scheduling_constraints_plot(scheduling_units: Union[models.SchedulingUnitBlu elevation_axes.text(obs_timestamps[0] if obs_start_timestamp < center_timestamp else obs_timestamps[-1], min_elevation + 1, 'min %s elevation %.1f[deg]' % (obs_type, min_elevation), - horizontalalignment='left' if obs_start_timestamp < center_timestamp or proposed_date is not None else 'right', + horizontalalignment='left' if obs_start_timestamp < center_timestamp else 'right', verticalalignment='bottom')