New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS map calculation update and docs #221

Merged
merged 2 commits into from Dec 15, 2014

Conversation

Projects
None yet
2 participants
@adonath
Member

adonath commented Dec 12, 2014

Modified command line tool to work with different pixels sizes. Added some documentation and brief tutorial.

Show outdated Hide outdated gammapy/image/utils.py Outdated
Show outdated Hide outdated docs/detect/index.rst Outdated
@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Dec 12, 2014

Member

I would prefer to have the 63kB file ./docs/detect/fermi_survey_ts.png removed from the repo and Sphinx page and instead for nice plots point people to the IPython notebook. OK?

Member

cdeil commented Dec 12, 2014

I would prefer to have the 63kB file ./docs/detect/fermi_survey_ts.png removed from the repo and Sphinx page and instead for nice plots point people to the IPython notebook. OK?

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Dec 12, 2014

Member

This will make the Sphinx build fail on travis-ci:

/Users/deil/code/gammapy/docs/detect/index.rst:89: SEVERE: Title level inconsistent:

gammapy.detect Module
---------------------

checking consistency... /Users/deil/code/gammapy/docs/api/gammapy.image.shape_2N.rst:: WARNING: document isn't included in any toctree
done

Member

cdeil commented Dec 12, 2014

This will make the Sphinx build fail on travis-ci:

/Users/deil/code/gammapy/docs/detect/index.rst:89: SEVERE: Title level inconsistent:

gammapy.detect Module
---------------------

checking consistency... /Users/deil/code/gammapy/docs/api/gammapy.image.shape_2N.rst:: WARNING: document isn't included in any toctree
done

Show outdated Hide outdated docs/detect/index.rst Outdated
.. code:: bash
$ gammapy-ts-image all.fits.gz --threshold 0 --scale 0 --residual --model model.fits.gz

This comment has been minimized.

@cdeil

cdeil Dec 12, 2014

Member

This errors on Python 3:

$ gammapy-ts-image all.fits.gz --threshold 0 --scale 0
WARNING: AstropyDeprecationWarning: Use of an 'eval' method when defining subclasses of FittableModel is deprecated; please rename this method to 'evaluate'.  Otherwise its semantics remain the same. [astropy.modeling.core]
WARNING - AstropyDeprecationWarning: Use of an 'eval' method when defining subclasses of FittableModel is deprecated; please rename this method to 'evaluate'.  Otherwise its semantics remain the same.
INFO - Reading all.fits.gz
INFO - Computing (residual) TS map for scale 0.0 deg
INFO - Using down sampling factor of 1
INFO - No down sampling used.
INFO - Using correlation radius of 6.5 pix to estimate initial flux.
INFO - Using 8 cores to compute TS map.
Traceback (most recent call last):
  File "/Users/deil/Library/Python/3.4/bin/gammapy-ts-image", line 4, in <module>
    __import__('pkg_resources').run_script('gammapy==0.2.dev1086', 'gammapy-ts-image')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 517, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 1436, in run_script
    exec(code, namespace, namespace)
  File "/Users/deil/Library/Python/3.4/lib/python/site-packages/gammapy-0.2.dev1086-py3.4.egg/EGG-INFO/scripts/gammapy-ts-image", line 102, in <module>
    logging.info('TS map computation took {0:.1f} s'.format(ts_results.runtime))
TypeError: non-empty format string passed to object.__format__
In [4]: type(ts_results.runtime)
Out[4]: NoneType
@cdeil

cdeil Dec 12, 2014

Member

This errors on Python 3:

$ gammapy-ts-image all.fits.gz --threshold 0 --scale 0
WARNING: AstropyDeprecationWarning: Use of an 'eval' method when defining subclasses of FittableModel is deprecated; please rename this method to 'evaluate'.  Otherwise its semantics remain the same. [astropy.modeling.core]
WARNING - AstropyDeprecationWarning: Use of an 'eval' method when defining subclasses of FittableModel is deprecated; please rename this method to 'evaluate'.  Otherwise its semantics remain the same.
INFO - Reading all.fits.gz
INFO - Computing (residual) TS map for scale 0.0 deg
INFO - Using down sampling factor of 1
INFO - No down sampling used.
INFO - Using correlation radius of 6.5 pix to estimate initial flux.
INFO - Using 8 cores to compute TS map.
Traceback (most recent call last):
  File "/Users/deil/Library/Python/3.4/bin/gammapy-ts-image", line 4, in <module>
    __import__('pkg_resources').run_script('gammapy==0.2.dev1086', 'gammapy-ts-image')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 517, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 1436, in run_script
    exec(code, namespace, namespace)
  File "/Users/deil/Library/Python/3.4/lib/python/site-packages/gammapy-0.2.dev1086-py3.4.egg/EGG-INFO/scripts/gammapy-ts-image", line 102, in <module>
    logging.info('TS map computation took {0:.1f} s'.format(ts_results.runtime))
TypeError: non-empty format string passed to object.__format__
In [4]: type(ts_results.runtime)
Out[4]: NoneType

This comment has been minimized.

@cdeil

cdeil Dec 12, 2014

Member

Another error from the command line tool on Python 3:

$ gammapy-ts-image all.fits.gz --threshold 0 --scale 0
WARNING: AstropyDeprecationWarning: Use of an 'eval' method when defining subclasses of FittableModel is deprecated; please rename this method to 'evaluate'.  Otherwise its semantics remain the same. [astropy.modeling.core]
WARNING - AstropyDeprecationWarning: Use of an 'eval' method when defining subclasses of FittableModel is deprecated; please rename this method to 'evaluate'.  Otherwise its semantics remain the same.
INFO - Reading all.fits.gz
INFO - Computing (residual) TS map for scale 0.0 deg
INFO - Using down sampling factor of 1
INFO - No down sampling used.
INFO - Using correlation radius of 6.5 pix to estimate initial flux.
INFO - Using 8 cores to compute TS map.
INFO - Writing ts_map_0.00.fits
Traceback (most recent call last):
  File "/Users/deil/Library/Python/3.4/bin/gammapy-ts-image", line 4, in <module>
    __import__('pkg_resources').run_script('gammapy==0.2.dev1086', 'gammapy-ts-image')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 517, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 1436, in run_script
    exec(code, namespace, namespace)
  File "/Users/deil/Library/Python/3.4/lib/python/site-packages/gammapy-0.2.dev1086-py3.4.egg/EGG-INFO/scripts/gammapy-ts-image", line 123, in <module>
    dict_to_hdulist(results, maps['ExpGammaMap'].header).writeto(filename, clobber=args.clobber)
  File "/Users/deil/Library/Python/3.4/lib/python/site-packages/gammapy-0.2.dev1086-py3.4.egg/gammapy/image/utils.py", line 391, in dict_to_hdulist
    for name, image in image_dict.iteritems():
AttributeError: 'OrderedDict' object has no attribute 'iteritems'

You can get a simultaneous Python 2 and 3 installation from apt-get or conda for local testing.

@cdeil

cdeil Dec 12, 2014

Member

Another error from the command line tool on Python 3:

$ gammapy-ts-image all.fits.gz --threshold 0 --scale 0
WARNING: AstropyDeprecationWarning: Use of an 'eval' method when defining subclasses of FittableModel is deprecated; please rename this method to 'evaluate'.  Otherwise its semantics remain the same. [astropy.modeling.core]
WARNING - AstropyDeprecationWarning: Use of an 'eval' method when defining subclasses of FittableModel is deprecated; please rename this method to 'evaluate'.  Otherwise its semantics remain the same.
INFO - Reading all.fits.gz
INFO - Computing (residual) TS map for scale 0.0 deg
INFO - Using down sampling factor of 1
INFO - No down sampling used.
INFO - Using correlation radius of 6.5 pix to estimate initial flux.
INFO - Using 8 cores to compute TS map.
INFO - Writing ts_map_0.00.fits
Traceback (most recent call last):
  File "/Users/deil/Library/Python/3.4/bin/gammapy-ts-image", line 4, in <module>
    __import__('pkg_resources').run_script('gammapy==0.2.dev1086', 'gammapy-ts-image')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 517, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 1436, in run_script
    exec(code, namespace, namespace)
  File "/Users/deil/Library/Python/3.4/lib/python/site-packages/gammapy-0.2.dev1086-py3.4.egg/EGG-INFO/scripts/gammapy-ts-image", line 123, in <module>
    dict_to_hdulist(results, maps['ExpGammaMap'].header).writeto(filename, clobber=args.clobber)
  File "/Users/deil/Library/Python/3.4/lib/python/site-packages/gammapy-0.2.dev1086-py3.4.egg/gammapy/image/utils.py", line 391, in dict_to_hdulist
    for name, image in image_dict.iteritems():
AttributeError: 'OrderedDict' object has no attribute 'iteritems'

You can get a simultaneous Python 2 and 3 installation from apt-get or conda for local testing.

Show outdated Hide outdated scripts/gammapy-ts-image Outdated
Show outdated Hide outdated scripts/gammapy-ts-image Outdated
@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Dec 12, 2014

Member

I've left quit a few comments inline above ... let me know when I should have another look ... hopefully we can get this merged quickly!

Member

cdeil commented Dec 12, 2014

I've left quit a few comments inline above ... let me know when I should have another look ... hopefully we can get this merged quickly!

Show outdated Hide outdated docs/detect/index.rst Outdated
Show outdated Hide outdated docs/detect/index.rst Outdated
Show outdated Hide outdated docs/detect/index.rst Outdated
@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Dec 15, 2014

Member

Travis-ci fails are unrelated ... merging this now.

Member

cdeil commented Dec 15, 2014

Travis-ci fails are unrelated ... merging this now.

cdeil added a commit that referenced this pull request Dec 15, 2014

@cdeil cdeil merged commit d212a64 into gammapy:master Dec 15, 2014

0 of 2 checks passed

continuous-integration/appveyor AppVeyor build failed
Details
continuous-integration/travis-ci The Travis CI build failed
Details

@cdeil cdeil changed the title from TS map calculator update and docs to TS map calculation update and docs Apr 8, 2015

@cdeil cdeil added the feature label Apr 8, 2015

@cdeil cdeil added this to the 0.2 milestone Apr 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment