parser.add_argument("-i", "--input", type=str, help="the name of the input directory") parser.add_argument("-o", "--output", type=str, help="the name of the output directory") # Interpolation method parser.add_argument("--method", type=str, help="the interpolation method to use", default="biharmonic") # Parse the command line arguments arguments = parser.parse_args() # ----------------------------------------------------------------- # If an input directory is given if arguments.input is not None: # Determine the full path to the input directory input_path = fs.absolute(arguments.input) # Give an error if the input directory does not exist if not fs.is_directory(input_path): raise argparse.ArgumentError(input_path, "The input directory does not exist") # If no input directory is given, assume the input is placed in the current working directory else: input_path = fs.cwd() # ----------------------------------------------------------------- # If an output directory is given if arguments.output is not None: # Determine the full path to the output directory output_path = fs.absolute(arguments.output)
help='write a report file') parser.add_argument("--keep", action="store_true", help="add this option to keep the remote input and output") parser.add_argument( "--retrieve", type=parsing.string_list, help="specify the types of output files that have to be retrieved") # Parse the command line arguments arguments = parser.parse_args() # ----------------------------------------------------------------- # Determine the full path to the parameter file arguments.filepath = fs.absolute(arguments.file) # Determine the full path to the input and output directories if arguments.input is not None: arguments.input_path = fs.absolute(arguments.input) if arguments.output is not None: arguments.output_path = fs.absolute(arguments.output) # ----------------------------------------------------------------- # Determine the log file path logfile_path = fs.join(fs.cwd(), time.unique_name("launch") + ".txt") if arguments.report else None # Determine the log level
# Input regions parser.add_argument("--ignore", type=str, help="the name of the file specifying regions to ignore (in sky coordinates!)") parser.add_argument("--special", type=str, help="the name of the file specifying regions with objects needing special attention (in sky coordinates!)") parser.add_argument("--bad", type=str, help="the name of the file specifying regions that have to be added to the mask of bad pixels") # Parse the command line arguments arguments = parser.parse_args() # ----------------------------------------------------------------- # If an input directory is given if arguments.input is not None: # Determine the full path to the input directory input_path = fs.absolute(arguments.input) # Give an error if the input directory does not exist if not fs.is_directory(input_path): raise argparse.ArgumentError(input_path, "The input directory does not exist") # If no input directory is given, assume the input is placed in the current working directory else: input_path = fs.cwd() # ----------------------------------------------------------------- # If an output directory is given if arguments.output is not None: # Determine the full path to the output directory output_path = fs.absolute(arguments.output)
parser.add_argument("--steps", action="store_true", help="write the results of intermediate steps") parser.add_argument("--config", type=str, help="the name of a configuration file") # Visualisation parser.add_argument("--visualise", action="store_true", help="make visualisations") # Parse the command line arguments arguments = parser.parse_args() # ----------------------------------------------------------------- # Determine the full input and output paths if arguments.output is None: arguments.output = fs.cwd() if arguments.input is None: arguments.input = fs.cwd() arguments.input = fs.absolute(arguments.input) arguments.output = fs.absolute(arguments.output) # ----------------------------------------------------------------- # Determine the log file path logfile_path = fs.join(arguments.output, time.unique_name("log") + ".txt") if arguments.report else None # Determine the log level level = "DEBUG" if arguments.debug else "INFO" # Initialize the logger log = logging.setup_log(level=level, path=logfile_path) log.start("Starting prepare_image ...") # -----------------------------------------------------------------
help="the name of a configuration file") # Visualisation parser.add_argument("--visualise", action="store_true", help="make visualisations") # Parse the command line arguments arguments = parser.parse_args() # ----------------------------------------------------------------- # Determine the full input and output paths if arguments.output is None: arguments.output = fs.cwd() if arguments.input is None: arguments.input = fs.cwd() arguments.input = fs.absolute(arguments.input) arguments.output = fs.absolute(arguments.output) # ----------------------------------------------------------------- # Determine the log file path logfile_path = fs.join(arguments.output, time.unique_name("log") + ".txt") if arguments.report else None # Determine the log level level = "DEBUG" if arguments.debug else "INFO" # Initialize the logger log = logging.setup_log(level=level, path=logfile_path) log.start("Starting prepare_image ...")
) parser.add_argument("--unit", type=str, help="the unit to which the recreated observed images should be converted") parser.add_argument("--debug", action="store_true", help="add this option to enable debug output") parser.add_argument("--report", action="store_true", help="write a report file") parser.add_argument("--keep", action="store_true", help="add this option to keep the remote input and output") parser.add_argument( "--retrieve", type=parsing.string_list, help="specify the types of output files that have to be retrieved" ) # Parse the command line arguments arguments = parser.parse_args() # ----------------------------------------------------------------- # Determine the full path to the parameter file arguments.filepath = fs.absolute(arguments.file) # Determine the full path to the input and output directories if arguments.input is not None: arguments.input_path = fs.absolute(arguments.input) if arguments.output is not None: arguments.output_path = fs.absolute(arguments.output) # ----------------------------------------------------------------- # Determine the log file path logfile_path = fs.join(fs.cwd(), time.unique_name("launch") + ".txt") if arguments.report else None # Determine the log level level = "DEBUG" if arguments.debug else "INFO"