Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/35m_operations/35m_manual/Instruments/CorMass/Files/cormdiff.pro
Дата изменения: Thu Jul 8 07:52:30 2004
Дата индексирования: Sun Apr 10 09:19:55 2016
Кодировка:

Поисковые слова: внешние планеты
pro cormdiff,list,dir
;
;procedure to take difference of R2-R1 in CorMASS file (plane002 - plane001)
;and write difference to IRAF directory with new filename. This file is
;intended to be used in batch mode.
;
;input: list: string-type filename of list of files that
; contains names of arbitrary number of cormass
; data files to be differenced.
;
; dir: directory name (string-type) to which differenced
; files should be saved (do not include
; trailing / at end)
;
;written by: John C. Wilson
; Cornell University
;
;date: Jan 00
;
;MODIFICATIONS: Designate data to be float. Required because CorMASS data is
; unsigned integer. Without making the data floating point
; the differencing of the planes cause integer overflows
; for the '00 version of NASA's readfits.pro. -- Sep '00
;
;
on_error,1

nl=numlines(list) ;find number of files
print,'nl= ',nl ;using nasa pro numlines
files=strarr(nl)

openr,lun,list,/get_lun
readf,lun,files
free_lun,lun

index=rstrpos(files,'cm') ;separate filename from dir
newfiles=strarr(nl)

for i=0,nl-1 do begin

data=float(readfits(files[i],hdr))
d=size(data,/N_DIMENSIONS)
if d GT 0 then begin ;if data read correctly

pl1=reform(data[*,*,0])
pl2=reform(data[*,*,1])
newfiles[i]=strmid(files[i],index[i],5)
newfiles[i]=dir+'/'+newfiles[i]+'d.fits'
writefits,newfiles[i],(pl2-pl1),hdr
print,'wrote: ',newfiles[i]

endif

endfor

return
end