# Process NIRIM image by subtracting lower half of stored image (pre-read) # from upper half of stored data (post-read) # Then, optionally subtract a "sky" image # And, optionally runs IMEXAMINE at end of processing # G. Jacoby -- September 3, 2001 # # Revised January 28, 2002 to: # eliminate need to convert image names to .fits (a copy of the # original file is made with a .fits extension) # # add a "raw" image directory name # # Install as: cl> task nproc = pathname$nproc.cl # procedure nproc (rawname, skyname) string rawname {prompt = "Image file name"} string skyname {prompt = "Sky image to subtract"} string rawdir = '' {prompt = "Raw directory name"} bool imexam = no {prompt = "Start up imexamine?"} begin string imagename, s1, s2, s3 string sky string fitsname string rdir string localname localname = rawname sky = skyname rdir = rawdir fitsname = localname // '.fits' # Create image names imagename = rdir // localname print ('Copying ',imagename,' to ',fitsname) copy (imagename, fitsname) s1 = localname // '[*,257:512]' s2 = localname // '[*,1:256]' s3 = localname // 'p' # Do the image subtract imarith (s1, '-', s2, s3) # Test for existence of sky image, and if present, subtract it if (imaccess(sky)) { print ("Subtracting sky image: ", sky) imarith (s3, '-', sky, s3) } # Display to frame 1 display (s3, 1) # Optionally, run IMEXAMINE if (imexam) imexamine end