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

Add PointingInfo class #545

Merged
merged 1 commit into from Jun 3, 2016

Conversation

Projects
None yet
2 participants
@cdeil
Member

cdeil commented Jun 3, 2016

This PR adds a gammapy.data.PointingInfo class.

I added a test file with a POINTING extension just now here:
https://github.com/gammapy/gammapy-extra/blob/master/test_datasets/hess_event_list.fits
The writing of the spec for this and debugging of the HESS pointing table is still work in progress.

My plan is to add some basic tests and this check in this PR, but then merge and make an issue listing future work (e.g. interpolation of AZ / ALT to arbitrary times, format and content validation).

@cdeil cdeil added the feature label Jun 3, 2016

@cdeil cdeil added this to the 0.5 milestone Jun 3, 2016

@cdeil cdeil self-assigned this Jun 3, 2016

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 3, 2016

Member

😄 100% test coverage for new code. 😄

Member

cdeil commented Jun 3, 2016

😄 100% test coverage for new code. 😄

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 3, 2016

Member

@lmohrmann Do you have time for a quick review of this PR before I merge it?

Member

cdeil commented Jun 3, 2016

@lmohrmann Do you have time for a quick review of this PR before I merge it?

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 3, 2016

Member

I've fixed up a few docstrings and added an example to the class docstring.
Have to move on to other things ... I'm merging this now.

Member

cdeil commented Jun 3, 2016

I've fixed up a few docstrings and added an example to the class docstring.
Have to move on to other things ... I'm merging this now.

@cdeil cdeil merged commit f2926c4 into gammapy:master Jun 3, 2016

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@cdeil cdeil referenced this pull request Jun 3, 2016

Closed

Improve PointingInfo class #548

0 of 6 tasks complete
>>> from gammapy.data import PointingInfo
>>> pointing_info = PointingInfo.read('$GAMMAPY_EXTRA/test_datasets/hess_event_list.fits')
>>> print(pointing_info)

This comment has been minimized.

@JonathanDHarris

JonathanDHarris Jul 23, 2016

Contributor

I have a problem running this code

>>> from gammapy.data import PointingInfo
>>> pointing_info = PointingInfo.read('$GAMMAPY_EXTRA/test_datasets/hess_event_list.fits')
>>> print(pointing_info)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "gammapy/data/pointing.py", line 71, in __str__
    ss += 'Time ref:     {}\n'.format(self.time_ref.fits)
  File "/usr/local/lib/python2.7/dist-packages/astropy-1.0.4-py2.7-linux-x86_64.egg/astropy/time/core.py", line 725, in __getattr__
    return self.__getattribute__(attr)
AttributeError: 'Time' object has no attribute 'fits'
>>> pointing_info
<gammapy.data.pointing.PointingInfo object at 0x7f1c5e2a8990>
>>> pointing_info.time_ref
<Time object: scale='tt' format='mjd' value=51910.0007429>
>>> 
@JonathanDHarris

JonathanDHarris Jul 23, 2016

Contributor

I have a problem running this code

>>> from gammapy.data import PointingInfo
>>> pointing_info = PointingInfo.read('$GAMMAPY_EXTRA/test_datasets/hess_event_list.fits')
>>> print(pointing_info)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "gammapy/data/pointing.py", line 71, in __str__
    ss += 'Time ref:     {}\n'.format(self.time_ref.fits)
  File "/usr/local/lib/python2.7/dist-packages/astropy-1.0.4-py2.7-linux-x86_64.egg/astropy/time/core.py", line 725, in __getattr__
    return self.__getattribute__(attr)
AttributeError: 'Time' object has no attribute 'fits'
>>> pointing_info
<gammapy.data.pointing.PointingInfo object at 0x7f1c5e2a8990>
>>> pointing_info.time_ref
<Time object: scale='tt' format='mjd' value=51910.0007429>
>>> 

This comment has been minimized.

@cdeil

cdeil Jul 30, 2016

Member

Your traceback shows that you're running with Astropy 1.0.4
The fits format for Astropy Time was added in Astropy 1.1.

Please update your Astropy to 1.1 or even better 1.2.

@cdeil

cdeil Jul 30, 2016

Member

Your traceback shows that you're running with Astropy 1.0.4
The fits format for Astropy Time was added in Astropy 1.1.

Please update your Astropy to 1.1 or even better 1.2.

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