opticam_new.utils.helpers ========================= .. py:module:: opticam_new.utils.helpers Functions --------- .. autoapisummary:: opticam_new.utils.helpers.camel_to_snake opticam_new.utils.helpers.euclidean_distance opticam_new.utils.helpers.find_closest_pair opticam_new.utils.helpers.log_binnings opticam_new.utils.helpers.log_filters opticam_new.utils.helpers.recursive_log opticam_new.utils.helpers.plot_catalog opticam_new.utils.helpers.sort_filters Module Contents --------------- .. py:function:: camel_to_snake(string) Convert a camelCase string to snake_case. Parameters ---------- string : str The camelCase string to convert. Returns ------- str The converted snake_case string. .. py:function:: euclidean_distance(p1, p2) Compute the Euclidean distance between two points. Parameters ---------- p1 : Tuple[float, float] The x and y coordinates of the first point. p2 : Tuple[float, float] The x and y coordinates of the second point. Returns ------- float The distance. .. py:function:: find_closest_pair(point, points, threshold) .. py:function:: log_binnings(file_paths, out_directory) Log the binning of each file to out_directory/diag/binnings.json. Parameters ---------- file_paths : List[str] The paths to the files. out_directory : str The directory to save the log. .. py:function:: log_filters(file_paths, out_directory) Logs the filters used in each file to out_directory/diag/filters.json. Parameters ---------- file_paths : List[str] The paths to the files. out_directory : str The directory to save the log. .. py:function:: recursive_log(param, depth = 0, max_depth = 5) Recursively log parameters. Parameters ---------- param : Any The parameter to log. depth : int, optional The parameter depth, by default 0. max_depth : int, optional The maximum parameter depth, by default 5. This prevents infinite recursion. Returns ------- Any The logged parameter. .. py:function:: plot_catalog(filters, stacked_images, catalogs) .. py:function:: sort_filters(d) Sort a dictionary whose keys are filter names in the order of the camera filters (e.g., u/g, r, i/z). Parameters ---------- d : Dict[str, Any] A dictionary with filter names as keys. Returns ------- Dict[str, Any] The sorted dictionary.