gammapy/enrico — pull request #46 by zblz (2013-09-24 16:25:22+00:00)
Title: FoldedLC

I had a free hour this afternoon and tried to adapt yesterday's David's changes so that it would be easier to generate a folded lightcurve without writing a new class. After careful examination, I have found it to be quite easy working on David's additions. This pull request is so we can comment on an actual implementation, but it is not finished yet.

Main changes are:

* Added a `FoldedLC` path to `enrico.constants`
* Added a `self.folded` boolean flag to `LightCurve` that gets activated if there is more than one gtifile. This flag is used to:
* Change the output directory to `enrico.constants.FoldedLC`
* Set the plot's abcissa to the orbital phase array instead of tmin, tmax.
* Change plot limits to `xmin=0`, `xmax=1` and plot xlabel to `Orbital Phase`
* Added a `utils.FoldedLC_gtifiles` function that generates all the gtifiles needed for the folded LC and returns them as a single comma-separated string ready to be given to `LightCurve`

Still missing:

* `enrico_foldedlc` and `enrico_plot_foldedlc` scripts: Should be very easy.
* Add relevant options to `default.conf`: Very easy too.

@davidsanchez, @cdeil, what do you think?