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 simulate_dataset() convenience function #2064

Merged
merged 7 commits into from Mar 8, 2019

Conversation

4 participants
@facero
Copy link
Contributor

facero commented Mar 1, 2019

Given a skymodel, geom, pointing and irf the function will return a dataset.
This function can then be used in many tutorials and is currently used in the MCMC notebook I'm wokring on.
Of course the function could be more complex but the goal here is to provide a simple simulated observation.

facero added some commits Mar 1, 2019

A convenience function to simulate a dataset
Given a skymodel, geom, pointing and irf the function will return a dataset
Adding test for simulate_3d
Test if counts_map has integers and that maps are not empty.

@Bultako Bultako added the feature label Mar 1, 2019

@registerrier
Copy link
Contributor

registerrier left a comment

Thanks @facero this is a very nice addition.
Thinking about it, it might be better if it is located in gammapy/cube. We already have a class SpectrumSimulation in gammapy/spectrum/simulation.py. We might follow a similar architecture for now and we will see later how to organize better simulation tools.

Show resolved Hide resolved gammapy/utils/simulate.py Outdated
Show resolved Hide resolved gammapy/utils/simulate.py Outdated
Show resolved Hide resolved gammapy/utils/simulate.py Outdated
Show resolved Hide resolved gammapy/utils/simulate.py Outdated
Show resolved Hide resolved gammapy/utils/simulate.py Outdated
Show resolved Hide resolved gammapy/utils/simulate.py Outdated
Show resolved Hide resolved gammapy/utils/tests/test_simulate.py Outdated

@registerrier registerrier added this to the 0.11 milestone Mar 1, 2019

@registerrier registerrier added this to To do in Map analysis via automation Mar 1, 2019

@adonath

This comment has been minimized.

Copy link
Member

adonath commented Mar 1, 2019

@registerrier and @facero I agree it's better to move it to gammapy/cube...

Show resolved Hide resolved gammapy/utils/simulate.py Outdated
Updating simulate.py
Moved in gammapy.cube and including changes requested
Show resolved Hide resolved gammapy/cube/tests/test_simulate.py Outdated
Show resolved Hide resolved gammapy/cube/simulate.py Outdated

facero added some commits Mar 4, 2019

Removed edisp option and added max_radius
Also name changed from simulate_3d to simulate_dataset
changed tests to assert_allclose
Fixed random seed and assert_allclose to fixed pixel values

Map analysis automation moved this from To do to In progress Mar 4, 2019

@adonath
Copy link
Member

adonath left a comment

Thanks, @facero! I have no further comments..

@adonath adonath requested a review from registerrier Mar 5, 2019

@registerrier
Copy link
Contributor

registerrier left a comment

Thanks @facero ! This is really nice. No more comments from my side.

@adonath adonath merged commit 48cec3f into gammapy:master Mar 8, 2019

1 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
Codacy/PR Quality Review Not up to standards. This pull request quality could be better.
Details
Scrutinizer Analysis: 4 updated code elements – Tests: passed
Details

Map analysis automation moved this from In progress to Done Mar 8, 2019

@facero facero deleted the facero:simulate_3d branch Mar 8, 2019

@adonath adonath changed the title A convenience function to simulate a dataset Add simulate_dataset() convenience function Mar 26, 2019

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