npy_to_csv

macauff.npy_to_csv(input_csv_file_paths, cm, output_folder, output_filenames, column_name_lists, column_num_lists, extra_col_cat_names, correct_astro_flags, headers=[False, False], extra_col_name_lists=[None, None], extra_col_num_lists=[None, None], file_extension='')[source]

Function to convert output .npy files, as created during the cross-match process, and create a .csv file of matches and non-matches, combining columns from the original .csv catalogues.

Parameters:
input_csv_file_pathslist of strings

List of the locations in which the two respective .csv file catalogues are stored, including filename and extension.

cmClass

CrossMatch class, containing all of the necessary arrays of derived information from a cross-match run to save out to files.

output_folderstring

Folder into which to save the resulting .csv output files.

output_filenameslist of strings

List of the names, including extensions, out to which to save merged datasets.

column_name_listslist of list or array of strings

List containing two lists of strings, one per catalogue. Each inner list should contain the names of the columns in each respective catalogue to be included in the merged dataset – its ID or designation, two orthogonal sky positions, and N magnitudes, as were originally used in the matching process, and likely used in csv_to_npy.

column_num_listslist of list or array of integers

List containing two lists or arrays of integers, one per catalogue, with the zero-index column integers corresponding to those columns listed in column_name_lists.

extra_col_cat_nameslist of strings

List of two strings, one per catalogue, indicating the names of the two catalogues, to append to the front of the derived contamination-based values included in the output datasets.

correct_astro_flagslist of booleans

Flags, in the same order as input_csv_file_paths, for whether to save uncorrected and corrected astrometric uncertainties for each catalogue respectively. If a catalogue did not have its uncertainties processed, its entry should be False, so a case where both catalogues in a match had their uncertainties treated as given would be [False, False].

headerslist of booleans, optional

List of two boolmean flags, one per catalogue, indicating whether the original input .csv file for this catalogue had a header which provides names for each column on its first line, or whether its first line is the first line of the data.

extra_col_name_listslist of list or array of strings, or None, optional

Should be a list of two lists of strings, one per catalogue. As with column_name_lists, these should be names of columns from their respective catalogue in csv_filenames, to be included in the output merged datasets. For a particular catalogue, if no extra columns should be included, put None in that entry. For example, to only include an extra single column Q for the second catalogue, extra_col_name_lists=[None, ['Q']].

extra_col_num_listslist of list or array of integer, or None, optional

Should be a list of two lists of strings, analagous to column_num_lists, providing the column indices for additional catalogue columns in the original .csv files to be included in the output datafiles. Like extra_col_name_lists, for either catalogue None can be entered for no additional columns; for the above example we would use extra_col_num_lists=[None, [7]].

file_extensionstring, optional

Additional string to insert into loaded cross-match-specific files (such as ac.npy) and into saved files. Defaults to empty string, but should be given for cases of “with and without photometry” match runs, where a single cross-match run is used to create two separate match tables, and hence two separate output sets of .csv files.