SatAndLight  2.2.2-hubble
Simulation toolkit for space telescopes
SatAndLight File Structure

Classes of SatAndLight are designed to save the result of a simulation in a ROOT file. These data are usually saved in a ROOT TTree in which the simulation output is distributed in branches. Specific classes are meant to read these data. For example, the Camera class offers functions to save pictures in a TTree in a ROOT file. Then the class CameraRead is used to read this TTree on disk to access the camera pictures in a ROOT file.

Sections below explain the file structure for the main classes of SatAndLight.

Camera pictures

Description

When a Camera object is created, it is usually meant to take pictures. These pictures can be saved in a TTree in a ROOT file. Each entry of the TTree is associated to a picture. Each picture comes with additional data characterizing the conditions in which the picture was taken: the camera pixel intrinsic noise, the camera size, the time of the picture and so on. Here is the typical functions you should call using your MyCamera Camera object:

// open a TFile
TFile *MyOutputFile = new TFile("./myfile.root","recreate");
MyOutputFile->cd();

// initialize the TTree
MyCamera->TreeInit();

// simulate your image...

// save your image (fill the TTree)
MyCamera->TreeFill();

// simulate more images and save them with TreeFill()

// save your TTree in the open TFile
MyCamera->TreeWrite();

// close the file
MyOutputFile->Close();

You can simulate as many camera images as you need and you can save them by calling Camera::TreeFill() for each of them.

The camera images saved in one or several ROOT files can be loaded using the CameraRead class.

File structure

The TTree generated by the Camera class is structured with the following branches:

  • cam_map_amplitude (TH2S): this is the camera picture represented by a 2-dimensional histogram.
  • cam_map_darknoise (TH2S): this is the camera pixel dark noise map represented by a 2-dimensional histogram.
  • cam_map_readnoise (TH2S): this is the camera pixel read noise map represented by a 2-dimensional histogram.
  • cam_map_gain (TH2F): this is the camera pixel gain map represented by a 2-dimensional histogram. The gain is used to convert the pixel raw amplitude to a calibrated energy.
  • cam_nbits (int): number of bits to encode the pixel raw amplitude.
  • cam_xsize (double): camera size in the X direction (or thickness) in [mm].
  • cam_ysize (double): camera size in the Y direction in [mm].
  • cam_zsize (double): camera size in the Z direction in [mm].
  • cam_time (unsigned long int): picture time in [ms].
  • cam_dt (unsigned int): camera integration time in [ms].
  • cam_hitn (int): number of particle hits in the picture.
  • cam_hitsrc (int[cam_hitn]): list of source indices associated to the particle hits.
  • cam_hitastro (int[cam_hitn]): list of particle indices associated to the particle hits.
  • cam_hity (double[cam_hitn]): list of Y positions associated to the particle hits.
  • cam_hitz (double[cam_hitn]): list of Z positions associated to the particle hits.

Astrophysical sources

Description

Astrophysical sources are simulated using the Source class. The result of a simulation is saved in 2 TTree structures. The first TTree contains a single entry and summarizes the source properties (type, position, flux, size...). The second one constains all the astro-particles generated for this source.

The methods offered by the Source class to manage the TTree structures is very much similar to the Camera class. After opening a TFile, you need to call Source::TreeInit() which creates the trees. This is where the source properties are saved and they can no longer be modified after that (unless you open a new file). So, you must make sure that your source is entirely configured before calling Source::TreeInit(). The astro-particle TTree is created. Then it is filled with particles when you call Source::GenerateAstroParticles(). Finally the trees are saved to disk when calling Source::TreeWrite(), after what the file can be closed.

The source properties, as well as the simulated astro-particles, saved in one or several ROOT files can be loaded using the SourceRead class.

File structure

Two TTree structures are generated by the Source class:

  • Source properties, name = [SOURCE_NAME], one single entry:
  • Astro-particles, name = [SOURCE_NAME]_astro, one particle = one entry:
    • astro_time (unsigned long int): this is the particle time [ms].
    • astro_thetap (double): this is the particle \(\theta'_p\) position angle [rad].
    • astro_phip (double): this is the particle \(\varphi'_p\) position angle [rad].
    • astro_energy (double): this is the particle energy [keV].

Telescopes

Description

A telescope structure is quite complex. On top of specific parameters, it includes one camera object as well as multiple astrophysical sources. The Telescope class internally organizes all the derived TTree structures inside a TDirectory named after the telescope. The camera TTree, described in the camera section, is named: [TELESCOPE_NAME]_cam. Several source structures are saved in the telescope directory. The source trees, described in the source section, are saved as is, since sources have a unique name. Finally the Telescope class generates its own TTree, named after the telescope and with a single entry, to save the telescope-specific parameters (point spread function, focal length...).

The user should not deal with all the individual components (camera, sources...) to save the simulation in TTree structures. Instead, these steps should be followed:

  • Configure your telescope and all individual elements: camera, astrophysical sources...
  • Open a TFile object.
  • Call Telescope::StartObservation() passing the TFile pointer in argument. This function creates the typical telescope directory structure and initiates all the TTree structures.
  • Call Telescope::TakePicture() multiple times to take a sequence of pictures with your telescope. Your images and the associated parameters are automatically saved.
  • Call Telescope::StopObservation() to close your observation sequence. All TTree structures are saved in the file. After this, the sequence TFile can be safely closed.

The entire telescope simulation, saved in one or several ROOT files can be loaded using the TelescopeRead class.

File structure

A TDirectory is created and named after the telescope. Hence, multiple telescopes can be simulated simultaneously and saved in the same file. The image below shows a typical example of a Telescope file structure. There are two telescopes named "TEL1" and "TEL2".

Example of a file structure associated to 2 telescopes: TEL1 and TEL2.

The directory of "TEL1" contains six TTree structures:

Note
The mapping between the telescope parameters and the sources is done through the source name.

Satellite observation sequence

Description

A Satellite object is the master object to drive a SatAndLight simulation. It should be seen as a collection of telescopes associated to a clock and a flight sequence (position). When working with a Satellite object, the user does not have to worry about the file organization. Only the output directory and the file duration have to be specified. When a running a sequence (Satellite::RunSequence()), the class object manages all the telescopes and takes pictures as specified in the configuration.

The entire simulation, saved in one or several ROOT files can be loaded using the SatelliteRead class.

File structure

The file structure is described in the file structure section for telescopes.

Warning
The satellite clock is only recorded at the Camera level. Each camera, with its own time resolution, records the telescope (hence the satellite) position. It means that the satellite position time resolution can be reduced if the cameras work with a lower resolution.