;---------------------------------------------------------------------- ; NAME: ; image_process ; PURPOSE: ; Subtract the chop and nod images in an chop/nod set from the ; source image for all images contained in the input file list. ; ; EXPLANATION: ; Each line in the input file list is read and interpreted ; as the name of a image file in standard FITS format. The ; image names are sent to a second routine which performs the ; appropriate subtractions. If the bad_pixel mask is sent ; as an argument, all of the bad pixels are set to zero. ; The subtracted images will be written to the current directory. ; ; CALLING SEQUENCE: ; image_process ; 'imlist_name' [,'bad_pixel_map'] ; INPUTS: ; imlist - a list of 2 dimensional image array (integer or real) ; for which one wishes to identify the stars present ; OPTIONAL INPUTS: ; badPix - name of bad pixel map. Good pixels in the map should ; have a value of one. Bad pixels in the map should ; have a value of zero. ; ; OPTIONAL INPUT KEYWORDS: ; ; OPTIONAL OUTPUTS: ; ; NOTES: ; sub_image2 will output new file names (see sub_image2.pro) ; filelist_template.idl is list template and the path name for ; this file must be set appropriately. ; PROCEDURE CALLS: ; sub_image2 ; ; REVISION HISTORY: ;------------------------------------------------------------------------- PRO image_process, imlist , badPix ;retreive the list of FITS files. files_file=make_array(1, /STRING) restore, '/d1/data1/mirsi/analysis/filelist_template.idl' files_file=read_ascii(imlist, template=filelist_template) filelist=files_file.field1 nfiles=n_elements(filelist) ; If the file list contains a complete path name for each image ; for each FITS image retreive only the file names for writing ; the new files into the current directroy. for i=0, nfiles-1 DO BEGIN $ lastslash = strpos(filelist(i),'/', /REVERSE_SEARCH) ; file name for the created image. imageName = strmid(filelist(i), lastslash+1 ) ;if a badPix map is present, if N_PARAMS() EQ 2 THEN sub_image2, imageName, filelist(i), badPix ;if a bad pixel map is no supplied. if N_PARAMS() EQ 1 THEN sub_image2, imageName, filelist(i) endfor end