pro header,i ;This program displays the headers in the DB subdirectories. ;It is to be run from any one of the DB subdirectroies (like ./DB/Ir) ;i is the number of the file, in the directory (ie i=1 first, i=2 second, etc) ;for i=1 the program also lets you know how many files are in the directory. ;files=findfile('*',count = nfiles) files=t_getfil('*') & siz=size(files) & nfiles=siz(1) ;for lots of files if n_params() eq 0 then $ read,'There are ',sstr(nfiles),' files here. Which header would you like? (1 to ',sstr(nfiles),'): ',i print,'' if i lt 1 or i gt nfiles then begin & print,'There is no header ',sstr(i) & goto,exit2 & endif ;if i out of range if (nfiles eq 0) then begin print, '****No files found here!****' goto, exit endif if i eq 1 then print,nfiles,' files found' if strpos(files(i-1),'Ir') ne -1 then goto,ir ;for IR files use d_irread d_read,files(i-1),h0,p0 d_shead,h0 goto,exit ir: d_irread,files(i-1),h0,p0,g0 d_shead,h0 exit: d_shead,h0,'c:\idl_temp.txt' spawn,'notepad c:\idl_temp.txt' exit2: end