sorcha.utilities.sorchaConfigs

Classes

inputConfigs

Data class for holding INPUTS section configuration file keys and validating them.

simulationConfigs

Data class for holding SIMULATION section configuration file keys and validating them

filtersConfigs

Data class for holding FILTERS section configuration file keys and validating them

saturationConfigs

Data class for holding SATURATION section configuration file keys and validating them

phasecurvesConfigs

Data class for holding PHASECURVES section configuration file keys and validating them

fovConfigs

Data class for holding FOV section configuration file keys and validating them

fadingfunctionConfigs

Data class for holding FADINGFUNCTION section configuration file keys and validating them

linkingfilterConfigs

Data class for holding LINKINGFILTER section configuration file keys and validating them.

outputConfigs

Data class for holding OUTPUT section configuration file keys and validating them.

lightcurveConfigs

Data class for holding LIGHTCURVE section configuration file keys and validating them.

activityConfigs

Data class for holding Activity section configuration file keys and validating them.

expertConfigs

Data class for holding expert section configuration file keys and validating them.

auxiliaryConfigs

Data class for holding auxiliary section configuration file keys and validating them.

basesorchaConfigs

Dataclass which stores configuration file keywords in dataclasses,

sorchaConfigs

Set the dataclass to load from a file

Functions

check_key_exists(value, key_name)

Checks to confirm that a mandatory config file value is present and has been read into the dataclass as truthy. Returns an error if value is falsy

check_key_doesnt_exist(value, key_name, reason)

Checks to confirm that a config file value is not present and has been read into the dataclass as falsy. Returns an error if value is truthy

cast_as_int(value, key)

Checks to see if value can be cast as an interger.

cast_as_float(value, key)

Checks to see if value can be cast as a float.

cast_as_bool(value, key)

Checks to see if value can be cast as a boolen.

check_value_in_list(value, valuelist, key)

Checks to see if a config variable is in a list of permissible variables.

cast_as_bool_or_set_default(value, key, default)

Checks to see if value can be cast as a boolen and if not set (equals None) gives default bool.

PrintConfigsToLog(sconfigs, cmd_args)

Prints all the values from the config file and command line to the log.

Module Contents

class inputConfigs[source]

Data class for holding INPUTS section configuration file keys and validating them.

ephemerides_type: str = None[source]

Simulation used for ephemeris input.

eph_format: str = None[source]

Format for ephemeris simulation input file.

size_serial_chunk: int = None[source]

Sorcha chunk size.

aux_format: str = None[source]

Format for the auxiliary input files.

pointing_sql_query: str = None[source]

SQL query for extracting data from pointing database.

__post_init__()[source]

Automagically validates the input configs after initialisation.

_validate_input_configs()[source]

Validates the input config attributes after initialisation.

Parameters:

None.

Return type:

None

class simulationConfigs[source]

Data class for holding SIMULATION section configuration file keys and validating them

ar_ang_fov: float = None[source]

the field of view of our search field, in degrees

ar_fov_buffer: float = None[source]

the buffer zone around the field of view we want to include, in degrees

ar_picket: float = None[source]

imprecise discretization of time that allows us to move progress our simulations forward without getting too granular when we don't have to. the unit is number of days.

ar_obs_code: str = None[source]

the obscode is the MPC observatory code for the provided telescope.

ar_healpix_order: int = None[source]

the order of healpix which we will use for the healpy portions of the code.

ar_n_sub_intervals: int = 101[source]
Type:

