if "smf_flatfield" in invoke( "$HDSTRACE_DIR/hdstrace {0}.more.smurf.smurfhist".format( indata[0])): msg_out("Input data has already been flatfielded.") ff = indata except starutil.StarUtilError: pass # Flat field the supplied template data if not ff: ff = NDG.load("FF") if ff: msg_out("Re-using old flatfielded template data...") if not ff: ffdir = NDG.subdir() msg_out("Flatfielding template data...") invoke("$SMURF_DIR/flatfield in={0} out=\"{1}/*\"".format( indata, ffdir)) ff = NDG("{0}/\*".format(ffdir)) ff.save("FF") # Output files. Base the modification on "ff" rather than "indata", # since "indata" may include non-science files (flatfields, darks etc) # for which no corresponding output file should be created. gexp = parsys["OUT"].value outdata = NDG(ff, gexp) # If required, create new artificial I, Q and U maps. if newart: msg_out("Creating new artificial I, Q and U maps...")
raise UsageError("\n\nThe directory specified by parameter RESTART ({0}) " "does not exist".format(restart) ) fred = NDG.load( "IN", True ) if indata != fred: raise UsageError("\n\nThe directory specified by parameter RESTART ({0}) " "refers to different time-series data".format(restart) ) msg_out( "Re-using data in {0}".format(restart) ) # Initialise the starlink random number seed to a known value so that # results are repeatable. os.environ["STAR_SEED"] = "65" # Flat field the supplied template data ff = NDG.load( "FF" ) if not ff: ffdir = NDG.subdir() msg_out( "Flatfielding template data...") invoke("$SMURF_DIR/flatfield in={0} out=\"{1}/*\"".format(indata,ffdir) ) ff = NDG("{0}/\*".format(ffdir)) ff.save( "FF" ) else: msg_out( "Re-using old flatfielded template data...") # Output files. Base the modification on "ff" rather than "indata", # since "indata" may include non-science files (flatfields, darks etc) # for which no corresponding output file should be created. gexp = parsys["OUT"].value outdata = NDG( ff, gexp ) # If required, create new artificial I, Q and U maps. if newart: