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
Improve data and observation handling #457
Conversation
My opinion: I would find it convenient to add methods to this class to get at commonly used stuff, e.g. an empty image for the FOV, or an exposure image, or a background image or ... But where't the limit, i.e. what goes in separate functions and do those take |
Do we want such methods here or as standalone functions that work with obs objects? | ||
""" | ||
|
||
def make_spectrum_observation(self, target_pos, on_radius): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually but classmethods on my classes, i.e. in this case I would have put
SpectrumObservation.from_observation()
But I guess that's a matter of taste. I might be better to have make_object funktions because it's more intuitive from the users' point of view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 to SpectrumObservation.from_observation()
👍 for 'easy' stuff like an empty image For more complicated things I would prefer classes/functions that work with the Observation object (see inline comment) |
64e5c4b
to
73b25ff
Compare
@joleroi @adonath @leajouvin - This PR changes the way the You can now load data like this: from gammapy.data import DataStore
data_store = DataStore.from_dir('$GAMMAPY_EXTRA/datasets/hess-crab4-hd-hap-prod2')
obs = data_store.obs(obs_id=23523)
events = obs.events
aeff = obs.aeff It's now also possible to access the different HD PSFs: psf1 = obs.load(hdu_class='psf_3gauss')
psf2 = obs.load(hdu_class='psf_king') This uses an I'm still not very happy with this. |
Improve data and observation handling
FYI: In the spectrum analysis class I moved on to use only the |
In this case |
I tried removing the live time attribute from the event list: |
No.
If that causes problems / confusion, we could remove the |
Seem like the guy who wrote the spectrum analysis code wasn't consistent. I will have a look today how to change the spectrum analysis code in order to deal with a |
This pull request adds an Observation class to store the events and IRFs for one observation.
@joleroi @adonath @leajouvin Can you please have a look? What do you think?
(I have to go now ... will write this tomorrow morning.)