opticam.utils.data_checks ========================= .. py:module:: opticam.utils.data_checks Functions --------- .. autoapisummary:: opticam.utils.data_checks.scan_data opticam.utils.data_checks.parse_header_results opticam.utils.data_checks.get_binning_scale Module Contents --------------- .. py:function:: scan_data(out_directory, data_directory, instrument, barycenter = True, verbose = True, return_output = False, logger = None, number_of_processors=cpu_count() // 2) Check that the data are self-consistent. Parameters ---------- out_directory : Path | str The path to the directory in which output files will be saved. data_directory : Path | str The path to the directory containing the data. instrument : Instrument The instrument that produced the data. barycenter : bool, optional Whether to apply a Barycentric correction to the image time stamps, by default `True`. Only relevant if `return_output=True`. verbose : bool, optional Whether to print any output info, by default `True`. return_output : bool, optional Whether to return any output, by default `False`. logger : Logger | 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, list[MEFSlice]], int, dict[str, float], list[MEFSlice], float]: If `return_output=True`, the files grouped by camera, binning scale, Barycentric MJD dates, ignored files, and the reference date are returned. Otherwise, nothing is returned. .. py:function:: parse_header_results(results, files, out_directory, logger) Parse the header info results. Parameters ---------- results : tuple[list[float], list[float], list[str], list[str], list[float]] The header info results. files : list[MEFSlice] The list of `MEFSlice` instances representing each image. out_directory : str The directory path to which any output files will be saved. logger : Logger | None The logger. Returns ------- tuple[str, dict[str, float], dict[str, str], dict[str, str], list[MEFSlice]] The binning scale, BMJD dates, cameras, filters, and ignored files. Raises ------ ValueError If more than three filters are detected. ValueError If more than one binning mode is detected. .. py:function:: get_binning_scale(binning) Given a binning mode string, extract the x and y binning scales as integers. Parameters ---------- binning : str The binning mode string (e.g., "2x2", "1 2", etc.). The first number is assumed to be the binning scale in x, while the second number is assumed to be the binning scale in y. Returns ------- int The binning scale.