diff --git a/ChangeLog b/ChangeLog index f4d9bc6..2199a02 100755 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,14 @@ Add support of rectangular On/Off regions (#3248) +2020-12-02 + + * Bug fix version 1.7.3 released + ================================ + + Import matplotlib first in example scripts (#3423) + + 2020-10-15 * Bug fix version 1.7.2 released diff --git a/doc/source/admin/download.rst b/doc/source/admin/download.rst index 948ee2b..d3dc9b0 100755 --- a/doc/source/admin/download.rst +++ b/doc/source/admin/download.rst @@ -3,7 +3,7 @@ Download ======== -The latest ctools release is ``ctools-1.7.2`` (15 October 2020). +The latest ctools release is ``ctools-1.7.3`` (2 December 2020). Below a table of ctools releases. Please read the :ref:`sec_release` to learn more about new features and corrected bugs in a given release. @@ -11,7 +11,7 @@ learn more about new features and corrected bugs in a given release. .. warning:: At this stage of the project there is a strict link between the ctools and gammalib versions. Please make sure that you have the corresponding gammalib - version installed before installing ctools. The Mac OS X binary packages + version installed before installing ctools. The Mac OS binary packages comprise both ctools and gammalib. .. @@ -22,7 +22,10 @@ learn more about new features and corrected bugs in a given release. * - ctools - gammalib - - Mac OS X (10.7+) binary disk image + - Mac OS (10.7+) binary disk image + * - `1.7.3 `_ + - `1.7.3 `_ + - `ctools-1.7.3-macosx10.7.dmg `_ * - `1.7.2 `_ - `1.7.2 `_ - `ctools-1.7.2-macosx10.7.dmg `_ diff --git a/doc/source/admin/install_binary.rst b/doc/source/admin/install_binary.rst index 21c7856..b0d1523 100644 --- a/doc/source/admin/install_binary.rst +++ b/doc/source/admin/install_binary.rst @@ -3,15 +3,15 @@ Installing as binary package ============================ -Mac OS X --------- +Mac OS +------ -After :ref:`downloading the Mac OS X binary disk image ` +After :ref:`downloading the Mac OS binary disk image ` double-click on the image to mount the disk .. image:: macosx-disk-image.jpg :height: 300px - :alt: Mac OS X binary disk image + :alt: Mac OS binary disk image :align: center Now open the installer package by right-clicking (ctrl-click) on the installer diff --git a/doc/source/admin/install_devel.rst b/doc/source/admin/install_devel.rst index 6a1d539..3a7695d 100644 --- a/doc/source/admin/install_devel.rst +++ b/doc/source/admin/install_devel.rst @@ -3,36 +3,36 @@ Installing the development version ================================== -The current development version of the code can be downloaded as source -tarballs, Mac OS X binaries, or directly from the `Git `_ -repository. +Alternatively to stable releases you can also install the development version +of the code which includes the latest features that will become available +with the next stable release. Installing the development version is recommended if +you want to use latest code features and if you cannot wait for the next +stable release. The current ctools development release is ``ctools-2.0.0.dev``. -The current ctools development release is ``ctools-2.0.0.dev``. +Installing the development version is also necessary **if you want to contribute +to code development. In that case please follow the instructions on** +:ref:`using_git` **and ignore the rest of this page.** -Source tarballs ---------------- - -Download the source tarballs from the following links - -- `ctools `_ -- `GammaLib `_ - -and follow the instructions on :ref:`sec_install_source`. +Getting the development version +------------------------------- +The first step is to get the development version of the code. There are three +options for that first step: either get the source tarball or clone the +source code from the `Git `_ repository or download +the binary installers for Mac OS. -Binary packages ---------------- -Download the installer image from the following link +Getting the source tarball +~~~~~~~~~~~~~~~~~~~~~~~~~~ -- `Mac OS X (10.7+) `_ - -and follow the instructions on :ref:`sec_install_binary`. +Download the source tarballs from the following links +- `ctools `_ +- `GammaLib `_ -Git repository --------------- +Cloning the Git repository +~~~~~~~~~~~~~~~~~~~~~~~~~~ To clone the gammalib and ctools source codes, type @@ -55,19 +55,52 @@ or $ git config --global http.sslverify "false" -before retrieving the code. -Before you will be able to compile the code you need to generate the -configuration file using the ``autogen.sh`` script. -Also make sure that you're actually on the devel branch of the git -repository. GammaLib and ctools can be compiled and configured using -the following command sequence (the code will be installed into the -``/usr/local/gamma`` directory): +before retrieving the code. Before you will be able to compile the code directly +you need to generate the configuration file using the ``autogen.sh`` script. +Also make sure that you're actually on the devel branch of the git repository. +You do this by typing: .. code-block:: bash $ cd gammalib $ git checkout devel $ ./autogen.sh + $ cd ../ctools + $ git checkout devel + $ ./autogen.sh + + +Downloading Mac OS binary packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can download the Mac OS installer image from the following link + +- `Mac OS (10.7+) `_ + +and follow the instructions on :ref:`sec_install_binary`. + + +Compiling the development version +--------------------------------- + +The second step is to compile the development version. You do not need to +compile the code in case that you installed the Mac OS binary packages. + +For code compilation, you can either compile the code directly using ``make`` +or you can build a conda package. The latter is preferred if you want to use +ctools in a conda environment. We do not recommend to compile the development +version directly against a conda version of Python. + + +Compiling the development version +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +ctools and GammaLib can be compiled and configured using the following sequence +of commands (the code will be installed into the ``/usr/local/gamma`` directory): + +.. code-block:: bash + + $ cd gammalib $ ./configure $ make $ make check @@ -75,8 +108,6 @@ the following command sequence (the code will be installed into the $ export GAMMALIB=/usr/local/gamma $ source $GAMMALIB/bin/gammalib-init.sh $ cd ../ctools - $ git checkout devel - $ ./autogen.sh $ ./configure $ make $ make check @@ -93,34 +124,21 @@ on how to install ctools. not stored in the Git repository but are built using `swig `_ from interface files located in the pyext folder. However, you do not need `swig `_ - when fetching a release as the Python wrappers are bundled with the - release tarballs. + when fetching a tarball as the Python wrappers are bundled with the + tarballs. +Building a conda package +~~~~~~~~~~~~~~~~~~~~~~~~ -Making a conda package ----------------------- - -To create a conda package for the development version, clone the gammalib and -ctools source codes using - -.. code-block:: bash - - $ git clone https://cta-gitlab.irap.omp.eu/gammalib/gammalib.git - $ git clone https://cta-gitlab.irap.omp.eu/ctools/ctools.git - -and type the following to create the conda packages (make sure that anaconda is -included in your ``$PATH`` environment): +Alternatively you can create a conda package using the following sequence +of commands (make sure that anaconda is included in your ``$PATH`` environment): .. code-block:: bash $ cd gammalib - $ git checkout devel - $ ./autogen.sh $ ./configure $ conda-build dev/conda.recipe $ cd ../ctools - $ git checkout devel - $ ./autogen.sh $ ./configure $ conda-build dev/conda.recipe @@ -133,6 +151,11 @@ version as follows: $ source activate ctools-devel $ conda install --use-local ctools=2.0.0.dev -Note that you can choose between Python 2.7, 3.5, 3.6, 3.7 and 3.8 for your -conda environment. +Note that you can choose between Python 2.7, 3.5, 3.6, 3.7, 3.8 and 3.9 for +your conda environment. If you only need the conda package for one specific +Python version you can build the conda package as follows: + +.. code-block:: bash + + $ conda-build dev/conda.recipe --python 3.6 diff --git a/doc/source/admin/release_history/1.7.3.rst b/doc/source/admin/release_history/1.7.3.rst new file mode 100644 index 0000000..48fee06 --- /dev/null +++ b/doc/source/admin/release_history/1.7.3.rst @@ -0,0 +1,14 @@ +.. _1.7.3: + +ctools 1.7.3 release (2 December 2020) +====================================== + +Overview +-------- + +ctools 1.7.3 is a bug fix release for ctools release 1.7. + +The following bugs were fixed: + +* [`3423 `_] - + Import matplotlib first in example scripts diff --git a/doc/source/admin/release_history/index.rst b/doc/source/admin/release_history/index.rst index a43b852..5149ff4 100755 --- a/doc/source/admin/release_history/index.rst +++ b/doc/source/admin/release_history/index.rst @@ -7,6 +7,7 @@ Release History :maxdepth: 1 ctools 2.0 <2.0> + ctools 1.7.3 <1.7.3> ctools 1.7.2 <1.7.2> ctools 1.7.1 <1.7.1> ctools 1.7 <1.7> diff --git a/examples/show_butterfly.py b/examples/show_butterfly.py index 61fabc7..70eeb43 100755 --- a/examples/show_butterfly.py +++ b/examples/show_butterfly.py @@ -2,7 +2,7 @@ # ========================================================================== # Shows butterfly diagram created with ctbutterfly # -# Copyright (C) 2014-2019 Michael Mayer +# Copyright (C) 2014-2020 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ======================================== # diff --git a/examples/show_irf.py b/examples/show_irf.py index 7698fb5..3faecbb 100755 --- a/examples/show_irf.py +++ b/examples/show_irf.py @@ -2,7 +2,7 @@ # ========================================================================== # Display Instrument Response Function # -# Copyright (C) 2017-2018 Juergen Knoedlseder +# Copyright (C) 2017-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,8 +20,6 @@ # ========================================================================== import sys import math -import gammalib -import cscripts try: import matplotlib.pyplot as plt from matplotlib import ticker @@ -31,6 +29,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ========= # diff --git a/examples/show_lightcurve.py b/examples/show_lightcurve.py index 501707f..1020749 100755 --- a/examples/show_lightcurve.py +++ b/examples/show_lightcurve.py @@ -2,7 +2,7 @@ # ========================================================================== # Display lightcurve generated by cslightcrv # -# Copyright (C) 2017 Juergen Knoedlseder +# Copyright (C) 2017-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # =============== # diff --git a/examples/show_model.py b/examples/show_model.py index b57531d..306a5f4 100755 --- a/examples/show_model.py +++ b/examples/show_model.py @@ -2,7 +2,7 @@ # ========================================================================== # Shows the photon spectrum of a model # -# Copyright (C) 2015-2016 Juergen Knoedlseder +# Copyright (C) 2015-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ======================= # diff --git a/examples/show_obs.py b/examples/show_obs.py index 1cb6de7..fe1a174 100755 --- a/examples/show_obs.py +++ b/examples/show_obs.py @@ -2,7 +2,7 @@ # ========================================================================== # Display summary of observation definition XML file # -# Copyright (C) 2016 Michael Mayer +# Copyright (C) 2016-2020 Michael Mayer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ==================== # diff --git a/examples/show_pha.py b/examples/show_pha.py index 7aa2404..b862fb8 100755 --- a/examples/show_pha.py +++ b/examples/show_pha.py @@ -2,7 +2,7 @@ # ========================================================================== # Show a spectrum in PHA format # -# Copyright (C) 2013-2016 Juergen Knoedlseder +# Copyright (C) 2013-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,8 +20,6 @@ # ========================================================================== import sys import math -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -29,6 +27,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ================= # diff --git a/examples/show_phases.py b/examples/show_phases.py index f7c58ee..476636d 100755 --- a/examples/show_phases.py +++ b/examples/show_phases.py @@ -2,7 +2,7 @@ # ========================================================================== # Display phase information from event list # -# Copyright (C) 2017 Juergen Knoedlseder +# Copyright (C) 2017-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # =========== # diff --git a/examples/show_pointings.py b/examples/show_pointings.py index 02c4b96..7db62a7 100755 --- a/examples/show_pointings.py +++ b/examples/show_pointings.py @@ -2,7 +2,7 @@ # ========================================================================== # Display pointings in observation definition XML file # -# Copyright (C) 2017 Juergen Knoedlseder +# Copyright (C) 2017-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # =============================== # diff --git a/examples/show_pull_evolution.py b/examples/show_pull_evolution.py index 4920388..ba9cf40 100755 --- a/examples/show_pull_evolution.py +++ b/examples/show_pull_evolution.py @@ -2,7 +2,7 @@ # ========================================================================== # Shows the evolution of the mean and rms pull # -# Copyright (C) 2015-2017 Juergen Knoedlseder +# Copyright (C) 2015-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ # # ========================================================================== import sys -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -32,6 +31,7 @@ try: except ImportError: print('This script needs the "numpy" module') sys.exit() +import cscripts # =================== # diff --git a/examples/show_pull_histogram.py b/examples/show_pull_histogram.py index 57d96bb..e90fb82 100755 --- a/examples/show_pull_histogram.py +++ b/examples/show_pull_histogram.py @@ -2,7 +2,7 @@ # ========================================================================== # Shows the pull histogram # -# Copyright (C) 2011-2017 Juergen Knoedlseder +# Copyright (C) 2011-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ # # ========================================================================== import sys -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -32,6 +31,7 @@ try: except ImportError: print('This script needs the "numpy" module') sys.exit() +import cscripts # =================== # diff --git a/examples/show_residuals.py b/examples/show_residuals.py index c992f42..2042e11 100755 --- a/examples/show_residuals.py +++ b/examples/show_residuals.py @@ -2,7 +2,7 @@ # ========================================================================== # Display residuals generated by csresspec # -# Copyright (C) 2017-2019 Luigi Tibaldo +# Copyright (C) 2017-2020 Luigi Tibaldo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,8 +20,6 @@ # ========================================================================== import sys import math -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -29,6 +27,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ======================= # diff --git a/examples/show_response.py b/examples/show_response.py index bc7290b..9d6b422 100755 --- a/examples/show_response.py +++ b/examples/show_response.py @@ -2,7 +2,7 @@ # ========================================================================== # Shows one or several CTA response functions. # -# Copyright (C) 2014-2017 Juergen Knoedlseder +# Copyright (C) 2014-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,8 +20,6 @@ # ========================================================================== import sys import math -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -29,6 +27,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ================================== # diff --git a/examples/show_rmf.py b/examples/show_rmf.py index 83479db..7790e97 100755 --- a/examples/show_rmf.py +++ b/examples/show_rmf.py @@ -2,7 +2,7 @@ # ========================================================================== # Display Redistribution Matrix File # -# Copyright (C) 2018-2019 Juergen Knoedlseder +# Copyright (C) 2018-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ======== # diff --git a/examples/show_sensitivity.py b/examples/show_sensitivity.py index 7aea2c1..ff4b94c 100755 --- a/examples/show_sensitivity.py +++ b/examples/show_sensitivity.py @@ -2,7 +2,7 @@ # ========================================================================== # Display differential sensitivity plot generated by cssens # -# Copyright (C) 2015-2017 Juergen Knoedlseder +# Copyright (C) 2015-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,8 +20,6 @@ # ========================================================================== import sys import math -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -29,6 +27,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ===================== # diff --git a/examples/show_significance_distribution.py b/examples/show_significance_distribution.py index 20d88af..3bcdefd 100755 --- a/examples/show_significance_distribution.py +++ b/examples/show_significance_distribution.py @@ -2,7 +2,7 @@ # ========================================================================== # Shows the distribution of significances in a given significance map. # -# Copyright (C) 2018-2019 Andreas Specovius +# Copyright (C) 2018-2020 Andreas Specovius # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,8 +46,6 @@ # ========================================================================== import sys import math -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -60,6 +58,8 @@ try: except ImportError: print('This script needs the "numpy" module') sys.exit() +import gammalib +import cscripts # ======================= # diff --git a/examples/show_spectrum.py b/examples/show_spectrum.py index a199795..0b91071 100755 --- a/examples/show_spectrum.py +++ b/examples/show_spectrum.py @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -33,6 +31,8 @@ try: except ImportError: print('This script needs the "numpy" module') sys.exit() +import gammalib +import cscripts # ===================================== # diff --git a/examples/show_ts_distribution.py b/examples/show_ts_distribution.py index 0a89da8..5bf4998 100755 --- a/examples/show_ts_distribution.py +++ b/examples/show_ts_distribution.py @@ -2,7 +2,7 @@ # ========================================================================== # Display TS distribution generated by cstsdist # -# Copyright (C) 2011-2017 Jurgen Knodlseder +# Copyright (C) 2011-2020 Jurgen Knodlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,6 @@ import sys import csv import math -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -34,6 +33,7 @@ try: except ImportError: print('This script needs the "numpy" module') sys.exit() +import cscripts # ==================== # diff --git a/examples/show_variability_evolution.py b/examples/show_variability_evolution.py index e1adfc8..811b088 100755 --- a/examples/show_variability_evolution.py +++ b/examples/show_variability_evolution.py @@ -2,7 +2,7 @@ # ========================================================================== # Shows source variability evolution created with ctfindvar # -# Copyright (C) 2018 Simon Bonnefoy +# Copyright (C) 2018-2020 Simon Bonnefoy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # ========================== # diff --git a/examples/show_viscube.py b/examples/show_viscube.py index 6f9d711..9ed14ed 100755 --- a/examples/show_viscube.py +++ b/examples/show_viscube.py @@ -2,7 +2,7 @@ # ========================================================================== # Show visibility cube # -# Copyright (C) 2019 Juergen Knoedlseder +# Copyright (C) 2019-2020 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ # # ========================================================================== import sys -import gammalib -import cscripts try: import matplotlib.pyplot as plt plt.figure() @@ -28,6 +26,8 @@ try: except (ImportError, RuntimeError): print('This script needs the "matplotlib" module') sys.exit() +import gammalib +import cscripts # =========================== #