Number of sub-intervals for the Lagrange ephemerides interpolation (default

_ephemerides_type: str = None[source]

Simulation used for ephemeris input.

__post_init__()[source]

Automagically validates the simulation configs after initialisation.

_validate_simulation_configs()[source]

Validates the simulation config attributes after initialisation.

Parameters:

None.

Return type:

None

class filtersConfigs[source]

Data class for holding FILTERS section configuration file keys and validating them

observing_filters: str = None[source]

Filters of the observations you are interested in, comma-separated.

survey_name: str = None[source]

survey name to be used for checking filters are correct

mainfilter: str = None[source]

main filter chosen in physical parameter file

othercolours: str = None[source]

other filters given alongside main filter

__post_init__()[source]

Automagically validates the filters configs after initialisation.

_validate_filters_configs()[source]

Validates the filters config attributes after initialisation.

Parameters:

None.

Return type:

None

_check_for_correct_filters()[source]

Checks the filters selected are used by the chosen survey.

Parameters:

None.

Return type:

None

class saturationConfigs[source]

Data class for holding SATURATION section configuration file keys and validating them

bright_limit_on: bool = None[source]
bright_limit: float = None[source]

Upper magnitude limit on sources that will overfill the detector pixels/have counts above the non-linearity regime of the pixels where one can’t do photometry. Objects brighter than this limit (in magnitude) will be cut.

_observing_filters: list = None[source]

Filters of the observations you are interested in, comma-separated.

__post_init__()[source]

Automagically validates the saturation configs after initialisation.

_validate_saturation_configs()[source]

Validates the saturation config attributes after initialisation.

Parameters:

None.

Return type:

None

class phasecurvesConfigs[source]

Data class for holding PHASECURVES section configuration file keys and validating them

phase_function: str = None[source]

The phase function used to calculate apparent magnitude. The physical parameters input

__post_init__()[source]

Automagically validates the phasecurve configs after initialisation.

_validate_phasecurve_configs()[source]

Validates the phasecurve config attributes after initialisation.

Parameters:

None.

Return type:

None

class fovConfigs[source]

Data class for holding FOV section configuration file keys and validating them

camera_model: str = None[source]

Choose between circular or actual camera footprint, including chip gaps.

footprint_path: str = None[source]

Path to camera footprint file. Uncomment to provide a path to the desired camera detector configuration file if not using the default built-in detector configuration for the actual camera footprint.

visits_query: str = None[source]

SQL query for extracting data from visits database.

fill_factor: str = None[source]

Fraction of detector surface area which contains CCD -- simulates chip gaps for OIF output. Comment out if using camera footprint.

circle_radius: float = None[source]

Radius of the circle for a circular footprint (in degrees). Float. Comment out or do not include if using footprint camera model.

footprint_edge_threshold: float = None[source]

The distance from the edge of a detector (in arcseconds on the focal plane) at which we will not correctly extract an object. By default this is 10px or 2 arcseconds. Comment out or do not include if not using footprint camera model.

survey_name: str = None[source]

name of survey

__post_init__()[source]

Automagically validates the fov configs after initialisation.

_validate_fov_configs()[source]

Validates the fov config attributes after initialisation.

Parameters:

None.

Return type:

None

_camera_footprint()[source]

Validates the fov config attributes for a footprint camera model.

Parameters:

None.

Return type:

None

_camera_visits_footprint()[source]

Validates the fov config attributes for a per observation footprint camera model.

Parameters:

None.

Return type:

None

_camera_circle()[source]

Validates the fov config attributes for a circle camera model.

Parameters:

None.

Return type:

None

class fadingfunctionConfigs[source]

Data class for holding FADINGFUNCTION section configuration file keys and validating them

fading_function_on: bool = None[source]

Detection efficiency fading function on or off. Default True

fading_function_width: float = None[source]

Width parameter for fading function. Should be greater than zero and less than 0.5.

fading_function_peak_efficiency: float = None[source]

Peak efficiency for the fading function, called the 'fill factor' in Chesley and Veres (2017).

des_transient_efficency: float = None[source]

Overall transient efficiency for moving object detection

survey_name: str = None[source]
__post_init__()[source]

Automagically validates the fading function configs after initialisation.

_validate_fadingfunction_configs_DES()[source]

Validates the fadindfunction config attributes after initialisation for DES.

Parameters:

None.

Return type:

None

_validate_fadingfunction_configs()[source]

Validates the fadindfunction config attributes after initialisation.

Parameters:

None.

Return type:

None

class linkingfilterConfigs[source]

Data class for holding LINKINGFILTER section configuration file keys and validating them.

ssp_linking_on: bool = None[source]

flag to see if model should run ssp linking filter

drop_unlinked: bool = None[source]

Decides if unlinked objects will be dropped.

ssp_detection_efficiency: float = None[source]

ssp detection efficiency. Which fraction of the observations of an object will the automated solar system processing pipeline successfully link? Float.

ssp_number_observations: int = None[source]

Length of tracklets. How many observations of an object during one night are required to produce a valid tracklet?

ssp_separation_threshold: float = None[source]

Minimum separation (in arcsec) between two observations of an object required for the linking software to distinguish them as separate and therefore as a valid tracklet.

ssp_maximum_time: float = None[source]

Maximum time separation (in days) between subsequent observations in a tracklet. Default is 0.0625 days (90mins).

ssp_number_tracklets: int = None[source]

Number of tracklets for detection. How many tracklets are required to classify an object as detected?

ssp_track_window: int = None[source]

The number of tracklets defined above must occur in <= this number of days to constitute a complete track/detection.

ssp_night_start_utc: float = None[source]

The time in UTC at which it is noon at the observatory location (in standard time). For the LSST, 12pm Chile Standard Time is 4pm UTC.

des_discovery_on: bool = None[source]

flag to see if model should run des discovery filter

survey_name: str = None[source]

name of survey

distance_cut_on: bool = None[source]

flag for DES for object-sun light-time-corrected distance cuts

distance_cut_upper: float = None[source]

The upper distance limit for object-sun light-time-corrected distance for DES to detect objects. in km

distance_cut_lower: float = None[source]

The lower distance limit for object-sun light-time-corrected distance for DES to detect objects. in km

motion_cut_on: bool = None[source]

flag for when DES motion cuts are selected

motion_cut_upper: float = None[source]

The upper motion limit for DES to detect objects in (deg/day)

motion_cut_lower: float = None[source]

The lower motion limit for DES to detect objects (deg/day)

__post_init__()[source]

Automagically validates the linking filter configs after initialisation.

_validate_linkingfilter_configs()[source]

Validates the linkingfilter config attributes after initialisation.

Parameters:

None.

Return type:

None

class outputConfigs[source]

Data class for holding OUTPUT section configuration file keys and validating them.

output_format: str = None[source]

Output format of the output file[s]

output_columns: str = None[source]

Controls which columns are in the output files.

position_decimals: int = None[source]

position decimal places

magnitude_decimals: int = None[source]

magnitude decimal places

__post_init__()[source]

Automagically validates the output configs after initialisation.

_validate_output_configs()[source]

Validates the output config attributes after initialisation.

Parameters:

None.

Return type:

None

_validate_decimals()[source]

Validates the decimal output config attributes after initialisation.

Parameters:

None.

Return type:

None

class lightcurveConfigs[source]

Data class for holding LIGHTCURVE section configuration file keys and validating them.

lc_model: str = None[source]

The unique name of the lightcurve model to use. Defined in the name_id method of the subclasses of AbstractLightCurve. If not none, the complex physical parameters file must be specified at the command line.lc_model = none

__post_init__()[source]

Automagically validates the lightcurve configs after initialisation.

_validate_lightcurve_configs()[source]

Validates the lightcurve config attributes after initialisation.

Parameters:

None.

Return type:

None

class activityConfigs[source]

Data class for holding Activity section configuration file keys and validating them.

comet_activity: str = None[source]

The unique name of the actvity model to use. Defined in the name_id method of the subclasses of AbstractCometaryActivity. If not none, a complex physical parameters file must be specified at the command line.

__post_init__()[source]

Automagically validates the activity configs after initialisation.

_validate_activity_configs()[source]

Validates the activity config attributes after initialisation.

Parameters:

None.

Return type:

None

class expertConfigs[source]

Data class for holding expert section configuration file keys and validating them.

snr_limit: float = None[source]

Drops observations with signal to noise ratio less than limit given

snr_limit_on: bool = None[source]

flag for when an SNR limit is given

mag_limit: float = None[source]

Drops observations with magnitude less than limit given

mag_limit_on: bool = None[source]

flag for when a magnitude limit is given

trailing_losses_on: bool = None[source]

flag for trailing losses

default_snr_cut: bool = None[source]

flag for default SNR

randomization_on: bool = None[source]

flag for randomizing astrometry and photometry

vignetting_on: bool = None[source]

flag for calculating effects of vignetting on limiting magnitude

brute_force: bool = None[source]

brute-force ephemeris generation on all objects without running a first-pass

survey_name: str = None[source]

survey name to be used for checking flags are correct

camera_model: str = None[source]

camera model chosen in fovConfigs

__post_init__()[source]

Automagically validates the expert configs after initialisation.

_validate_expert_configs()[source]

Validates the expert config attributes after initialisation.

Parameters:

None.

Return type:

None

class auxiliaryConfigs[source]

Data class for holding auxiliary section configuration file keys and validating them.

planet_ephemeris: str = 'de440s.bsp'[source]

filename of planet_ephemeris

planet_ephemeris_url: str = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440s.bsp'[source]

url for planet_ephemeris

earth_predict: str = 'earth_2025_250826_2125_predict.bpc'[source]

filename of earth_predict

earth_predict_url: str = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_2025_250826_2125_predict.bpc'[source]

url for earth_predict

earth_historical: str = 'earth_620120_250826.bpc'[source]

filename of earth_histoical

earth_historical_url: str = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_620120_250826.bpc'[source]

url for earth_historical

earth_high_precision: str = 'earth_latest_high_prec.bpc'[source]

filename of earth_high_precision

earth_high_precision_url: str = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc'[source]

url of earth_high_precision

jpl_planets: str = 'linux_p1550p2650.440'[source]

filename of jpl_planets

jpl_planets_url: str = 'https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de440/linux_p1550p2650.440'[source]

url of jpl_planets

jpl_small_bodies: str = 'sb441-n16.bsp'[source]

filename of jpl_small_bodies

jpl_small_bodies_url: str = 'https://ssd.jpl.nasa.gov/ftp/eph/small_bodies/asteroids_de441/sb441-n16.bsp'[source]

url of jpl_small_bodies

leap_seconds: str = 'naif0012.tls'[source]

filename of leap_seconds

leap_seconds_url: str = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/naif0012.tls'[source]

url of leap_seconds

meta_kernel: str = 'meta_kernel.txt'[source]

filename of meta_kernal

observatory_codes: str = 'ObsCodes.json'[source]

filename of observatory_codes

observatory_codes_compressed: str = 'ObsCodes.json.gz'[source]

filename of observatory_codes_compressed

observatory_codes_compressed_url: str = 'https://minorplanetcenter.net/Extended_Files/obscodes_extended.json.gz'[source]

url of observatory_codes_compressed

orientation_constants: str = 'pck00010.pck'[source]

filename of observatory_constants

orientation_constants_url: str = 'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00010.tpc'[source]

url of observatory_constants

data_file_list: list = None[source]

convenience list of all the file names

urls: dict = None[source]

url

Type:

dictionary of filename

data_files_to_download: list = None[source]

list of files that need to be downloaded

ordered_kernel_files: list = None[source]

list of kernels ordered from least to most precise - used to assemble meta_kernel file

registry: list = None[source]

Default Pooch registry to define which files will be tracked and retrievable

property default_url[source]

returns a dictionary of the default urls used in this version of sorcha

property default_filenames[source]

returns a dictionary of the default filenames used in this version

__post_init__()[source]

Automagically validates the auxiliary configs after initialisation.

_validate_auxiliary_configs()[source]

validates the auxililary config attributes after initialisation.

_create_lists_auxiliary_configs()[source]

creates lists of the auxililary config attributes after initialisation.

Parameters:

None.

Return type:

None

class basesorchaConfigs[source]

Dataclass which stores configuration file keywords in dataclasses, Usefull for using runLSSTSimulation without a dedicated config file. Use sorchaConfigs to read config files.

input: inputConfigs = None[source]

inputConfigs dataclass which stores the keywords from the INPUT section of the config file.

simulation: simulationConfigs = None[source]

simulationConfigs dataclass which stores the keywords from the SIMULATION section of the config file.

filters: filtersConfigs = None[source]

filtersConfigs dataclass which stores the keywords from the FILTERS section of the config file.

saturation: saturationConfigs = None[source]

saturationConfigs dataclass which stores the keywords from the SATURATION section of the config file.

phasecurves: phasecurvesConfigs = None[source]

phasecurveConfigs dataclass which stores the keywords from the PHASECURVES section of the config file.

fov: fovConfigs = None[source]

fovConfigs dataclass which stores the keywords from the FOV section of the config file.

fadingfunction: fadingfunctionConfigs = None[source]

fadingfunctionConfigs dataclass which stores the keywords from the FADINGFUNCTION section of the config file.

linkingfilter: linkingfilterConfigs = None[source]

linkingfilterConfigs dataclass which stores the keywords from the LINKINGFILTER section of the config file.

output: outputConfigs = None[source]

outputConfigs dataclass which stores the keywords from the OUTPUT section of the config file.

lightcurve: lightcurveConfigs = None[source]

lightcurveConfigs dataclass which stores the keywords from the LIGHTCURVE section of the config file.

activity: activityConfigs = None[source]

activityConfigs dataclass which stores the keywords from the ACTIVITY section of the config file.

expert: expertConfigs = None[source]

expertConfigs dataclass which stores the keywords from the EXPERT section of the config file.

auxiliary: auxiliaryConfigs = None[source]

auxiliaryConfigs dataclass which stores the keywords from the AUXILIARY section of the config file.

pplogger: None = None[source]

The Python logger instance

survey_name: str = ''[source]

The name of the survey.

class sorchaConfigs(config_file_location=None, survey_name=None)[source]

Bases: basesorchaConfigs

Set the dataclass to load from a file

pplogger[source]

The Python logger instance

survey_name = None[source]

The name of the survey.

_read_configs_from_object(config_object)[source]

function that populates the class attributes

Parameters:

config_object (ConfigParser object) -- ConfigParser object that has the config file read into it

Return type:

None

check_key_exists(value, key_name)[source]

Checks to confirm that a mandatory config file value is present and has been read into the dataclass as truthy. Returns an error if value is falsy

Parameters:
  • value (object attribute) -- value of the config file attribute

  • key_name (string) -- The key being checked.

Return type:

None.

check_key_doesnt_exist(value, key_name, reason)[source]

Checks to confirm that a config file value is not present and has been read into the dataclass as falsy. Returns an error if value is truthy

Parameters:
  • value (object attribute) -- value of the config file attribute

  • key_name (string) -- The key being checked.

  • reason (string) -- reason given in the error message on why this value shouldn't be in the config file

Return type:

None.

cast_as_int(value, key)[source]

Checks to see if value can be cast as an interger.

Parameters:
  • value (object attribute) -- value of the config file attribute

  • key (string) -- The key being checked.

Return type:

value as an integer

cast_as_float(value, key)[source]

Checks to see if value can be cast as a float.

Parameters:
  • value (object attribute) -- value of the config file attribute

  • key (string) -- The key being checked.

Return type:

value as a float

cast_as_bool(value, key)[source]

Checks to see if value can be cast as a boolen.

Parameters:
  • value (object attribute) -- value of the config file attribute

  • key (string) -- The key being checked.

Return type:

value as a boolen

check_value_in_list(value, valuelist, key)[source]

Checks to see if a config variable is in a list of permissible variables.

Parameters:
  • value (object attribute) -- value of the config file value

  • valuelist (list) -- list of permissible values for attribute

  • key (string) -- The key being checked.

Return type:

None.

cast_as_bool_or_set_default(value, key, default)[source]

Checks to see if value can be cast as a boolen and if not set (equals None) gives default bool.

Parameters:
  • value (object attribute) -- value of the config file attribute

  • key (string) -- The key being checked.

  • default (bool) -- default bool if value is None

Return type:

value as a boolen

PrintConfigsToLog(sconfigs, cmd_args)[source]

Prints all the values from the config file and command line to the log.

Parameters:
  • sconfigs (dataclass) -- Dataclass of config file variables.

  • cmd_args (dictionary) -- Dictionary of command line arguments.

Return type:

None.