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 background cube model comparison plot script #347

Merged
merged 2 commits into from Sep 8, 2015

Conversation

Projects
None yet
2 participants
@mapazarr
Member

mapazarr commented Sep 7, 2015

Adding nice true-reco bg cube model comparison plot script to the high-level docs, following the discussion in #338:
#338 (comment)
#338 (comment)
I added a plot to gammapy-extra as suggested. In addition I added 2 fits files (true and reco bg cube models), in order to produce the plot in the docs via a script, without waiting for the re-structuring/integration of gammapy-extra.

I also did some cleanup in the scripts added/modified in #338.

I am not adding an entry to CHANGES log, as the it was recently suggested.

@mapazarr

This comment has been minimized.

Member

mapazarr commented Sep 7, 2015

And another coffee! I mean, green light from travis-ci! (the small green logo really looks like starbucks!).
@cdeil Can you merge it please?

INDEX = 1.5
def power_law(energy, E_0, norm, index):
# get cubes
filename1 = input_file1
filename2 = input_file2
print('filename1', filename1)

This comment has been minimized.

@cdeil

cdeil Sep 7, 2015

Member

Remove print statements

This comment has been minimized.

@mapazarr

mapazarr Sep 7, 2015

Member

Done.

norm = NORM
index = INDEX
plot_data_x = axes[0, 2].get_lines()[0].get_xydata()[:,0]

This comment has been minimized.

@cdeil

cdeil Sep 7, 2015

Member

From a quick look, it seems this code block is repeated four times with just minor variations?
Can you split it out in a utility function that you call four times?

This comment has been minimized.

@mapazarr

mapazarr Sep 7, 2015

Member

Done.

@cdeil

This comment has been minimized.

Member

cdeil commented Sep 7, 2015

I've done a quick review and left some inline comments.
Apart from those, 👍

@mapazarr

This comment has been minimized.

Member

mapazarr commented Sep 7, 2015

Ok, I implemented all comments. Can you merge it now?

@cdeil

This comment has been minimized.

Member

cdeil commented Sep 8, 2015

Thanks!

cdeil added a commit that referenced this pull request Sep 8, 2015

Merge pull request #347 from mapazarr/plots_for_last_gsoc_post
Add nice true-reco bg cube model comparison plot script to the high-level docs

@cdeil cdeil merged commit dd7b89a into gammapy:master Sep 8, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mapazarr

This comment has been minimized.

Member

mapazarr commented Sep 8, 2015

Thanks! I just added an entry to the CHANGES log for this PR.

@mapazarr

This comment has been minimized.

Member

mapazarr commented Sep 8, 2015

@cdeil cdeil added the feature label Sep 9, 2015

@cdeil cdeil added this to the 0.4 milestone Sep 9, 2015

@cdeil cdeil self-assigned this Sep 9, 2015

@cdeil cdeil changed the title from Add nice true-reco bg cube model comparison plot script to the high-level docs to Add background cube model comparison plot script Sep 9, 2015

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