opticam.utils.data_checks

Functions

check_data(out_directory[, data_directory, ...])

Check that the data are self-consistent.

parse_header_results(results, file_paths, ...)

Parse the header info results.

data_checks_output(binning_scale, camera_files, func)

Output the results of the data checks.

Module Contents

opticam.utils.data_checks.check_data(out_directory, data_directory=None, c1_directory=None, c2_directory=None, c3_directory=None, barycenter=True, verbose=True, return_output=False, logger=None, number_of_processors=cpu_count() // 2)

Check that the data are self-consistent.

Parameters

out_directorystr

The directory path to which any output files will be saved.

data_directoryNone | str, optional

The directory path to the data for all three cameras, by default None.

c1_directoryNone | str, optional

The directory path to the data for Camera 1, by default None.

c2_directoryNone | str, optional

The directory path to the data for Camera 2, by default None

c3_directoryNone | str, optional

The directory path to the data for Camera 3, by default None

barycenterbool, optional

Whether to apply a Barycentric correction to the image time stamps, by default True.

verbosebool, optional

Whether to print any output info, by default True.

return_outputbool, optional

Whether to return any output, by default False.

loggerLogger | None, optional

The logger, by default None.

number_of_processors_type_, optional

The number of processors to use, by default cpu_count() // 2.

Returns

None | Tuple[Dict[str, str], int, Dict[str, float], List[str], Dict[str, float], float]

If return_output=True, the file paths, binning scale, Barycentric MJD dates, ignored files, file gains, and the reference date are returned. Otherwise, nothing is returned.

Parameters:
  • out_directory (str)

  • data_directory (None | str)

  • c1_directory (None | str)

  • c2_directory (None | str)

  • c3_directory (None | str)

  • barycenter (bool)

  • verbose (bool)

  • return_output (bool)

  • logger (logging.Logger | None)

Return type:

None | Tuple[Dict[str, List[str]], int, Dict[str, float], List[str], Dict[str, float], float]

opticam.utils.data_checks.parse_header_results(results, file_paths, out_directory, logger)

Parse the header info results.

Parameters

resultsTuple[float, float, str, str, float]

The header info results.

file_pathsList[str]

The file paths.

out_directorystr

The directory path to which any output files will be saved.

loggerLogger | None

The logger.

Returns

Tuple[int, Dict[str, float], Dict[str, str], Dict[str, float], List[str]]

The binning scale, BMJD dates, filters, gains, and ignored files.

Raises

ValueError

If more than three filters are detected.

ValueError

If more than one binning mode is detected.

Parameters:
  • results (Tuple[float, float, str, str, float])

  • file_paths (List[str])

  • out_directory (str)

  • logger (logging.Logger | None)

Return type:

Tuple[int, Dict[str, float], Dict[str, str], Dict[str, float], List[str]]

opticam.utils.data_checks.data_checks_output(binning_scale, camera_files, func)

Output the results of the data checks.

Parameters

binning_scaleint

The data binning scale.

camera_filesDict[str, str]

The image files separated by filter.

funcCallable

The output function (i.e., print or logger.info)

Parameters:
  • binning_scale (int)

  • camera_files (Dict[str, str])

  • func (Callable)

Return type:

None