These simulator functions are used to set up and run simulations in gateau.
More...
Functions | |
| None | gateau.simulator.simulator.initialise (self, float t_obs, float az0, float el0, Union[Callable, tuple] scan_func, dict[str, any] instrument_dict, dict[str, any] telescope_dict, dict[str, any] atmosphere_dict, dict[str, any] source_dict, Union[list[dict[str, any]], str] cascade_list, str cascade_yaml="cascade.yaml", bool use_cib=True) |
| Initialise a gateau setup. More... | |
| None | gateau.simulator.simulator.run (self, Union[str, Path] outname="out", bool overwrite=False, str outscale="Tb", int seed=0, bool use_photon_noise=True, bool use_rad_trans=True, bool use_pink_noise=None, bool dry_run=False) |
| Run a gateau simulation. More... | |
These simulator functions are used to set up and run simulations in gateau.
| None gateau.simulator.simulator.initialise | ( | self, | |
| float | t_obs, | ||
| float | az0, | ||
| float | el0, | ||
| Union[Callable, tuple] | scan_func, | ||
| dict[str, any] | instrument_dict, | ||
| dict[str, any] | telescope_dict, | ||
| dict[str, any] | atmosphere_dict, | ||
| dict[str, any] | source_dict, | ||
| Union[list[dict[str, any]], str] | cascade_list, | ||
| str | cascade_yaml = "cascade.yaml", |
||
| bool | use_cib = True |
||
| ) |
Initialise a gateau setup.
THis function needs to be called before running a simulation. Here, a lot of intermediary user-supplied quantities are converted into quantities used by gateau.
| t_obs | Total observation time for simulation, in seconds. |
| az0 | Central azimuth value for the scan pattern, in degrees. |
| el0 | Central elevation value for the scan pattern, in degrees. |
| scan_func | Function handle of the function defining the scan pattern. First argument must be a Numpy array consisting of timestamps. Second and third argument must be scalars or Numpy arrays containing central azimuth and elevation values, respectively. This parameter can also be a tuple containing three arrays in the following order: (az, el, t), with az being an array with azimuth coordinates, in degrees, el an array with elevation coordinates, in degrees, and t an array with time coordinates. In this way it is possible to import an observing plan. Then, gateau will internally interpolate az and el on the timestamps set by t_obs and the smapling frequency. |
| instrument_dict | Dictionary containing instrument specification. |
| telescope_dict | Dictionary containing telescope specification. |
| atmosphere_dict | Dictionary containing atmosphere specification. |
| source_dict | Dictionary containing source specification. |
| cascade_list | List containing the cascade to be used. Can also be a string containg the path to the folder containing a cascade .yaml file. |
| cascade_yaml | Name of .yaml file containing cascade. Only used if 'cascade_list' is a string containing a folder with a cascade .yaml. Defaults to 'cascade.yaml'. |
| use_cib | Whether to add cosmic infrared background (CIB) monopole as background for cascade. Engaging this adds a single-moded modified blackbody to the CMB signal. |
| None gateau.simulator.simulator.run | ( | self, | |
| Union[str, Path] | outname = "out", |
||
| bool | overwrite = False, |
||
| str | outscale = "Tb", |
||
| int | seed = 0, |
||
| bool | use_photon_noise = True, |
||
| bool | use_rad_trans = True, |
||
| bool | use_pink_noise = None, |
||
| bool | dry_run = False |
||
| ) |
Run a gateau simulation.
This is the main routine of gateau and should be called after filling all dictionaries and running the 'initialise' method. The three arguments starting with 'use_...' are useful for debugging or characterisation of gateau. For regular simulations, these should not be changed. The final argument allows for a "dry run" of gateau. This allows for a simulation to run without storing output, which can be handy for performance profiling.
| outname | Name of output hdf5 file. If a path, will place output in the path. Defaults to 'out', which will place the output in 'out.hdf5' in your working directory. |
| overwrite | Whether to overwrite existing output directories. If False (default), a prompt will appear to either overwrite or terminate simulation. |
| outscale | Store output in brightness temperature [K] or power [W]. Accepts "Tb" or "P". Defaults to "Tb". |
| seed | Seed for photon and pink noise generation. Defaults to 0, which will internally be converted to a random seed using the current time. |
| use_photon_noise | Enable photon noise calculation. Useful for debugging. Defaults to True, which enables photon noise. |
| use_rad_trans | Enable radiative transfer to calculate received power from sky. Defaults to True, which enables the radiative transfer. |
| use_pink_noise | Enable pink noise calculation. This toggle is extra, because setting the "pink_level" field in the instrument dictionary already decides whether or not to use pink noise. This toggle is just here to explicitly enable/disable it, even when the field is set. Defaults to None, which will leave the decision whether or not to enable pink noise to whether or not the "pink_level" field is filled. |
| dry_run | Whether to run the simulation dry (no output stored to disk) or not (output stored to disk). This option can be used when profiling gateau performance for scaling, in which case the output does not have to be stored and only timing is important. Defaults to False, which will enable gateau to write output to disk. |