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
Merged

Conversation

@facero
Copy link
Contributor

@facero 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 3 commits Mar 1, 2019
Given a skymodel, geom, pointing and irf the function will return a dataset
Test if counts_map has integers and that maps are not empty.
@Bultako Bultako added the feature label Mar 1, 2019
Copy link
Contributor

@registerrier 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.

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 Show resolved Hide resolved
@registerrier registerrier added this to the 0.11 milestone Mar 1, 2019
@registerrier registerrier added this to To do in gammapy.maps via automation Mar 1, 2019
@adonath
Copy link
Member

@adonath adonath commented Mar 1, 2019

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

gammapy/utils/simulate.py Outdated Show resolved Hide resolved
Moved in gammapy.cube and including changes requested
gammapy/cube/tests/test_simulate.py Outdated Show resolved Hide resolved
gammapy/cube/simulate.py Outdated Show resolved Hide resolved
facero added 2 commits Mar 4, 2019
Also name changed from simulate_3d to simulate_dataset
Fixed random seed and assert_allclose to fixed pixel values
gammapy.maps automation moved this from To do to In progress Mar 4, 2019
Copy link
Member

@adonath adonath left a comment

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

Copy link
Contributor

@registerrier 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
6 of 8 checks passed
gammapy.maps automation moved this from In progress to Done Mar 8, 2019
@facero facero deleted the 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
Labels
Projects
gammapy.maps
  
Done
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants