Skip to content
Snippets Groups Projects
Commit 70947a82 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

minor tweaks in plot

parent 5a575ea8
No related branches found
No related tags found
1 merge request!1187TMSS-2823
...@@ -98,6 +98,7 @@ def scheduling_constraints_plot(scheduling_units: Union[models.SchedulingUnitBlu ...@@ -98,6 +98,7 @@ def scheduling_constraints_plot(scheduling_units: Union[models.SchedulingUnitBlu
elevation_axes.set_ylim(0, 90) elevation_axes.set_ylim(0, 90)
elevation_axes.set_ylabel('elevation [deg]') elevation_axes.set_ylabel('elevation [deg]')
# determine x-axis time range and timestamp_to_x_value function # determine x-axis time range and timestamp_to_x_value function
if proposed_date is not None: if proposed_date is not None:
lower_timestamp = datetime(proposed_date.year, proposed_date.month, proposed_date.day, 0, 0, 0) 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 ...@@ -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(): for constraint, value in scheduling_unit.scheduling_constraints_doc.get('daily',{}).items():
if value: if value:
start_end_pairs = ((start_day, end_day),) if constraint=='require_day' else \ 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)) ((start_morning_twilight, end_morning_twilight), (start_evening_twilight, end_evening_twilight))
for start, end in start_end_pairs: for start, end in start_end_pairs:
...@@ -276,7 +277,7 @@ def scheduling_constraints_plot(scheduling_units: Union[models.SchedulingUnitBlu ...@@ -276,7 +277,7 @@ def scheduling_constraints_plot(scheduling_units: Union[models.SchedulingUnitBlu
xy=(obs_center_timestamp, 0), xycoords='data', xy=(obs_center_timestamp, 0), xycoords='data',
xytext=(obs_center_timestamp, max_elevation_at_center-obs_idx*8), textcoords='data', xytext=(obs_center_timestamp, max_elevation_at_center-obs_idx*8), textcoords='data',
arrowprops=dict(color="slateblue", arrowstyle="-", linestyle='dashed', alpha=0.75), 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: if single_unit_plot:
transit_offset_constraints = scheduling_unit.scheduling_constraints_doc.get('sky', {}).get('transit_offset', {}) 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 ...@@ -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], elevation_axes.text(obs_timestamps[0] if obs_start_timestamp < center_timestamp else obs_timestamps[-1],
min_elevation + 1, min_elevation + 1,
'min %s elevation %.1f[deg]' % (obs_type, min_elevation), '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') verticalalignment='bottom')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment