API documentation

pyzdcf.pyzdcf(input_dir, output_dir, intr=True, sep=',', verbose=True, sparse='auto', savelc=False, parameters={'autocf': False, 'lc1_name': 'lc1_example', 'lc2_name': 'lc2_example', 'minpts': 0, 'num_MC': 100, 'omit_zero_lags': True, 'prefix': 'ccf', 'uniform_sampling': False})

Calculates auto-correlation or cross-correlation function of user-provided light curve(s) using the ZDCF (Z-transformed Discrete Correlation Function) method (Alexander, 1997).

Parameters:
  • input_dir (str) – Path to the directory containing input light curve(s).

  • output_dir (str) – Path to the directory for storing the results.

  • intr (bool, optional) – If True, use interactive user input. Otherwise, use a dictionary with input parameters in the ‘parameters’ keyword argument. Defaults to True.

  • sep (str, optional) – Delimiter to use when reading the file(s). Defaults to ‘,’.

  • verbose (bool, optional) – Print additional information while running the calculations. Defaults to True.

  • sparse ({'auto', True, False}, optional) – If True, use sparse matrices when allocating work areas in order to save memory. If False, use classical numpy arrays (not recommended for light curves containing > 3000 points when running pyZDCF on a 8 GB RAM personal computer). Default value is ‘auto’ and it forces the program to use sparse matrices with light curves of 3000 or more points.

  • savelc (bool, optional) – If True, save the condensed light curve, otherwise skip this step. Defaults to False.

  • parameters (dict, optional) – A dictionary containing all the required parameters (keys are parameter names). Defaults to a dictionary with placeholder values, it is up to the user to provide correct values for given keys (input parameters). Required parameters key names (types) are: autocf (bool), prefix (str), uniform_sampling (bool), omit_zero_lags (bool), minpts (str/int), num_MC (str/int), lc1_name (str). The key lc2_name needs to be provided only if you choose to perform cross-correlation (by setting autocf to False). The params argument is used only in manual mode (intr argument set to False). For description of all input parameters, consult the “How to use” section in the docs.

Returns:

dcf_df – A pandas DataFrame organized in 7 columns displaying the results for each time-lag bin. The columns are: time-lag, negative time-lag std, positive time-lag std, zdcf, negative zdcf sampling error, positive zdcf sampling error, number of points per bin.

Return type:

pandas.DataFrame