GWForge.fisher.config

Configuration handling for gwforge_fisher.

Kept out of the executable so the parsing is importable and testable, and so the CLI stays a thin driver like the other bin/ scripts.

Attributes

Functions

parse_collection(config, section, option[, fallback])

Read a list or dict written with single quotes from an ini file.

read_injections(config[, section])

Collect the sources to forecast.

waveform_settings(config[, section])

Waveform arguments, source model and parameter conversion.

fisher_settings(config[, section])

Read the [Fisher] section.

prior_settings(config, order[, section])

Read the [Priors] section and enforce the order-dependent rule.

segment_duration(parameters, minimum_frequency, ...[, ...])

Segment length long enough to hold the signal.

Module Contents

GWForge.fisher.config.SOURCE_MODELS[source]
GWForge.fisher.config.PARAMETER_CONVERSIONS[source]
GWForge.fisher.config.parse_collection(config, section, option, fallback=None)[source]

Read a list or dict written with single quotes from an ini file.

Parameters:
  • config (configparser.ConfigParser)

  • section (str)

  • option (str)

  • fallback (object or None) – Returned when the option is absent or empty.

Return type:

object

GWForge.fisher.config.read_injections(config, section='Injection_Parameters')[source]

Collect the sources to forecast.

Accepts either parameters written inline in the configuration, or an injection-file pointing at a gwforge_population HDF5, optionally sliced with start-index and end-index.

Parameters:
  • config (configparser.ConfigParser)

  • section (str)

Returns:

One dict of parameters per source.

Return type:

list of dict

Raises:

ValueError – If the section is missing or defines no source.

GWForge.fisher.config.waveform_settings(config, section='Waveform_Generator')[source]

Waveform arguments, source model and parameter conversion.

Parameters:
  • config (configparser.ConfigParser)

  • section (str)

Returns:

With keys waveform_arguments, frequency_domain_source_model, parameter_conversion and minimum_frequency.

Return type:

dict

Raises:

ValueError – If the named source model is unknown or unavailable in this bilby.

GWForge.fisher.config.fisher_settings(config, section='Fisher')[source]

Read the [Fisher] section.

Parameters:
  • config (configparser.ConfigParser)

  • section (str)

Returns:

With keys order, earth_rotation, finite_size, parameters, step_sizes, calibrate and target_change.

Return type:

dict

GWForge.fisher.config.prior_settings(config, order, section='Priors')[source]

Read the [Priors] section and enforce the order-dependent rule.

Order 1 is a closed-form covariance and needs no prior; order 2 samples a truncated Taylor expansion, which is only meaningful inside bounds, so a prior file is required there.

Parameters:
  • config (configparser.ConfigParser)

  • order (int) – Expansion order, from fisher_settings().

  • section (str)

Returns:

With keys prior_file and enforce_physicality.

Return type:

dict

Raises:

ValueError – If order >= 2 and no prior-file is given.

GWForge.fisher.config.segment_duration(parameters, minimum_frequency, approximant, maximum=None)[source]

Segment length long enough to hold the signal.

Getting this wrong is not a subtle error: a segment shorter than the inspiral wraps it, and the resulting derivatives are meaningless.

Parameters:
  • parameters (dict) – Source parameters; needs component masses and aligned spins, which are derived from whatever mass parametrisation is present.

  • minimum_frequency (float) – Waveform starting frequency in Hz.

  • approximant (str)

  • maximum (float or None) – Cap on the returned duration, in seconds.

Returns:

Duration in seconds, rounded up to a power of two.

Return type:

float