generate_injection_catalog¶
- lsst.source.injection.generate_injection_catalog(ra_lim: Sequence[float], dec_lim: Sequence[float], wcs: SkyWcs = None, number: int = 1, density: int | None = None, seed: Any = None, log_level: int = 20, **kwargs: Any) Table ¶
Generate a synthetic source injection catalog.
This function generates a synthetic source injection catalog from user supplied input parameters. The catalog is returned as an astropy Table.
On-sky source positions are generated using the quasi-random Halton sequence. By default, the Halton sequence is seeded using the product of the right ascension and declination limit ranges. This ensures that the same sequence is always generated for the same limits. This seed may be overridden by specifying the
seed
parameter.A unique injection ID is generated for each source. The injection ID encodes two pieces of information: the unique source identification number and the version number of the source as specified by the
number
parameter. To achieve this, the unique source ID number is multiplied by10**n
such that the sum of the multiplied source ID number with the unique repeated version number will always be unique. For example, an injection catalog withnumber = 3
versions of each source will have injection IDs: 0, 1, 2, 10, 11, 12, 20, 21, 22, etc. Ifnumber = 20
, then the injection IDs will be: 0, 1, 2, …, 17, 18, 19, 100, 101, 102, etc. Ifnumber = 1
(default) then the injection ID will be a simple sequential list of integers.- Parameters:
- ra_lim
Sequence
[float
] The right ascension limits of the catalog in degrees.
- dec_lim
Sequence
[float
] The declination limits of the catalog in degrees.
- wcs
lsst.afw.geom.SkyWcs
, optional The WCS associated with these data. If not given or
None
(default), the catalog will be generated using Cartesian geometry.- number
int
, optional The number of times to generate each unique combination of input parameters. The default is 1 (i.e., no repeats). This will be ignored if
density
is specified.- density
int
| None, optional The desired source density in sources per square degree. If given, the
number
parameter will be ignored. Instead, the number of unique parameter combination generations will be calculated to achieve the desired density. The default isNone
(i.e., no density calculation).- seed
Any
, optional The seed to use for the Halton sequence. If not given or
None
(default), the seed will be set using the product of the right ascension and declination limit ranges.- log_level
int
, optional The log level to use for logging.
- **kwargs
Any
The input parameters used to generate the catalog. Each parameter key will be used as a column name in the catalog. The values are the unique values for that parameter. The output catalog will contain a row for each unique combination of input parameters and be generated the number of times specified by
number
.
- ra_lim
- Returns:
- table
astropy.table.Table
The fully populated synthetic source injection catalog. The catalog will contain an automatically generated
injection_id
column that is unique for each source. The injection ID encodes two pieces of information: the unique source identification number and the repeated version number of the source as defined by thenumber
parameter.
- table