Skip to content
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 light curve flare tutorial notebook #2594



Copy link

JouvinLea commented Nov 21, 2019

This PR create a logbook to explain how to perform a LC on smaller bin than an observation duration.
It shows extract the list of observations from given time_intervals, how to reduce the data in those intervals and estimate the LC .

Current version: here

@cdeil cdeil added the docs label Nov 21, 2019
@cdeil cdeil added this to In Progress in DOCUMENTATION via automation Nov 21, 2019
@cdeil cdeil added this to the 0.15 milestone Nov 21, 2019

This comment has been minimized.

Copy link

cdeil commented Nov 22, 2019

@JouvinLea - Thanks!

Can you please shorten the notebook title?

Light curve estimation on time bin smaller than the duration of each observation

See navbar on the left here. The idea is that notebook titles and section headings are a few words, and can be visible in the navbar.

Maybe "Light curves - Flare"?

Same for all the section titles, they should be very short and clear and not too many different levels (I think currently you have 4 different levels, that won't fit in the navbar).

For the time intervals, I'd suggest to write it like this, it's a little bit shorter:

time_intervals = [
    ["2004-12-04T22:00", "2004-12-04T22:15"],
    ["2004-12-04T22:15", "2004-12-04T22:30"],
    ["2004-12-04T22:30", "2004-12-04T22:45"],
    ["2004-12-04T22:45", "2004-12-04T23:00"],
    ["2004-12-04T23:00", "2004-12-04T23:15"],
    ["2004-12-04T23:15", "2004-12-04T23:30"],
    ["2004-12-06T23:00", "2004-12-06T23:15"],
    ["2004-12-06T23:15", "2004-12-06T23:30"],
    ["2004-12-08T21:45", "2004-12-08T22:00"],
    ["2004-12-08T22:00", "2004-12-08T22:15"],
time_intervals = [Time(_) for _ in time_intervals]

For energy axis and energy grids, I suggest we always us MapAxis.
So never use np.logspace, np.log10, 10**, np.arange, np.linspace, ..., use the helper functions we have. Specifically, in most places, MapAxis.from_energy_bounds can be used, see examples.

The reference to light_curve.ipynb, please use the syntax that will create links for the HTML version, see here

That's just superficial comments, I didn't review this notebook concerning content.


This comment has been minimized.

Copy link

codecov bot commented Nov 22, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@cdaedda). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2594   +/-   ##
  Coverage          ?   91.49%           
  Files             ?      140           
  Lines             ?    15992           
  Branches          ?        0           
  Hits              ?    14632           
  Misses            ?     1360           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdaedda...e2007be. Read the comment docs.

 Please enter the commit message for your changes. Lines starting
Copy link

registerrier left a comment

Thanks @JouvinLea !
The notebook might be reduced a bit by showing only 1D or 3D data reduction. The main light curve.ipynb already shows that you can do it with both, it is not needed here.

Merging now. We'll do the simplification later.

@registerrier registerrier merged commit 40e63b9 into gammapy:master Nov 28, 2019
6 of 10 checks passed
6 of 10 checks passed
gammapy.gammapy #20191126.1 failed
gammapy.gammapy (Test Python36) Test Python36 failed
gammapy.gammapy (Test Windows36) Test Windows36 failed
gammapy.gammapy (Test Windows37) Test Windows37 failed
Codacy/PR Quality Review Up to standards. A positive pull request.
Scrutinizer Analysis: No new issues – Tests: passed
continuous-integration/travis-ci/pr The Travis CI build passed
gammapy.gammapy (DevDocs) DevDocs succeeded
gammapy.gammapy (Lint) Lint succeeded
DOCUMENTATION automation moved this from In Progress to Done Nov 28, 2019
@cdeil cdeil changed the title Notebook to explain how to compute a LC in small time bin Add light curve flare tutorial notebook Nov 28, 2019

This comment has been minimized.

Copy link

cdeil commented Nov 28, 2019

@registerrier - When adding a tutorial notebook, you have to add it to tutorials/notebooks.yaml, and to the toctree and bullet list in docs/tutorials/index.rst, and please also add a link from docs/time/index.rst to this tutorial notebook, and ideally from the two LC notebooks to each other.
I also always run make docs-all and check if the notebook renders OK in HTML.

If we want to iterate and improve the Gammapy documentation quickly, we have to make the content visible at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.