# Script for preprocessing images and saving preprocessed images # Replace the directory names below with actual ones # Comments are preceded by #s # Specify the names of the source and destination directories source_directory = Label( "F:\Images astro\ASI094\CruCar" ) dark_directory = Label( "Darks" ) flat_directory = Label( "Flats" ) light_directory = Label( "Lights" ) preprocessed_directory = Label( "Preprocessed" ) SetDirectory( source_directory ) # Produce master dark with a median Combine Open[0,0,0,2]( dark_directory ) master_dark = Combine[3]( "Dark frames" ) # Produce master flat with a median Combine Open[0,0,0,3]( flat_directory ) master_flat = Combine[3]( "Flat fields" ) # Dark subtraction; include subdirectories using option [1] Preprocess[1]( light_directory, master_dark ) # Flat fielding; dark-subtracted images are closed without saving using option [1] Preprocess[1]( master_flat ) # Do not save master dark or master flat; they are easy to reproduce Close( master_dark, master_flat ) # Save preprocessed images SaveAll( preprocessed_directory ) # Close all images; preprocessed_directory contains saved preprocessed images CloseAll()