check_files

check_files.check_file_exists(filename, argname)[source]

Checks if a file exists, and throws an error and exits if that file does not exist

Parameters:
  • filename (string) – Path to a file
  • argname (string) – The argument that was passed to a script, for error checking purposes
Returns:

filename – Path to a file

Return type:

string

check_files.check_if_fits_extension(name)[source]

Checks if name ends in “.fits”, appends if not

Parameters:name (string) – String to check
Returns:outname – A string that definitely ends in “.fits”
Return type:string
check_files.check_if_txt_extension(name)[source]

Checks if string name ends in “.txt”, appends if not

Parameters:name (string) – String to check
Returns:outname – A string that definitely ends in “.txt”
Return type:string