Skip to content

Commit

Permalink
Merge pull request #159 from desihub/ADM-plot-control
Browse files Browse the repository at this point in the history
Allow plot object to be returned from forecast_plots()
  • Loading branch information
geordie666 authored Sep 14, 2024
2 parents 5115d9a + 16baffb commit d97b77b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion doc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ desisurvey change log
0.20.1 (unreleased)
-------------------

* No changes yet
* Allow plot to be returned from forecast_plots() (PR `#159`_).

.. _`#159`: https://github.com/desihub/desisurvey/pull/159

0.20.0 (2024-04-30)
-------------------
Expand Down
5 changes: 4 additions & 1 deletion py/desisurvey/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def update(self):

def forecast_plots(tmain=None, exps=None, surveyopsdir=None,
include_backup=False, cfgfile=None, ratio=False,
nownight=None, airmasspower=1.25):
nownight=None, airmasspower=1.25, return_plot=False):
from matplotlib import pyplot as p
if surveyopsdir is None:
surveyopsdir = os.environ['DESI_SURVEYOPS']
Expand Down Expand Up @@ -339,6 +339,9 @@ def forecast_plots(tmain=None, exps=None, surveyopsdir=None,
print('Dark months ahead: %5.2f' % ((darkfrac - elapsedfrac)*55))
print('Dark margin: %5.2f%%' % (100*(darkfrac - elapsedfrac)/ elapsedfrac))

if return_plot:
return p


def summarize_daterange(
startdate, enddate, exps=None, surveyopsdir=None,
Expand Down

0 comments on commit d97b77b

Please sign in to comment.