Scene Generation models#

Scene generation models are used to add a scene to the Scene data structure inside the Detector object. The values in the Scene array represent flux per wavelength and area, i.e. number of photons per nanometer per area per second.

Note

If you use a model in Scene generation, the Scene data bucket is initialized and you can use function display_scene().

Create and Store a detector#

The models Save detector and Load detector to respectively create and store a Detector to/from a file.

These models can be used when you want to store or to inject a Detector into the current Pipeline.

Save detector#

This model saves the current Detector into a file. Accepted file formats are .h5, .hdf5, .hdf and .asdf.

- name: save_detector
  func: pyxel.models.save_detector
  enabled: true
  arguments:
    filename: my_detector.h5
pyxel.models.save_detector(detector, filename)[source]

Save the current detector into a file.

Load detector#

This model loads a Detector from a file and injects it in the current pipeline. Accepted file formats are .h5, .hdf5, .hdf and .asdf.

- name: load_detector
  func: pyxel.models.load_detector
  enabled: true
  arguments:
    filename: my_detector.h5
pyxel.models.load_detector(detector, filename)[source]

Load a new detector from a file.

Raises:

TypeError – If the loaded detector has not the same type of the current detector.

Load star map#

SceneScene

Generate a scene from ScopeSim source object loading objects from the GAIA catalog for given coordinates and FOV.

Example of the configuration file:

- name: load_star_map
  func: pyxel.models.scene_generation.load_star_map
  enabled: true
  arguments:
    right_ascension: 56.75 # deg
    declination: 24.1167 # deg
    fov_radius: 0.5 # deg

Note

You can find an example of this model in this Jupyter Notebook Scene generation and projection from Pyxel Data.

pyxel.models.scene_generation.load_star_map(detector, right_ascension, declination, fov_radius, band='blue_photometer', with_caching=True)[source]#

Generate scene from scopesim Source object loading stars from the GAIA catalog.

Parameters:
  • detector (Detector) – Pyxel Detector object.

  • right_ascension (float) – RA coordinate in degree.

  • declination (float) – DEC coordinate in degree.

  • fov_radius (float) – FOV radius of telescope optics.

  • band ('blue_photometer', 'gaia_band' or 'red_photometer') – Define the band to use. Available values:

    • ‘blue_photometer’ is the band from 330 nm to 680 nm

    • ‘gaia_band’ is the band from 330 nm to 1050 nm

    • ‘red_photometer’ is the band from 640 nm to 1050 nm

  • with_caching (bool) – Enable/Disable caching request to GAIA catalog.

Notes

For more information, you can find an example here: Scene generation and projection.