pyPetal Arguments

Required General Arguments

Argument

Description

Type

output_dir

The directory used for all output.

str

arg2

Either the list of filenames to all light curve files, or an array of the light curves themselves. If given as a list of filenames, all files must be in the same directory. The first line will be considered the continuum light curve.

list of str, list of float

Note

pyPetal will use the first 3 columns of the light curve files, and assume they represent the time, values, and uncertainty in the light curves.

Warning

By default, arg2=None. pyPetal will raise an error if arg2=None.

Optional General Arguments

Argument

Description

Type

Default

line_names

A list of the names of all lines input in arg2. If None, the lines will be named in chronological order (i.e. “Line1”, “Line2”, etc…)

None, list of str

None

file_fmt

The format of the light curve files input in arg2. All light curve files are required to be CSV in the analysis, so if file_fmt != "csv", it will be saved in the light_curves/ directory in CSV format. Currently, “csv” and “ascii” are recognised. All other formats will need to be recognised by the astropy.table module.

str

"csv"

verbose

Whether or not to display text progress of the pipeline.

bool

False

plot

Whether or not to display plots showing the progress of the pipeline.

bool

False

time_unit

The unit to use for figures for the time axis.

str

"d"

lc_unit

The unit used for figures for the light curve axis. Can be a list of units or a single unit. If a single unit is given, it will be assumed for all lines. pyPetal will recognize “mag” as as magnitude and invert the axis of all plots. All other units will be assumed to be flux units.

str, list of str

""

lag_bounds

The range of lags to use for all pyPetal modules when searching for a lag. If None or “baseline” are input for a given line, the baseline (both positive and negative) will be used as the lag bounds. If only one set of bounds is given, it will be assumed for all lines.

list of None, float, "baseline"

None

threads

The number of threads to use for multiprocessing. This will be applied to all modules selected.

int

1

Module: DRW Rejection (run_drw_rej)

Argument

Description

Type

Default

nsig

The number of \(\sigma\) from the mean DRW fit to reject data points.

float

3.0

jitter

Whether to incluse a noise (“jitter”) term \(\sigma_n\) in the DRW fitting process.

bool

True

nchain

The number of chains for Monte Carlo sampling.

int

10000

nburn

The number of burn-in Monte Carlo samples.

int

3000

nwalker

The number of walkers for Monte Carlo sampling.

int

32

clip

Celerite will use a prior for the characteristic DRW timescale \(\tau_{\rm DRW}\), spanning the minimum cadence to the baseline of the input light curve. If clip=True for a given light curve, instead of using the minimum difference between times given for the light curve, it will clip these differences for values below \(10^{-8}\). If one value is given, it will be assumed for all light curves.

bool, list of bool

True

reject_data

If reject_data=True for a given light curve, it will be fit and its values will be rejected based on the value of nsig. If reject_data=False for a given light curve, it will not be fit to a DRW. If one value is given, it will be assumed for all light curves.

bool, list of bool

True for the continuum, False for all lines

use_for_javelin

If True, the resulting DRW parameters \((\sigma_{\rm DRW}, $\tau_{\rm DRW})\), will used as input to the JAVELIN module of pyPetal. The DRW parameters in each fit will be fixed to the results obtained in this module.

bool

False

Module: Detrending (run_detrend)

Argument

Description

Type

Default

K

The number of Gaussians to use in the LinMix model.

int

2

nchain

The number of chains for Monte Carlo sampling.

int

4

miniter

The minimum number of iterations for the Monte Carlo simulations.

int

5000

maxiter

The maximum number of iterations for the Monte Carlo simulations.

int

10000

Module: pyCCF (run_pyccf)

Argument

Description

Type

Default

nsim

The number of Monte Carlo simulations to run.

int

3000

interp

The time interval with which pyCCF will interpolate the ligh curves to form the ICCF. This value must be shorter than the average cadence of the ligh curves. Setting this value too low can introduce noise. If set to None, interp will be set to half of the average cadence of the light curves.

float, None

2.0

mcmode

The type of resampling to perform for the Monte Carlo simulations. 0 performs both flux randomization (FR) and random subset selection (RSS). 1 performs only FR. 2 performs only RSS.

int

0

sigmode

The threshold for considering a measurement in the ICCF significant when computing peaks and centroids. Must be within the interval (0,1). All peaks and centroids with correlation coefficient \(r_{\rm max} \leq\) sigmode will be considered as “failed”. If set to 0, will exclude all peaks based on a p-value significance test (see pyCCF documentation).

float

0.2

thres

The lower limit of correlation coefficient used when calculating the centroid of the ICCF. Must be within the interval (0,1).

float

0.8

Module: pyZDCF (run_pyzdcf)

Argument

Description

Type

Default

nsim

The number of Monte Carlo simulations to run.

int

1000

minpts

The minimum number of points to use in each bin when computing the ZDCF. Must be larger than 11. If set to 0, it will be set to 11.

int

0

uniform_sampling

Whether or not the light curves are uniformly sampled.

bool

False

omit_zero_lags

Whether or not to omit the points with zero lags when computing the ZDCF.

bool

True

sparse

Determines whether to use a sparse matrix implementation for reduced RAM usage. This feature is suitable for longer light curves (> 3000 data points). If True, will use sparse matrix implementation. If set to “auto”, will use sparse matrix implementation if there are more than 3000 data points per light curve.

bool, str

"auto"

prefix

Prefix to the output ZDCF file.

str

"zdcf"

run_plike

Whether or not to run the PLIKE algorithm on the ZDCF to get a maximum likelihood time lag. NOTE: If run_plike=True, the plike_dir argument must also be specified.

bool

False

plike_dir

The path to the PLIKE executable.

str, None

None

Module: pyROA (run_pyroa)

Argument

Description

Type

Default

nchain

The total number of chains for Monte Carlo sampling.

int

20000

nburn

The number of burn-in steps to remove from the Monte Carlo samples.

int

15000

together

Whether or not to fit the time lags of all light curves together.

bool

True

init_tau

The initial guess for the time lag. If one value is given, it will be used for all lines. If None, it will be set to 10. for each line.

float, list of float, None

None

subtract_mean

Whether or not to subtract the mean from all light curves before analysis.

bool

True

div_mean

Whether or not to divide the light curves by their mean before analysis. This will occur before the mean is subtracted if subtract_mean=True.

bool

False

add_var

Whether or not to add additional uncertainty in the data, same as the PyROA argument. If together=False, multiple values may be given for each line. If only one value is given, it will be assumed for all lines.

bool, list of bool

True

delay_dist

Same as the delay_dist argument for PyROA. If together=False, multiple values may be given for each line. If only one value is given, it will be assumed for all lines.

bool, list of bool

True

psi_types

Same as the psi_types argument for PyROA - the form of the delay distribution. This will only affect the output if delay_dist=True. If together=False, multiple values may be given for each line. If only one value is given, it will be assumed for all lines. If None, a Gaussian distribution will be assumed.

str, list of str, None

None

objname

The name of the object to use for PyROA analysis. This will apply to the output file names and figures. If None, this will be set to “pyroa”.

str, None

None

prior_func

A function used to get the priors for PyROA. Must have the same arguments as pypetal.pyroa.utils.get_priors except for the delimiter argument. If None, will use the default priors.

function, None

None

Module: MICA2 (run_mica2)

MICA2 arguments:

Argument

Description

Type

Default

type_tf

The type of transfer function to use in MICA2. Can be either “gaussian” or “tophat”.

str

"gaussian"

max_num_saves

The number of saves to use in CDNest for the sampling.

int

2000

flag_uniform_var_params

Whether each dataset has the same variability parameters.

bool

False

flag_uniform_transfuns

Whether each dataset has the same line parameters.

bool

False

flag_trend

Whether or not to include a trend in the transfer function. 0 for constant trend, 1 for linear trend, 2 for conic trend.

int

0

flag_lag_posivity

Whether or not to force Gaussians to be located at positive lags.

bool

False

flag_negative_resp

Whether or not to turn on negative response.

bool

False

number_component

The lower and upper limits to use for the number of Gaussians. If only one value is given, it will be assumed for both limits.

list of int

[1, 1]

width_limit

The lower and upper limits for the width of the Gaussians. If only one value is given, it will be assumed for both limits. If None, these will be determined by MICA2.

list of float

None

flag_con_sys_err

Whether or not to include a constant systematic error for the continuum light curve.

bool

False

flag_line_sys_err

Whether or not to include a systematic error for the line light curve(s).

bool

False

type_lag_prior

The type of prior to use for the lags. See the MICA2 documentation.

