Commit 1966cacb authored by Ole Streicher's avatar Ole Streicher

New upstream version 0.8

parent 4c9eb834
This diff is collapsed.
Metadata-Version: 1.1
Metadata-Version: 2.1
Name: gammapy
Version: 0.7
Version: 0.8
Summary: A Python package for gamma-ray astronomy
Home-page: https://github.com/gammapy/gammapy
Author: The Gammapy developers
Author-email: gammapy@googlegroups.com
License: BSD
Description-Content-Type: UNKNOWN
Description:
* Code: https://github.com/gammapy/gammapy
* Docs: http://docs.gammapy.org/
......@@ -32,6 +31,9 @@ Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Development Status :: 3 - Alpha
Provides-Extra: analysis
Provides-Extra: plotting
......@@ -11,6 +11,8 @@ A Python Package for Gamma-ray Astronomy.
.. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: http://www.astropy.org/
.. image:: http://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/gammapy/gammapy/v0.8?urlpath=lab/tree/first_steps.ipynb
Status shields
++++++++++++++
......@@ -31,12 +33,16 @@ Status shields
* .. image:: https://landscape.io/github/gammapy/gammapy/master/landscape.png
:target: https://landscape.io/github/gammapy/gammapy/master
:alt: Code Health
:alt: Landscape
* .. image:: https://readthedocs.org/projects/gammapy/badge/?version=latest
:target: http://docs.gammapy.org/en/latest/
:alt: Documentation Status
* .. image:: https://img.shields.io/lgtm/alerts/g/gammapy/gammapy.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/gammapy/gammapy/alerts/
:alt: LGTM
* .. image:: https://api.codacy.com/project/badge/Grade/32cac57dfd9a4d4cb96e7563d5350298
:target: https://www.codacy.com/app/cdeil/gammapy?utm_source=github.com&utm_medium=referral&utm_content=gammapy/gammapy&utm_campaign=Badge_Grade
:alt: Codacy
* .. image:: http://img.shields.io/pypi/v/gammapy.svg?text=version
:target: https://pypi.python.org/pypi/gammapy/
:target: https://pypi.org/project/gammapy/
:alt: Latest release
Metadata-Version: 1.1
Name: astropy-helpers
Version: 1.0.2
Version: 2.0.6
Summary: Utilities for building and installing Astropy, Astropy affiliated packages, and their respective documentation.
Home-page: http://astropy.org
Home-page: https://github.com/astropy/astropy-helpers
Author: The Astropy Developers
Author-email: astropy.team@gmail.com
License: BSD
Download-URL: http://pypi.python.org/packages/source/a/astropy-helpers/astropy-helpers-1.0.2.tar.gz
Description: astropy-helpers
===============
* Stable versions: https://pypi.org/project/astropy-helpers/
* Development version, issue tracker: https://github.com/astropy/astropy-helpers
This project provides a Python package, ``astropy_helpers``, which includes
many build, installation, and documentation-related tools used by the Astropy
project, but packaged separately for use by other projects that wish to
......@@ -17,6 +19,22 @@ Description: astropy-helpers
implementation are in the accepted
`Astropy Proposal for Enhancement (APE) 4 <https://github.com/astropy/astropy-APEs/blob/master/APE4.rst>`_.
The ``astropy_helpers.extern`` sub-module includes modules developed elsewhere
that are bundled here for convenience. At the moment, this consists of the
following two sphinx extensions:
* `numpydoc <https://github.com/numpy/numpydoc>`_, a Sphinx extension
developed as part of the Numpy project. This is used to parse docstrings
in Numpy format
* `sphinx-automodapi <https://github.com/astropy/sphinx-automodapi>`_, a Sphinx
extension developed as part of the Astropy project. This used to be developed
directly in ``astropy-helpers`` but is now a standalone package.
Issues with these sub-modules should be reported in their respective repositories,
and we will regularly update the bundled versions to reflect the latest released
versions.
``astropy_helpers`` includes a special "bootstrap" module called
``ah_bootstrap.py`` which is intended to be used by a project's setup.py in
order to ensure that the ``astropy_helpers`` package is available for
......@@ -34,10 +52,10 @@ Description: astropy-helpers
see the ``setup.py`` and ``setup.cfg`` files of the
`Affiliated package template <https://github.com/astropy/package-template>`_.
.. image:: https://travis-ci.org/astropy/astropy-helpers.png
.. image:: https://travis-ci.org/astropy/astropy-helpers.svg
:target: https://travis-ci.org/astropy/astropy-helpers
.. image:: https://coveralls.io/repos/astropy/astropy-helpers/badge.png
.. image:: https://coveralls.io/repos/astropy/astropy-helpers/badge.svg
:target: https://coveralls.io/r/astropy/astropy-helpers
Platform: UNKNOWN
......
......@@ -7,8 +7,10 @@ ez_setup.py
setup.cfg
setup.py
astropy_helpers/__init__.py
astropy_helpers/conftest.py
astropy_helpers/distutils_helpers.py
astropy_helpers/git_helpers.py
astropy_helpers/openmp_helpers.py
astropy_helpers/setup_helpers.py
astropy_helpers/test_helpers.py
astropy_helpers/utils.py
......@@ -20,6 +22,8 @@ astropy_helpers.egg-info/dependency_links.txt
astropy_helpers.egg-info/not-zip-safe
astropy_helpers.egg-info/top_level.txt
astropy_helpers/commands/__init__.py
astropy_helpers/commands/_dummy.py
astropy_helpers/commands/_test_compat.py
astropy_helpers/commands/build_ext.py
astropy_helpers/commands/build_py.py
astropy_helpers/commands/build_sphinx.py
......@@ -27,41 +31,36 @@ astropy_helpers/commands/install.py
astropy_helpers/commands/install_lib.py
astropy_helpers/commands/register.py
astropy_helpers/commands/setup_package.py
astropy_helpers/commands/test.py
astropy_helpers/commands/src/compiler.c
astropy_helpers/compat/__init__.py
astropy_helpers/compat/subprocess.py
astropy_helpers/extern/__init__.py
astropy_helpers/extern/setup_package.py
astropy_helpers/extern/automodapi/__init__.py
astropy_helpers/extern/automodapi/autodoc_enhancements.py
astropy_helpers/extern/automodapi/automodapi.py
astropy_helpers/extern/automodapi/automodsumm.py
astropy_helpers/extern/automodapi/smart_resolver.py
astropy_helpers/extern/automodapi/utils.py
astropy_helpers/extern/automodapi/templates/autosummary_core/base.rst
astropy_helpers/extern/automodapi/templates/autosummary_core/class.rst
astropy_helpers/extern/automodapi/templates/autosummary_core/module.rst
astropy_helpers/extern/numpydoc/__init__.py
astropy_helpers/extern/numpydoc/docscrape.py
astropy_helpers/extern/numpydoc/docscrape_sphinx.py
astropy_helpers/extern/numpydoc/numpydoc.py
astropy_helpers/extern/numpydoc/templates/numpydoc_docstring.rst
astropy_helpers/sphinx/__init__.py
astropy_helpers/sphinx/conf.py
astropy_helpers/sphinx/setup_package.py
astropy_helpers/sphinx/ext/__init__.py
astropy_helpers/sphinx/ext/astropyautosummary.py
astropy_helpers/sphinx/ext/autodoc_enhancements.py
astropy_helpers/sphinx/ext/automodapi.py
astropy_helpers/sphinx/ext/automodsumm.py
astropy_helpers/sphinx/ext/changelog_links.py
astropy_helpers/sphinx/ext/comment_eater.py
astropy_helpers/sphinx/ext/compiler_unparse.py
astropy_helpers/sphinx/ext/docscrape.py
astropy_helpers/sphinx/ext/docscrape_sphinx.py
astropy_helpers/sphinx/ext/doctest.py
astropy_helpers/sphinx/ext/edit_on_github.py
astropy_helpers/sphinx/ext/numpydoc.py
astropy_helpers/sphinx/ext/phantom_import.py
astropy_helpers/sphinx/ext/smart_resolver.py
astropy_helpers/sphinx/ext/tocdepthfix.py
astropy_helpers/sphinx/ext/traitsdoc.py
astropy_helpers/sphinx/ext/utils.py
astropy_helpers/sphinx/ext/viewcode.py
astropy_helpers/sphinx/ext/templates/autosummary_core/base.rst
astropy_helpers/sphinx/ext/templates/autosummary_core/class.rst
astropy_helpers/sphinx/ext/templates/autosummary_core/module.rst
astropy_helpers/sphinx/ext/tests/__init__.py
astropy_helpers/sphinx/ext/tests/test_autodoc_enhancements.py
astropy_helpers/sphinx/ext/tests/test_automodapi.py
astropy_helpers/sphinx/ext/tests/test_automodsumm.py
astropy_helpers/sphinx/ext/tests/test_docscrape.py
astropy_helpers/sphinx/ext/tests/test_utils.py
astropy_helpers/sphinx/local/python3links.inv
astropy_helpers/sphinx/local/python2_local_links.inv
astropy_helpers/sphinx/local/python3_local_links.inv
astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
......@@ -74,4 +73,7 @@ astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.svg
astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png
astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
\ No newline at end of file
astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
licenses/LICENSE_ASTROSCRAPPY.rst
licenses/LICENSE_COPYBUTTON.rst
licenses/LICENSE_NUMPYDOC.rst
\ No newline at end of file
# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2015-04-13 16:44:55.458413
# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2018-09-23 22:21:48
from __future__ import unicode_literals
import datetime
version = "1.0.2"
githash = "161773fa72d916c498e0a2a513ecc24460244ac8"
version = "2.0.6"
githash = "5e30a46dd0146a241f5c7ca8de0cc0144455b2e1"
major = 1
major = 2
minor = 0
bugfix = 2
bugfix = 6
release = True
timestamp = datetime.datetime(2015, 4, 13, 16, 44, 55, 458413)
timestamp = datetime.datetime(2018, 9, 23, 22, 21, 48)
debug = False
try:
......
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
# TODO: implement this test without executing ROOT
# That can be done in a separate `print_psf_norm`
# function that's not executed as part of the tests.
@pytest.mark.xfail
def test_psf_norm():
from ROOT import TF1
# Triple exponential 1D pdf in x = theta ^ 2
# represents a triple Gaussian 2D pdf
_psf = "[0]*(exp(-x/(2*[1]*[1]))+[2]*exp(-x/(2*[3]*[3]))+[4]*exp(-x/(2*[5]*[5])))"
theta2_min, theta2_max = 0.00, 0.05
psf = TF1("psf", _psf, theta2_min, theta2_max)
psf.SetParNames("SCALE", "SIGMA_1", "AMPL_2", "SIGMA_2", "AMPL_3", "SIGMA_3")
# First entry from Karl's file CTA1DC-HESS-run00023523_std_psf.fits
# Invalid values (probably fit did not converge)
psf.SetParameters(177.319000000000, 0.0272624000000000, 0.00641271000000000,
0.999995000000000, 0.171255000000000, 1.00000000000000)
print('Karl first: ', psf.Integral(theta2_min, theta2_max))
# Last entry from Karl's file CTA1DC-HESS-run00023523_std_psf.fits
psf.SetParameters(500.548000000000, 0.0145670000000000, 0.00489170000000000,
0.121316000000000, 0.279361000000000, 0.0337978000000000)
print('Karl last: ', psf.Integral(theta2_min, theta2_max))
# Some other example of HESS PSF by Christoph
psf.SetParameters(285.117, 0.021611, 0.0477598,
0.0919602, 0.461796, 0.0426815)
print('Christoph: ', psf.Integral(theta2_min, theta2_max))
# === Output ===
# Karl first: 1.81924677453
# Karl last: 0.590779978532
# Christoph: 0.964365136188
......@@ -38,12 +38,11 @@ if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION pytest
if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL pytest-xdist; fi
if [[ $SETUP_CMD != egg_info ]] && [[ $ASTROPY_VERSION == development ]]; then $PIP_INSTALL git+http://github.com/astropy/astropy.git#egg=astropy; fi
if [[ $SETUP_CMD != egg_info ]] && [[ $ASTROPY_VERSION == stable ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION astropy; fi
if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL scipy scikit-image pandas; fi
if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL scipy pandas; fi
if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL uncertainties; fi
if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL git+http://github.com/astrofrog/reproject.git#egg=reproject; fi
if [[ $SETUP_CMD == build_docs* ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION Sphinx matplotlib scipy; fi
if [[ $SETUP_CMD == build_docs* ]]; then $PIP_INSTALL linkchecker; fi
if [[ $SETUP_CMD == build_docs* ]]; then $PIP_INSTALL aplpy; fi
if [[ $SETUP_CMD == 'test --coverage' ]]; then $PIP_INSTALL coverage coveralls; fi
python setup.py $SETUP_CMD
if [[ $SETUP_CMD == build_docs* ]]; then linkchecker docs/_build/html; fi
"""Combine all Crab flux points into a single file
and change columns to energy and flux.
As input copy the `crab` folder with `*.ipac` files
from Rolf Buehler into the working directory.
Summary of output:
$ stilts tpipe crab_mwl.fits omode=stats
Total Rows: 437
+--------------------+---------------+--------------+--------------+-------------+------+
| column | mean | stdDev | min | max | good |
+--------------------+---------------+--------------+--------------+-------------+------+
| energy | 698762.06 | 4776016.5 | 2.928466E-13 | 7.4997296E7 | 437 |
| energy_flux | -0.002919502 | 0.06096109 | -1.2758244 | 3.47928E-8 | 437 |
| energy_flux_err_lo | 3.2466577E-10 | 6.804524E-10 | 0.0 | 3.3667E-9 | 393 |
| energy_flux_err_hi | 3.2521535E-10 | 6.803111E-10 | 0.0 | 3.3666E-9 | 393 |
| energy_flux_err | 3.2494055E-10 | 6.803782E-10 | 0.0 | 3.36665E-9 | 393 |
| component | | | | | 437 |
| paper | | | | | 437 |
+--------------------+---------------+--------------+--------------+-------------+------+
$ gzip crab_mwl.fits
$ cp crab_mwl.fits.gz ../gammapy/datasets/data/tev_spectra/
"""
from glob import glob
import numpy as np
from astropy import table
from astropy.table import Table, vstack
import astropy.units as u
from astropy.units import Quantity
def get_combined_table():
"""Combine information from all tables in a single table
(they already all have the same column names, unit, format)
"""
filenames = glob('crab/*/*.ipac')
tables = []
for filename in filenames:
table = Table.read(filename, format='ascii.ipac')
tokens = filename.split('/')
table['component'] = tokens[-2]
table['paper'] = tokens[-1].replace('_vFv.ipac', '')
tables.append(table)
table = vstack(tables)
print('INFO: Found {0} files with {1} flux points.'.format(len(filenames), len(table)))
return table
def remove_flare_data(table):
"""Most users will not need the Crab flare SED measurements
and they have lots of upper limits ... remove for now.
"""
papers = ['agile_sept2007', 'chandra_april2011',
'fermi_7max_april11', 'fermi_bb4_march2013',
'fermi_feb2009', 'fermi_sept2010']
mask = np.array([paper not in papers for paper in table['paper']])
print('WARNING: Removing {0} datasets with {1} flux points.'
''.format(len(papers), np.invert(mask).sum()))
table = table[mask]
# We don't care for these columns
columns = ['TS', 'Npred', 'ulim_vFv']
print('WARNING: Removing columns: {0}'.format(columns))
table.remove_columns(columns)
return table
def combine_columns(table):
"""Combine vFv error information.
At the moment it's scattered across multiple columns.
We want the `ed_vFv` and `eu_vFv` columns to be filled for all rows.
"""
mask = table['ed_vFv'].mask
table['ed_vFv'][mask] = table['vFv'][mask] - table['d_vFv'][mask]
mask = table['ed_vFv'].mask
table['ed_vFv'][mask] = table['e_vFv'][mask]
mask = table['eu_vFv'].mask
table['eu_vFv'][mask] = table['u_vFv'][mask] - table['vFv'][mask]
mask = table['eu_vFv'].mask
table['eu_vFv'][mask] = table['e_vFv'][mask]
# TODO: I'm getting weird results for the following attempts
# to remove or mask incorrect data.
# It's either bugs in Table mask handling or a lack of understanding
# how it works on my part ... don't have time to investigate now.
# veron_vFv.ipac should have had missing value entries
mask = table['paper'].filled('a') == 'veron'
table['ed_vFv'].mask[mask] = True
table['eu_vFv'].mask[mask] = True
# Remove upper limits
#import IPython; IPython.embed()
#mask = table['eu_vFv'].filled(1) == 0
#print('WARNING: Removing {0} rows with missing `eu_vFv`:\n{1}'
# ''.format(mask.sum(), table[mask]['paper']))
#table = table[~mask]
return table
def clean_up(table_in):
"""Create a new table with exactly the columns / info we want.
"""
table = Table()
v = Quantity(table_in['v'].data, table_in['v'].unit)
energy = v.to('MeV', equivalencies=u.spectral())
table['energy'] = energy
#vFv = Quantity(table['vFv'].data, table['vFv'].unit)
#flux = (vFv / (energy ** 2)).to('cm^-2 s^-1 MeV^-1')
table['energy_flux'] = table_in['vFv']
table['energy_flux_err_lo'] = table_in['ed_vFv']
table['energy_flux_err_hi'] = table_in['eu_vFv']
# Compute symmetrical error because most chi^2 fitters
# can't handle asymmetrical Gaussian erros
table['energy_flux_err'] = 0.5 * (table_in['eu_vFv'] + table_in['ed_vFv'])
table['component'] = table_in['component']
table['paper'] = table_in['paper']
mask = table['energy_flux_err_hi'] == 0
return table
def table_info(table, label):
# Print basic info to console
print('\n*** {0} ***'.format(label))
print('Rows: {0}'.format(len(table)))
print('Columns: {0}'.format(table.colnames))
print('')
# Save to file for debugging
filename = 'crab_mwl_{0}.ipac'.format(label)
print('INFO: Writing {0}'.format(filename))
table.write(filename, format='ascii.ipac')
if __name__ == '__main__':
table = get_combined_table()
table_info(table, 'get_combined_table')
table = remove_flare_data(table)
table_info(table, 'remove_flare_data')
table = combine_columns(table)
table_info(table, 'combine_columns')
table = clean_up(table)
table_info(table, 'clean_up')
filename = 'crab_mwl.fits'
print('INFO: Writing {0}'.format(filename))
table.write(filename, overwrite=True)
Title: Gammapy 0.7 release
Dear colleagues,
we are happy to announce the release of Gammapy 0.7.
Gammapy is an open-source Python package for gamma-ray astronomy built on Numpy and Astropy.
It is a prototype for the Cherenkov Telescope Array (CTA) science tools,
and can also be used to analyse data from existing gamma-ray telescopes.
You can find a "what's new" summary and changelog for Gammapy 0.7 here:
http://docs.gammapy.org/dev/changelog.html#gammapy-0p7-release
If you use conda or pip, you can upgrade to this latest stable version using:
conda install -c conda-forge gammapy
pip install gammapy --upgrade
To learn more about Gammapy:
* http://gammapy.org/ (project information, contacts, news)
* http://docs.gammapy.org/stable/ (documentation)
* http://docs.gammapy.org/stable/tutorials.html (tutorials; best place to get started)
If you have any questions or issues, please see let us know!
( see http://gammapy.org/contact.html )
Christoph for the Gammapy team
Title: Gammapy 0.8 release
Dear colleagues,
we are happy to announce the release of Gammapy 0.8.
Gammapy is an open-source Python package for gamma-ray astronomy built on Numpy and Astropy.
It is a prototype for the Cherenkov Telescope Array (CTA) science tools,
and can also be used to analyse data from existing gamma-ray telescopes.
This release contains a big change: the new gammapy.maps is used for all
map-based analysis (2D images and 3D cubes with an energy axis). It also
contains a first version of new classes for modeling and fitting of 3D cubes.
Please see the tutorial notebooks to learn about the new maps and modeling.
If you have any issues or questions, please get in touch!
You can find a "what's new" summary and changelog for Gammapy 0.8 here:
http://docs.gammapy.org/dev/changelog.html#gammapy-0p8-release
If you use conda or pip, you can upgrade to this latest stable version using:
conda install -c conda-forge gammapy
pip install gammapy --upgrade
To learn more about Gammapy:
* http://gammapy.org/ (project information, contacts, news)
* http://docs.gammapy.org/stable/ (documentation)
* http://docs.gammapy.org/stable/tutorials.html (tutorials; best place to get started)