diff --git a/sirepo/package_data/template/srw/parameters.py.jinja b/sirepo/package_data/template/srw/parameters.py.jinja index 9cbd11e49b..c3ef108b3b 100644 --- a/sirepo/package_data/template/srw/parameters.py.jinja +++ b/sirepo/package_data/template/srw/parameters.py.jinja @@ -490,6 +490,7 @@ _CANVAS_MAX_SIZE = {{ canvasMaxSize }} _JSON_MESSAGE_EXPANSION = {{ jsonExpandFactor }} _MAX_MESSAGE_BYTES = {{ maxMsgBytes }} + {{ extendPlot }} @@ -501,6 +502,7 @@ _MAX_MESSAGE_BYTES = {{ maxMsgBytes }} {{ updateReportRange }} + def main(): {{srwMain}} epilogue() diff --git a/sirepo/template/srw.py b/sirepo/template/srw.py index 68c5151d06..dd3167afd6 100644 --- a/sirepo/template/srw.py +++ b/sirepo/template/srw.py @@ -1528,6 +1528,8 @@ def _export_rsopt_config(data, run_dir): def _extend_plot( ar2d, x_range, y_range, horizontalStart, horizontalEnd, verticalStart, verticalEnd ): + import numpy as np + x_step = (x_range[1] - x_range[0]) / x_range[2] y_step = (y_range[1] - y_range[0]) / y_range[2] @@ -2544,6 +2546,8 @@ def _template_text(text): def _update_report_range(report, ar2d, x_range, y_range): + import numpy as np + horizontalStart = (report.horizontalOffset - report.horizontalSize / 2) * 1e-3 horizontalEnd = (report.horizontalOffset + report.horizontalSize / 2) * 1e-3 verticalStart = (report.verticalOffset - report.verticalSize / 2) * 1e-3