Skip to content

Gammapy simulations #12

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

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open

Gammapy simulations #12

wants to merge 41 commits into from

Conversation

IevgenVovk
Copy link
Collaborator

Support for simulations via gammapy. Automatic generation of the runs following the specified constraints with selection of the appropriate IRF from the library.

Run as

simdl3 --config=cfg.yaml

Example config file:

io:
    out: 'dl3/'
irf:
    files: 'irf/irf_node_corsika_theta_*fits'
    search_radius: 
rungen:
    type: 'fixed_altaz'
    pointing:
        center:
            ra: '306.9 deg'
            dec: '41.3 deg'
            alt: '70 deg'
        width: '15 deg'
    box:
        alt:
            min: '20 deg'
            max: '90 deg'
        az:
            min: '0 deg'
            max: '360 deg'
    time: 
        start: '2022-05-31'
        duration: '12.0 hr'
        max_run_duration: '120 min'
        accuracy: '1 min'
    location:
        lon: '-17.890659 deg'
        lat: '28.761758 deg'
        height: '2200 m'
model:
    components:
    - name: bkg
      type: FoVBackgroundModel
      datasets_names:
      - sim-dataset
      spectral:
        type: PowerLawNormSpectralModel
        parameters:
        - name: norm
          value: 1.0
        - name: tilt
          value: 0.0
        - name: reference
          value: 1.0
          unit: TeV

    # https://ui.adsabs.harvard.edu/abs/2023A%26A...670A...8M/abstract
    - name: gamma_Cygni_shell
      type: SkyModel
      spatial:
        type: DiskSpatialModel
        parameters:
          - name: lon_0
            frozen: true
            unit: 'deg'
            value: 305.30
          - name: lat_0
            frozen: true
            unit: 'deg'
            value: 40.43
          - name: r_0
            frozen: true
            unit: 'deg'
            value: 0.53
          - name: e
            frozen: true
            value: 0.0  
          - name: phi
            frozen: true
            unit: 'deg'
            value: 0.0
          - name: edge_width
            frozen: true
            value: 0.01
          - name: frame
            value: icrs
      spectral:
        type: PowerLawSpectralModel
        parameters:
          - name: index
            frozen: false
            unit: ''
            value: 2.55
          - name: amplitude
            frozen: false
            scale: 1e-12
            unit: cm-2 s-1 TeV-1
            value: 10.0e-13
          - name: reference
            frozen: true
            unit: TeV
            value: 1.0

enforcement to the end to avoid artifical split into very short runs
when requested observation time is short (within one day).
properties to allow generalization of the predict() call.
@HealthyPear
Copy link
Member

I think this goes on the line of what I started to do in cta-observatory/iact-estimator#33 even though there I was doing it for a 1D analysis using faked counts and not simulating the entire run with the observation event sampler (also because you cannot use that to simulate observations for 1D analysis only 3D, but I guess you do not care about that use case here, and anyway given enough statistics you can get a 1D data set by slicing a 3D one)

I do not know the details that brought you to develop this PR, but why faking counts was not enough? do you need to add specific timing information to the simulated runs? it was my understandig that the observation event sampler was a bit of an overpowered solution unless you need to simulated e.g. a transient or something flaring but maybe I remember wrongly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants