;---------------------------------------------------------------------- ; NAME: ; remove_pattern_spectra10micron ; PURPOSE: ; Remove the digital noise pattern from 10 micron spectra. ; 10 micron spectra are unique becuase the cutoff on the N-band ; filter limits light in the last channel. Thus the last channel ; should be completely dark except for the pattern noise. ; ; EXPLANATION: ; When called the program subracts the flux in the last channel ; from the channels 0-14 to remove the pattern noise. The ; pattern noise is present in each of the 16 (0-15) channels, ; but the last channel does not detect light because the ; transmission of the N-band filter used as a long wavelength ; blocking element is close to zero. ; ; This trick ONLY works for the 10 micron grism spectra. ; ; CALLING SEQUENCE: ; remove_pattern_spectra10micron , imlist ; prs10, imlist ; INPUTS: ; imlist - a filename for a file containing a list of images ; that need to be pattern corrected. ; ; OPTIONAL INPUTS: ; ; OPTIONAL INPUT KEYWORDS: ; ; OUTPUTS: ; output files will have the same image name as specified in ; the image list but will have the prefix 'p' which stands for ; pattern removed. ; ; OPTIONAL OUTPUTS: ; ; NOTES: ; This procedure requires that the path name for the filelist ; template is set to the appropriate path name. Pleas alter the ; path name for this file accordingly. ; ; ; PROCEDURE CALLS: ; ; REVISION HISTORY: ;------------------------------------------------------------------------- PRO rps10, imlist ;PRO remove_pattern_spectra10micron, imlist ; creates an array for the pattern to be subtracted. pattern = dblarr(20,240) ;avgpix an array for the average channel offsets. avgpix = dblarr(15) ;an array for the new data newData = dblarr(320,240) ;retreive the file list. files_file=make_array(1, /STRING) restore, '/d1/data1/mirsi/analysis/filelist_template.idl' ;restore, '/home/mkassis/IDL_pro/filelist_template.idl' files_file=read_ascii(imlist, template=filelist_template) filelist=files_file.field1 nfiles=n_elements(filelist) ; loops over the number of images FOR i=0, nfiles-1 DO BEGIN image_name = filelist(i) ;read the data data = READFITS(image_name, header, EXTEN_NO=0) ;get the pattern noise values from the last channel pattern[*,*] = data[300:319,0:239] ;subtract the pattern from the images. FOR l=0,15 DO BEGIN newData[l*20:l*20+19,*] = data[l*20:l*20+19,*] - pattern[*,*] ENDFOR ; write the image to disk. The image name has a the ; prefix 'p' to designate that the image has gone ; through a Pattern removal. The fits header is updated ; to reflect that the pattern was removed. history = 'Digital noise pattern removed for grism 10 spectra' sxaddhist, history, header image_name = 'p' + image_name writefits, image_name, newData, header ENDFOR end