int

0

lag_prior

The parameters to use for the lag prior. See the MICA2 documentation.

list of float

None

together

Whether or not to fit the time lags of all light curves together, with the same transfer function.

bool

False

no_order

Whether or not the order of the time lags makes a difference (i.e., whether or not the time lags are allowed to be equal). If order doesn’t matter, MICA2 will be able to fit all light curves in one run. If set to True, a separate MICA2 run will be performed for each line.

bool

True

CDNest arguments:

Argument

Description

Type

Default

num_particles

See the MICA2 or CDNest documentation.

int

1

thread_steps_factor

int

1

new_level_interval_factor

int

1

save_interval_factor

int

1

lam

float

10

beta

float

100

ptol

float

0.1

max_num_levels

int

0

Module: JAVELIN (pypetal_jav.run_pipeline)

Argument

Description

Type

Default

subtract_mean

Whether or not to subtract the mean from all light curves before analysis.

bool

True

nchain

The number of chains to use in the MCMC.

int

100

nburn

The number of burn-in steps to use in the MCMC.

int

100

nwalkers

The number of walkers to use in the MCMC.

int

100

rm_type

The type of reverberation mapping (RM) analysis to use when running JAVELIN. Can either be set to “spec” for spectroscopic RM, or “phot” for photometric RM.

str

"spec"

together

Whether or not to fit all lines to the same model. If together=False all lines will be fit to the continuum separately.

bool

False

lagtobaseline

A log prior is used to logarithmically penalizes lag values larger than x`*baseline, where `x is the value of this parameter.

float

0.3

fixed

A list to determine what parameters to fix/vary when fitting the light curves. This should be an array with a length equal to the number of parameters in the model. The fitted parameters will be the two DRW parameters \(( \log(\sigma_{\rm DRW}), \log(\tau_{\rm DRW}) )\) and (3 or 4) tophat parameters for each non-continuum light curve. Setting to 0 will fix the parameter and setting to 1 will allow it to vary. If None, all parameters will be allowed to vary. The fixed parameters must match the fixed value in the array input to the p_fix argument. If together=False, this can be input as a list of inputs, one for each line. If only one input is given, it will be assumed for each line.

None, list of int

None

p_fix

A list of the fixed parameters, corresponding to the elements of the fixed array. If None, all parameters will be allowed to vary. Similar to fixed, if together=False this can be input as a list of inputs for each line. If only one input is given, it will be assumed for all lines.

None, list of float

None

output_chains

Whether or not to output the MCMC chains to a file.

bool

True

output_burn

Whether or not to output the MCMC burn-in chains to a file.

bool

True

output_logp

Whether or not to output the MCMC log probability to a file.

bool

True

nbin

The number of bins to use for the output histogram plots.

int

100

Determining the number of parameters in the JAVELIN model:

rm_type

together

Number of Parameters

Parameter Names

"spec"

True

\(2 + 3 \cdot ({\rm number of light curves})\)

\(\log(\sigma_{\rm DRW})\), \(\log(\tau_{\rm DRW})\), \(t_1\), \(w_1\), \(s_1\), \(t_2\), …

"spec"

False

5 per line

\(\log(\sigma_{\rm DRW})\), \(\log(\tau_{\rm DRW})\), \(t\), \(w\), \(s\)

"phot"

True

6 per line

\(\log(\sigma_{\rm DRW})\), \(\log(\tau_{\rm DRW})\), \(t\), \(w\), \(s\), \(\alpha\)

Note

If use_for_javelin=True in the DRW Rejection module, and fixed/p_fix are set in the JAVELIN module, the DRW fitting results will be used instead of the input fixed parameter values.

Note

If rm_type="phot", only one light curve can be modeled to a given continuum. Therefore, pyPetal will set together=False.

Module: Weighting (pypetal.run_weighting)

Argument

Description

Type

Default

gap_size

The minimum gap size to use to detect gaps in the continuum light curve when obtaining \(N(\tau)\).

float

20.0

k

The exponent used when calculating \(P(\tau)\).

float

2.0

width

The width of the Gaussian used to smooth the weighted distribution to find the primary peak.

float

20.0

rel_height

The relative height (0-1) to use for the peak-finding algorithm.

float

0.99

zoom

Whether or not to zoom in on the peak with an inset in the output plot.

bool

True