scripts.generate_fits

Module Contents

Classes

PosteriorsGenerator

Generates posterior samples using multi-core parallelization.

Functions

extract_cmd_args()

Extracts the script command-line arguments.

Attributes

args

class PosteriorsGenerator(sampler_name, lightcurves_dir, survey, num_workers, output_dir)[source]

Generates posterior samples using multi-core parallelization.

generate_data(seed)[source]

Distributes data generation between available workers.

Parameters:

seed (int) – Random seed value for deterministic data generation.

get_posteriors_to_generate()[source]

Determines which fit files to generate.

Returns:

The file names of the missing posterior samples.

Return type:

list of str

setup_sampler(sampler_name, seed)[source]

Creates a sampler and its kwargs from its name.

Parameter

sampler_namestr

The name of the sampler to use. One of “dynesty”, “svi”, “NUTS”, “iminuit”, “licu-ceres” or “licu-mcmc-ceres”.

seedint

Random seed value used for deterministic data generation.

returns:
  • sampler (Sampler) – The sampler object.

  • kwargs (dict) – The sampler specific arguments.

run_sampler(sampler, kwargs, lightcurves, worker_id)[source]

Runs fitting for a set of light curves.

Parameters:
  • sampler (Sampler) – The sampler object.

  • kwargs (dict) – The sampler specific arguments.

  • lightcurves (list) – The list of light curve file names.

  • worker_id (int) – The worker identifier.

get_posteriors_fn(filename)[source]

Returns the posteriors filename for a light curve and sampler.

Parameters:

filename (str) – The name of the light curve file.

Returns:

The name of the posterior samples file.

Return type:

str

extract_cmd_args()[source]

Extracts the script command-line arguments.

args[source]