;programme sum_read_corr_fits.pro ; ;project: ; SOHO - SUMER ;Purpose: ; Read fits files (all the BTE) ; Fill the gaps due to TM ; Apply the flatfield correction if not done on board ; Apply the deadtime correction (optional) ; Apply the pixel linearity correction ; Apply distortion correction ; Calibrate the data (optional) ; North-South Exchange to fit with the real position on the Sun ;Calls: ; sum_FField(data,slit,ref_pix,FFfile) ; deadtime_corr,detector,input,output ; local_gain_corr,detector,data(k,l,m),new_data(k,l,m) ; radiometry(slit,wavelength,order,rate,/keywords) ; destr_bilin_multi(data,slit,ref_pix,detector,/Quiet) ;Use: ; IDL>.r sum_read_corr_fits.pro ;Output: ; Corrected data of each column, for all the BTEs, in a ; sum_yymmdd_hhmmss.sav ; file, where yy is the year, mm the month and dd the day, ; hh the hours, etc.... ; This file contains D_i arrays, where i is the column number ; the size of the arrays is (temporal,y_height,number_of_BTEs). ; The sum_yymmdd_hhmmss.sav file must be restore by ; IDL> restore sum_yymmdd_hhmmss.sav ; Example: ; IDL> restore,'SUM_971104_214651.SAV' ; IDL> help ; % At $MAIN$ ; DEL_TIME DOUBLE = Array[1, 6] ; EXPTIME FLOAT = Array[1, 6] ; H0 STRING = Array[75] ; H1 STRING = Array[67] ; SOLAR_X FLOAT = Array[1, 6] ; SOLAR_Y FLOAT = Array[1, 6] ; SUMSTATUS INT = Array[1, 6, 5] ; W_1 FLOAT = Array[50, 120, 6] ; ; **** WARNING **** ; Be careful when restoring the sum_yymmdd_hhmmss.sav files: ; Do not forget to rename the arrays that you want to restore ; if you don't want to delete them when restoring the next file: ; the names of the variables that contain the data are the same ; in all sum_yymmdd_hhmmss.sav files. ; ; ;Restrictions: ; This program should NOT be used on data which has been binned or ; subject to compression schemes 6 and up. ;Written: ; Karine Bocchialini & Philippe Lemaire ; March 1998 ; Modified: Feb. 25 2000 (after/before SOHO recovery) ; Modified: Jan. 11 2001 ; Modified: Mar. 23 2001 ; Last modification: Jun 15 2001 ; Updates Jan 03 2002 : for spectral scan files ; Updates Jan 08 2002 : pixel linearity and dead_time corrections ;******************************************************************* pro ffieldcorr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,$ nbcol,slit,ref_pix,FFfile help,d0 print,ref_pix for i=0,nbcol-6 do begin case i of 0: d0=sum_FField(d0,slit,ref_pix(0),FFfile) 1: d1=sum_FField(d1,slit,ref_pix(1),FFfile) 2: d2=sum_FField(d2,slit,ref_pix(2),FFfile) 3: d3=sum_FField(d3,slit,ref_pix(3),FFfile) 4: d4=sum_FField(d4,slit,ref_pix(4),FFfile) 5: d5=sum_FField(d5,slit,ref_pix(5),FFfile) 6: d6=sum_FField(d6,slit,ref_pix(6),FFfile) 7: d7=sum_FField(d7,slit,ref_pix(7),FFfile) 8: d8=sum_FField(d8,slit,ref_pix(8),FFfile) 9: d9=sum_FField(d9,slit,ref_pix(9),FFfile) 10: d10=sum_FField(d10,slit,ref_pix(10),FFfile) 11: d11=sum_FField(d11,slit,ref_pix(11),FFfile) 12: d12=sum_FField(d12,slit,ref_pix(12),FFfile) 13: d13=sum_FField(d13,slit,ref_pix(13),FFfile) 14: d14=sum_FField(d14,slit,ref_pix(14),FFfile) 15: d15=sum_FField(d15,slit,ref_pix(15),FFfile) 16: d16=sum_FField(d16,slit,ref_pix(16),FFfile) endcase endfor return end ;******************************************************* ;pro black_white_corr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ ; d13,d14,d15,d16,nbcol pro bwc,dd,dim_lambda,dim_t,dim_dim,dim for i=1,dim_lambda-1 do begin if dim_dim eq 3 then begin zeros_tot=where(dd(i,*,*) eq 0) dim_z=size(zeros_tot) if float(dim_z(1))/(float(dim(2))*float(dim(3)))*100. lt 10. then begin for k=1,dim_t-2 do begin zeros_1=where(dd(i,*,k) eq 0) dim_1=size(zeros_1) if dim_1(0) ne 0 and dim_1(1) ge 4 then begin cond=where(zeros_1(0:dim_1(1)-2)-zeros_1(1:dim_1(1)-1) eq -1) dim_2=size(cond) if dim_2(0) ne 0 then $ dd(i,zeros_1(cond),k)= $ (dd(i,zeros_1(cond),k-1)+dd(i,zeros_1(cond),k+1))/2. endif diff=where(dd(i,*,k) ge 10*dd(i,*,k-1)) dim_1=size(diff) if dim_1(0) ne 0 and dim_1(1) ge 4 and i ne 0 then begin cond=where(diff(0:dim_1(1)-2)-diff(1:dim_1(1)-1) eq -1) dim_2=size(cond) if dim_2(0) ne 0 then $ dd(i,diff(cond),k)=dd(i-1,diff(cond),k) endif endfor endif if dim_z(1)/(dim(2)*dim(3))*100. ge 10. then print,'too many 0 in the image ; no HOLE correction applied' endif endfor return end pro black_white_corr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,nbcol dim=size(d0) dim_lambda=dim(1) dim_t=dim(3) dim_dim=dim(0) for ima=0,nbcol-6 do begin case ima of 0: bwc,d0,dim_lambda,dim_t,dim_dim,dim 1: bwc,d1,dim_lambda,dim_t,dim_dim,dim 2: bwc,d2,dim_lambda,dim_t,dim_dim,dim 3: bwc,d3,dim_lambda,dim_t,dim_dim,dim 4: bwc,d4,dim_lambda,dim_t,dim_dim,dim 5: bwc,d5,dim_lambda,dim_t,dim_dim,dim 6: bwc,d6,dim_lambda,dim_t,dim_dim,dim 7: bwc,d7,dim_lambda,dim_t,dim_dim,dim 8: bwc,d8,dim_lambda,dim_t,dim_dim,dim 9: bwc,d9,dim_lambda,dim_t,dim_dim,dim 10: bwc,d10,dim_lambda,dim_t,dim_dim,dim 11: bwc,d11,dim_lambda,dim_t,dim_dim,dim 12: bwc,d12,dim_lambda,dim_t,dim_dim,dim 13: bwc,d13,dim_lambda,dim_t,dim_dim,dim 14: bwc,d14,dim_lambda,dim_t,dim_dim,dim 15: bwc,d15,dim_lambda,dim_t,dim_dim,dim 16: bwc,d16,dim_lambda,dim_t,dim_dim,dim endcase endfor return end ;******************************************************* ;pro dead_time_corr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ ; d13,d14,d15,d16,detector,nbcol,expos pro dtc,dd,detector,expos r_expos=1./expos siz=size(dd) if siz(0) eq 3 then begin ddp=fltarr(siz(1),siz(2)) for k=0,siz(3)-1 do begin add=where(dd(*,*,k) lt 0, number) if number gt 0 then begin print,k,"expos=",expos,"add=",add,"number=",number addx=fltarr(number) addy=fltarr(number) addx=add mod siz(1) addy=fix(add/siz(1)) dd(addx,addy,k)=(32768+dd(addx,addy,k))+32768 print,k," dd(add)",dd(addx,addy,k) endif dd(*,*,k)=dd(*,*,k)*r_expos ddp(*,*)=dd(*,*,k) if total(ddp) gt 50000. then begin ddtot=total(dd(*,*,k)) deadtime_corr,detector,ddp,ddp dd(*,*,k)=ddp(*,*) print,k," total(dd(*,*,k))=",ddtot,total(dd(*,*,k)),' total cnt/s' endif dd(*,*,k)=dd(*,*,k)*expos endfor endif else begin add=where(dd lt 0, number) if number gt 0 then begin print,expos,add addx=fltarr(number) addy=fltarr(number) addx=add mod siz(1) addy=fix(add/siz(1)) dd(addx,addy)=(32768+dd(addx,addy))+32768 print,"dd(add)",dd(addx,addy) endif dd=dd*r_expos if total(dd) gt 50000. then begin ddtot=total(dd) deadtime_corr,detector,dd,dd print,"total(dd)=",ddtot,total(dd),' total cnt/s' endif dd=dd*expos endelse return end pro dead_time_corr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,detector,nbcol,expos for i=0,nbcol-6 do begin case i of 0: dtc,d0,detector,expos 1: dtc,d1,detector,expos 2: dtc,d2,detector,expos 3: dtc,d3,detector,expos 4: dtc,d4,detector,expos 5: dtc,d5,detector,expos 6: dtc,d6,detector,expos 7: dtc,d7,detector,expos 8: dtc,d8,detector,expos 9: dtc,d9,detector,expos 10: dtc,d10,detector,expos 11: dtc,d11,detector,expos 12: dtc,d12,detector,expos 13: dtc,d13,detector,expos 14: dtc,d14,detector,expos 15: dtc,d15,detector,expos 16: dtc,d16,detector,expos endcase endfor return end ;******************************************************** ;pro pixlincorr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ ; d13,d14,d15,d16,nbcol,detector,expos pro plc,dd,expos,detector r_expos=1./expos siz=size(dd) if siz(0) eq 3 then begin ddp=fltarr(siz(1),siz(2)) for k=0,siz(3)-1 do begin add=where(dd(*,*,k) lt 0, number) if number gt 0 then begin print,expos,add,number addx=fltarr(number) addy=fltarr(number) addx=add mod siz(1) addy=fix(add/siz(1)) dd(addx,addy,k)=(32768+dd(addx,addy,k))+32768 print,k," dd(add)",dd(addx,addy,k) endif dd(*,*,k)=dd(*,*,k)*r_expos ddmax=max(dd(*,*,k)) ddp(*,*)=dd(*,*,k) local_gain_corr,detector,ddp,ddp dd(*,*,k)=ddp(*,*) if ddmax gt 20. then print,k," max(dd(*,*,k)=",ddmax,max(dd(*,*,k)),$ ' max cnt/pix/s' dd(*,*,k)=dd(*,*,k)*expos endfor endif else begin add=where(dd lt 0, number) if number gt 0 then begin print,expos,add addx=fltarr(number) addy=fltarr(number) addx=add mod siz(1) addy=fix(add/siz(1)) dd(addx,addy)=(32768+dd(addx,addy))+32768 print,"dd(add)",dd(addx,addy),' max cnt/pix/s' endif dd=dd*r_expos ddmax=max(dd) local_gain_corr,detector,dd,dd if ddmax gt 20. then print,"max(dd)=",ddmax,max(dd),' max cnt/pix/s' dd=dd*expos endelse return end pro pixlincorr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,nbcol,detector,expos dsize=size(d0) for i=0,nbcol-6 do begin case i of 0: plc,d0,expos,detector 1: plc,d1,expos,detector 2: plc,d2,expos,detector 3: plc,d3,expos,detector 4: plc,d4,expos,detector 5: plc,d5,expos,detector 6: plc,d6,expos,detector 7: plc,d7,expos,detector 8: plc,d8,expos,detector 9: plc,d9,expos,detector 10: plc,d10,expos,detector 11: plc,d11,expos,detector 12: plc,d12,expos,detector 13: plc,d13,expos,detector 14: plc,d14,expos,detector 15: plc,d15,expos,detector 16: plc,d16,expos,detector endcase endfor return end ;************************************************************ ;pro calibration,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ ; d13,d14,d15,d16,$ ; w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12,$ ; w13,w14,w15,w16,$ ; detector,slit,order,expos,nbcol pro detec_test,dd,ww,detector,slit,order,expos,revet,detec,refpix,nrj,att print,'Watt or Photons (Default is Watt) W or P ?' nrj='' read,nrj if ww lt 465. then begin ww=2*ww order='1' endif else begin print,'What order: 1(st) or 2(nd) ? (default is 1st)' order='' read,order if order eq '2' then order='2' else order='1' endelse print,'Please wait' d_size=size(dd) dd_temp=dd if d_size(1) eq 1024 then refpix=512 pix0=refpix-d_size(1)/2 pixmax=pix0+d_size(1) pix_mid=d_size(2)/2 if pix0 le 0 then pix0=0 if pixmax gt 1023 then pixmax=1023 revet='' rap=0 for pix=pix0,pixmax-1 do begin index=pix-pix0 if d_size(0) eq 2 then dd_sub=total(dd(index,*),2)/d_size(2) if d_size(0) eq 3 then dd_sub=total(dd(index,*,*),2)/d_size(2) revet_temp=revet case detec of 'det_a': begin if pix ge 963 then begin revet='attenuator' endif else begin if pix ge 746 then begin revet='bare' endif else begin if pix ge 251 then begin revet='kbr' endif else begin if pix ge 37 then begin revet='bare' endif else begin revet='attenuator' endelse endelse endelse endelse if revet_temp eq revet and rap ne 0 then begin if d_size(0) eq 2 then dd_temp(index,*)=rap*dd(index,*) if d_size(0) eq 3 then dd_temp(index,*,*)=rap*dd(index,*,*) endif else begin cali,dd_sub,ww,detector,slit,order,expos,revet,detec,$ refpix,rap,nrj,att if d_size(0) eq 2 then dd_temp(index,*)=rap*dd(index,*) if d_size(0) eq 3 then dd_temp(index,*,*)=rap*dd(index,*,*) endelse end 'det_b': begin if pix ge 975 then begin revet='attenuator' endif else begin if pix ge 754 then begin revet='bare' endif else begin if pix ge 266 then begin revet='kbr' endif else begin if pix ge 53 then begin revet='bare' endif else begin revet='attenuator' endelse endelse endelse endelse if revet_temp eq revet and rap ne 0 then begin if d_size(0) eq 2 then dd_temp(index,*)=rap*dd(index,*) if d_size(0) eq 3 then dd_temp(index,*,*)=rap*dd(index,*,*) endif else begin cali,dd_sub,ww,detector,slit,order,expos,revet,detec,$ refpix,rap,nrj,att if d_size(0) eq 2 then dd_temp(index,*)=rap*dd(index,*) if d_size(0) eq 3 then dd_temp(index,*,*)=rap*dd(index,*,*) endelse end endcase endfor dd=temporary(dd_temp) return end pro cali,dd_sub,ww,detector,slit,order,expos,revet,detec,refpix,rap,nrj,att phot=0 & wat=0 if nrj eq 'P' or nrj eq 'p' or nrj eq 'PHOTONS' or nrj eq 'photons' then phot=1 else wat=1 deta=0 & detb=0 if detec eq 'det_a' then deta=1 else detb=1 ;for files obtained in Y2K if att lt 100000. then att=att+20000000. bef=0 & aft=0 if att lt 980701. then bef=1 else aft=1 epo0=0 & epo1=0 & epo2=0 & epo3=0 & epo4=0 & epo5=0 & epo6=0 ;if att ge 961120. and att lt 970512. then epo0=1 ;if att ge 970513. and att lt 970805. then epo1=1 ;if att ge 970806. and att lt 990129. then epo2=1 ;if att ge 990130. and att lt 990209. then epo3=1 ;if att ge 990210. and att lt 990427. then epo4=1 ;if att ge 990428. and att lt 991008. then epo5=1 if att ge 991008. then epo6=1 else epo5=1 revet=strlowcase(revet) kkbbrr=0 & baare=0 & attenu=0 case revet of 'kbr' : begin kkbbrr=1 dd_sub1=radiometry(slit,ww,order,dd_sub/expos,det_a=deta,det_b=detb,kbr=kkbbrr,bare=baare,PHOTONS=phot,Watt=wat,before=bef,after=aft,epoch_0=epo0,epoch_1=epo1,epoch_2=epo2,epoch_3=epo3,epoch_4=epo4,epoch_5=epo5,epoch_6=epo6) end 'bare' : begin baare=1 dd_sub1=radiometry(slit,ww,order,dd_sub/expos,det_a=deta,det_b=detb,kbr=kkbbrr,bare=baare,PHOTONS=phot,Watt=wat,before=bef,after=aft,epoch_0=epo0,epoch_1=epo1,epoch_2=epo2,epoch_3=epo3,epoch_4=epo4,epoch_5=epo5,epoch_6=epo6) end 'attenuator' : begin baare=1 ; necessaire pour RADIOMETRY qui ne connait pas ATTENUATOR ; attenu=1 dd_sub1=radiometry(slit,ww,order,dd_sub/expos,det_a=deta,det_b=detb,kbr=kkbbrr,bare=baare,PHOTONS=phot,Watt=wat,before=bef,after=aft,epoch_0=epo0,epoch_1=epo1,epoch_2=epo2,epoch_3=epo3,epoch_4=epo4,epoch_5=epo5,epoch_6=epo6) dd_sub1=dd_sub1*10 end endcase dd_size=size(dd_sub) if dd_size(0) eq 1 then begin if dd_sub1(0) eq 0 then rap=0 if dd_sub1(0) ne 0 then rap=dd_sub1(0)/dd_sub(0) endif if dd_size(0) eq 2 then begin if dd_sub1(0,0) eq 0 then rap=0 if dd_sub1(0,0) ne 0 then rap=dd_sub1(0,0)/dd_sub(0,0) endif return end pro calibration,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,$ w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12,$ w13,w14,w15,w16,$ detector,slit,order,expos,nbcol,ref_pix,att help,att if detector eq 'A' then detec='det_a' if detector eq 'B' then detec='det_b' for i=0,nbcol-6 do begin case i of 0: detec_test,d0,w0,detector,slit,order,expos,revet,detec,ref_pix(0),nrj,att 1: detec_test,d1,w1,detector,slit,order,expos,revet,detec,ref_pix(1),nrj,att 2: detec_test,d2,w2,detector,slit,order,expos,revet,detec,ref_pix(2),nrj,att 3: detec_test,d3,w3,detector,slit,order,expos,revet,detec,ref_pix(3),nrj,att 4: detec_test,d4,w4,detector,slit,order,expos,revet,detec,ref_pix(4),nrj,att 5: detec_test,d5,w5,detector,slit,order,expos,revet,detec,ref_pix(5),nrj,att 6: detec_test,d6,w6,detector,slit,order,expos,revet,detec,ref_pix(6),nrj,att 7: detec_test,d7,w7,detector,slit,order,expos,revet,detec,ref_pix(7),nrj,att 8: detec_test,d8,w8,detector,slit,order,expos,revet,detec,ref_pix(8),nrj,att 9: detec_test,d9,w9,detector,slit,order,expos,revet,detec,ref_pix(9),nrj,att 10: detec_test,d10,w10,detector,slit,order,expos,revet,detec,ref_pix(10),nrj,att 11: detec_test,d11,w11,detector,slit,order,expos,revet,detec,ref_pix(11),nrj,att 12: detec_test,d12,w12,detector,slit,order,expos,revet,detec,ref_pix(12),nrj,att 13: detec_test,d13,w13,detector,slit,order,expos,revet,detec,ref_pix(13),nrj,att 14: detec_test,d14,w14,detector,slit,order,expos,revet,detec,ref_pix(14),nrj,att 15: detec_test,d15,w15,detector,slit,order,expos,revet,detec,ref_pix(15),nrj,att 16: detec_test,d16,w16,detector,slit,order,expos,revet,detec,ref_pix(16),nrj,att endcase endfor return end ;******************************************************** pro destrcorr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,nbcol,detector,ref_pix,slit,repenv for i=0,nbcol-6 do begin case i of 0: d0=destr_bilin_multi_fits(d0,slit,ref_pix(0),detector,/Quiet) 1: d1=destr_bilin_multi_fits(d1,slit,ref_pix(1),detector,/Quiet) 2: d2=destr_bilin_multi_fits(d2,slit,ref_pix(2),detector,/Quiet) 3: d3=destr_bilin_multi_fits(d3,slit,ref_pix(3),detector,/Quiet) 4: d4=destr_bilin_multi_fits(d4,slit,ref_pix(4),detector,/Quiet) 5: d5=destr_bilin_multi_fits(d5,slit,ref_pix(5),detector,/Quiet) 6: d6=destr_bilin_multi_fits(d6,slit,ref_pix(6),detector,/Quiet) 7: d7=destr_bilin_multi_fits(d7,slit,ref_pix(7),detector,/Quiet) 8: d8=destr_bilin_multi_fits(d8,slit,ref_pix(8),detector,/Quiet) 9: d9=destr_bilin_multi_fits(d9,slit,ref_pix(9),detector,/Quiet) 10: d10=destr_bilin_multi_fits(d10,slit,ref_pix(10),detector,/Quiet) 11: d11=destr_bilin_multi_fits(d11,slit,ref_pix(11),detector,/Quiet) 12: d12=destr_bilin_multi_fits(d12,slit,ref_pix(12),detector,/Quiet) 13: d13=destr_bilin_multi_fits(d13,slit,ref_pix(13),detector,/Quiet) 14: d14=destr_bilin_multi_fits(d14,slit,ref_pix(14),detector,/Quiet) 15: d15=destr_bilin_multi_fits(d15,slit,ref_pix(15),detector,/Quiet) 16: d16=destr_bilin_multi_fits(d16,slit,ref_pix(16),detector,/Quiet) endcase endfor return end ;******************************************************** ;******************************************************** ;main programme : read and correction of the fits files ;******************************************************** print,'????????????????????????????????????????????' print,'' print,' Any problem ? Mail to bocchialini@ias.fr' print,'' print,'????????????????????????????????????????????' answer='' print,'Help ? Y(es) or N(o)' read,answer if answer eq 'Y' or answer eq 'y' then begin print,';----------------------------------------------------------' print,';programme sum_read_corr_fits.pro' print,';' print,';project:' print,'; SOHO - SUMER' print,';Purpose:' print,'; Read fits files (all the BTE)' print,'; Fill the gaps due to TM' print,'; Apply the flatfield correction if not done on board' print,'; Apply the deadtime correction (optional) print,'; Apply the pixel linearity correction' print,'; Apply the distorsion correction' print,'; Calibrate the data (optional)' print,'; North-South Exchange to fit with the real position on the Sun' print,';Calls:' print,'; sum_FField(data,slit,ref_pix,FFfile)' print,'; deadtime_corr,detector,input,output print,'; local_gain_corr,detector,data(k,l,m),new_data(k,l,m)' print,'; destr_bilin_multi(data,slit,ref_pix,detector,/Quiet)' print,'; radiometry(slit,wavelength,order,rate,/keywords)' print,';Use:' print,'; IDL>.r sum_read_corr_fits.pro' print,'Output:' print,' Corrected data of each column, for all the BTEs, in a' print,' sum_yymmdd_hhmmss.sav' print,' file, where yy is the year, mm the month and dd the day,' print,'' print,' hh the hours, etc....' print,' This file contains D_i arrays, where i is the column number' print,' the size of the arrays is (temporal,y_height,number_of_BTEs).' print,' The sum_yymmdd_hhmmss.sav file must be restore by' print,' IDL> restore sum_yymmdd_hhmmss.sav' print,' Example:' print," IDL> restore,'SUM_971104_214651.SAV'" print,' IDL> help' print,' % At $MAIN$' print,' DEL_TIME DOUBLE = Array[1, 6]' print,' EXPTIME FLOAT = Array[1, 6]' print,' H0 STRING = Array[75]' print,' H1 STRING = Array[67]' print,' SOLAR_X FLOAT = Array[1, 6]' print,' SOLAR_Y FLOAT = Array[1, 6]' print,' SUMSTATUS INT = Array[1, 6, 5]' print,' W_1 FLOAT = Array[50, 120, 6]' print,'' print,' **** WARNING ****' print,' Be careful when restoring the sum_yymmdd_hhmmss.sav files:' print,' Do not forget to rename the arrays that you want to restore' print,' if you do not want to delete them when restoring the next file:' print,' the names of the variables that contain the data are the same' print,' in all sum_yymmdd_hhmmss.sav files.' print,'' print,';Restrictions:' print,'; This program should NOT be used on data which has been binned or' print,'; subject to compression schemes 6 and up.' print,';Written:' print,'; Karine Bocchialini & Philippe Lemaire' print,'; May 1998' print,'; Modified Feb. 25 2000 (after/before SOHO recovery)' print,'; Modified: Jan. 11 2001' print,'; Last modification: Mar. 23 2001' print,'; Modified: Mar. 23 2001 print,'; Last modification: Jun 15 2001 print,'; Updates Jan 03 2002 : for spectral scan files ' print,'; Updates Jan 08 2002 : for pixel linearity and dead_time correction' print,';---------------------------------------------------------------------' endif print,'-----------------------------------------------' print,' WARNING !! ' print,'This procedure is convenient for FITS files ' print,'This procedure is NOT convenient for FTS files ' print,' ' print,'-----------------------------------------------' print,'Continue ? (Y/N) (default is Y)' continue_rep='' read,continue_rep if continue_rep ne 'N' and continue_rep ne 'n' then begin repenv='' read,'What is your environment ? Unix (U) or VMS (V) (default is U)',repenv if repenv eq 'V' or repenv eq 'v' then $ setlog,'SUMER_CALIB','CONTRIB:[000000.moran]' close,11 print,'' if repenv eq 'V' or repenv eq 'v' then begin print,'The names of the files you want to process must be listed in ' print,' a file named (toto).fits, e.g. as following:' print,'FARFITS1:sum_971131_252525.fits' print,'FARFITS1:sum_971131_252530.fits' print,'etc...' endif else begin print,'The names of the files you want to process must be listed in ' print,'a file named (toto).fits, e.g. as following:' print,'mydir/sum_971131_252525.fits' print,'mydir/sum_971131_252530.fits' print,'etc...' endelse print,'' print,'' print,'Deadtime effects become significant for total' print,'count rates of 50000 cnt/s and more.' print,'Check the count rates with IDL> xspect' print,'before using this routine.' print,'If the count rates are greater than 50000 cnt/s,' print,'the deadtime correction MUST be applied' print,'Do you want to apply the deadtime correction (default is No):' print,' Y(es)/N(o) ?' ans_dead='' read,ans_dead print,'' print,'' print,'Do you want to calibrate the data (default is NO) ? Y(es)/N(o)' ans_calib='' read,ans_calib print,'' print,'' print,'Enter the name of the file containing the list' filename='' read,filename openr,11,filename str='' FFfile='' print,'' print,'' if repenv eq 'V' or repenv eq 'v' then $ print,'e.g. for flatfield filename: FARFITS1:SUMFF_970812_210207.FITS' if repenv ne 'V' and repenv ne 'v' then $ print,'e.g. for flatfield filename: mydir/SUMFF_970812_210207.FITS' print,'enter your flatfield file name (if flatfield correction applied read,'on-board then just hit "enter"):',fffile print,'' print,'' ;first read of the fits file in order to determine several parameters ;such as the slit, the detector, .... ;___________________________________________________________________ totrepeat=0 repeat begin totrepeat=totrepeat+1 readf,11,str ; pos = STRPOS(str,'_') ; rep_fits = (STRCOMPRESS(STRMID(str,pos-3,22),/REMOVE_ALL)) ; repsav=strmid(rep_fits,0,17) parts = STR_SEP(str,'/') dim_parts = N_ELEMENTS(parts) str = parts(dim_parts-1) pos = STRPOS(str,'_') rep_fits = STRCOMPRESS(STRMID(str,pos-3,30),/REMOVE_ALL) pos_point = STRPOS(rep_fits,'.') len_str = STRLEN(rep_fits) len_point = len_str - pos_point n=5 ; pour les fichiers fits IF (len_point LE n) THEN BEGIN repsav = STRMID(rep_fits, 0, pos_point) ENDIF ELSE BEGIN repsav = STRMID(rep_fits, 0, pos_point) + STRMID(rep_fits, pos_point + n, len_str) ENDELSE str=rep_fits print,'filename:',str att=(STRCOMPRESS(STRMID(str,pos+1,6),/REMOVE_ALL)) ;because of radiometry before or att=float(att) ;after SOHO recovery d0=fltarr(1) d1=d0 & d2=d0 & d3=d0 & d4=d0 & d5=d0 & d6=d0 & d7=d0 & d8=d0 d9=d0 & d10=d0 & d11=d0 & d12=d0 & d13=d0 & d14=d0 & d15=d0 & d16=d0 d17=d0 & d18=d0 & d19=d0 & d20=d0 & d21=d0 ft_sumread_fits,str,h0,h1,m,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ /all,bte=1 ;Search the type ;-------------- KEYW_OBS = 'SPECTRAL SCAN' spec_scan = FXPAR(h0,'OBS_SEQ') spec_scan = STRUPCASE(STRTRIM(spec_scan,2)) ; Search #columns ;---------------- col = FXPAR(h1,'TFIELDS') leng = STRLEN(col) pos = STRPOS(col,'=') nbcol = FIX(STRCOMPRESS(STRMID(col,pos + 1,leng - pos),/REMOVE_ALL)) ; Determine the # BTE ;-------------------- ext_name = FXPAR(h1,'EXTNAME') leng = STRLEN(ext_name) pos = STRPOS(ext_name,'/') nbte = STRMID(ext_name,pos + 1,leng - pos) ;Determine the ref copixel ;-------------------------- ref_pix=intarr(nbcol-5) fxbfind,h1,'TRPIX',columns,values,N_found ;print,columns,values,N_found for ij=0,nbcol-6 do begin ppp=strpos(strcompress(values(ij),/remove_all),',') ref_pix(ij)=fix(strmid(strcompress(values(ij),/remove_all),1,ppp-1)) endfor ;print,ref_pix ref_pix=long(ref_pix) ;Determine the slit ;__________________ ext_name = FXPAR(h0,'SLIT') leng = STRLEN(ext_name) pos = STRPOS(ext_name,'<') slit = fix(STRMID(ext_name,pos + 1,1)) print,'slit:',slit if slit lt 1 then slit=sl sl=slit ;Determine the detector (A or B) ;______________________________ ext_name = FXPAR(h0,'DETECTOR') leng = STRLEN(ext_name) pos = STRPOS(ext_name,'> ') detector = STRMID(ext_name,pos+2,1) if detector ne 'A' and detector ne 'B' then detector=detect for ij=0,nbcol-6 do begin if ref_pix(ij) lt 0 and detector eq 'B' then ref_pix(ij)=2653+ref_pix(ij) if ref_pix(ij) gt 1023 then ref_pix(ij)=ref_pix(ij-1) endfor detect=detector print,'Detector:',detector ;Determine the exposure time ;______________________________ ext_name = FXPAR(h0,'EXPTIME') leng = STRLEN(ext_name) pos = STRPOS(ext_name,'= ') expos = float(STRMID(ext_name,pos+1,leng-pos)) if expos lt 0.001 then expos=exposure print,'Exposure Time:',expos exposure=expos ;wait,5 ;Determine if onboard Flatfield was applied ;------------------------------------------ ext_name = FXPAR(h0,'FFONOFF') leng = STRLEN(ext_name) ffonoff = STRMID(ext_name,leng-1,1) if ffonoff eq 1 then print,'Flatfield correction already applied on board' ;-------------------------------------------------------------------------- ;initialization of the parameters ;-------------------------------- ibte=1 ;************************************************************************ size_all_alld=size(all_alld) size_all_alld(1)=0 size_all_allexp=size(all_allexp) size_all_allexp(1)=0 ;loop on all the BTEs ;---------------------- repeat begin ;reads the fits file ;-------------------- ft_sumread_fits,str,h0,h1,m,$ d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ /all,bte=ibte if (nbcol gt 13) or (spec_scan eq KEYW_OBS) then begin for m=0,nbcol-6 do begin case m of 0: d_temp0=d0(*,*,0) 1: d_temp1=d0(*,*,1) 2: d_temp2=d0(*,*,2) 3: d_temp3=d0(*,*,3) 4: d_temp4=d0(*,*,4) 5: d_temp5=d0(*,*,5) 6: d_temp6=d0(*,*,6) 7: d_temp7=d0(*,*,7) 8: d_temp8=d0(*,*,8) 9: d_temp9=d0(*,*,9) 10: d_temp10=d0(*,*,10) 11: d_temp11=d0(*,*,11) 12: d_temp12=d0(*,*,12) 13: d_temp13=d0(*,*,13) 14: d_temp14=d0(*,*,14) 15: d_temp15=d0(*,*,15) 16: d_temp16=d0(*,*,16) endcase endfor case (nbcol-6) of 0 : begin d0 = temporary(d_temp0) end 1 : begin d0 = temporary(d_temp0) d1 = temporary(d_temp1) end 2 : begin d0 = temporary(d_temp0) d1 = temporary(d_temp1) d2 = temporary(d_temp2) end 3 : begin d0 = temporary(d_temp0) d1 = temporary(d_temp1) d2 = temporary(d_temp2) d3 = temporary(d_temp3) end 4 : begin d0 = temporary(d_temp0) d1 = temporary(d_temp1) d2 = temporary(d_temp2) d3 = temporary(d_temp3) d4 = temporary(d_temp4) end 5 : begin d0 = temporary(d_temp0) d1 = temporary(d_temp1) d2 = temporary(d_temp2) d3 = temporary(d_temp3) d4 = temporary(d_temp4) d5 = temporary(d_temp5) end 6 : begin d0 = temporary(d_temp0) d1 = temporary(d_temp1) d2 = temporary(d_temp2) d3 = temporary(d_temp3) d4 = temporary(d_temp4) d5 = temporary(d_temp5) d6 = temporary(d_temp6) end 7 : begin d0 = temporary(d_temp0) d1 = temporary(d_temp1) d2 = temporary(d_temp2) d3 = temporary(d_temp3) d4 = temporary(d_temp4) d5 = temporary(d_temp5) d6 = temporary(d_temp6) d7 = temporary(d_temp7) end 8 : begin d0 = temporary(d_temp0) d1 = temporary(d_temp1) d2 = temporary(d_temp2) d3 = temporary(d_temp3) d4 = temporary(d_temp4) d5 = temporary(d_temp5) d6 = temporary(d_temp6) d7 = temporary(d_temp7) d8 = temporary(d_temp8) end endcase case m-1 of ;0: d1=d1, d2=d2, d3=d3, d4=d4, d5=d5 1: begin d2=d1 d3=d2 d4=d3 d5=d4 d6=d5 end 2: begin d3=d1 d4=d2 d5=d3 d6=d4 d7=d5 end 3: begin d4=d1 d5=d2 d6=d3 d7=d4 d8=d5 end 4: begin d5=d1 d6=d2 d7=d3 d8=d4 d9=d5 end 5: begin d6=d1 d7=d2 d8=d3 d9=d4 d10=d5 end 6: begin d7=d1 d8=d2 d9=d3 d10=d4 d11=d5 end 7: begin d8=d1 d9=d2 d10=d3 d11=d4 d12=d5 end 8: begin d9=d1 d10=d2 d11=d3 d12=d4 d13=d5 end 9: begin d10=d1 d11=d2 d12=d3 d13=d4 d14=d5 end 10: begin d11=d1 d12=d2 d13=d3 d14=d4 d15=d5 end 11: begin d12=d1 d13=d2 d14=d3 d15=d4 d16=d5 end 12: begin d13=d1 d14=d2 d15=d3 d16=d4 d17=d5 end 13: begin d14=d1 d15=d2 d16=d3 d17=d4 d18=d5 end 14: begin d15=d1 d16=d2 d17=d3 d18=d4 d19=d5 end 15: begin d16=d1 d17=d2 d18=d3 d19=d4 d20=d5 end 16: begin d17=d1 d18=d2 d19=d3 d20=d4 d21=d5 end endcase case (nbcol-6) of 9 : begin d9 = temporary(d_temp9) end 10 : begin d9 = temporary(d_temp9) d10 = temporary(d_temp10) end 11 : begin d9 = temporary(d_temp9) d10 = temporary(d_temp10) d11 = temporary(d_temp11) end 12 : begin d9 = temporary(d_temp9) d10 = temporary(d_temp10) d11 = temporary(d_temp11) d12 = temporary(d_temp12) end 13 : begin d9 = temporary(d_temp9) d10 = temporary(d_temp10) d11 = temporary(d_temp11) d12 = temporary(d_temp12) d13 = temporary(d_temp13) end 14 : begin d9 = temporary(d_temp9) d10 = temporary(d_temp10) d11 = temporary(d_temp11) d12 = temporary(d_temp12) d13 = temporary(d_temp13) d14 = temporary(d_temp14) end 15 : begin d9 = temporary(d_temp9) d10 = temporary(d_temp10) d11 = temporary(d_temp11) d12 = temporary(d_temp12) d13 = temporary(d_temp13) d14 = temporary(d_temp14) d15 = temporary(d_temp15) end 16 : begin d9 = temporary(d_temp9) d10 = temporary(d_temp10) d11 = temporary(d_temp11) d12 = temporary(d_temp12) d13 = temporary(d_temp13) d14 = temporary(d_temp14) d15 = temporary(d_temp15) d16 = temporary(d_temp16) end else : endcase endif if spec_scan eq KEYW_OBS then begin case (nbcol-6) of 0: begin del_time= d2 exptime= d3 solar_x=d4 solar_y=d5 end 1: begin del_time= d3 exptime= d4 solar_x=d5 solar_y=d6 end 2: begin del_time= d4 exptime= d5 solar_x=d6 solar_y=d7 end 3: begin del_time= d5 exptime= d6 solar_x=d7 solar_y=d8 end 4: begin del_time= d6 exptime= d7 solar_x=d8 solar_y=d9 end 5: begin del_time= d7 exptime= d8 solar_x=d9 solar_y=d10 end 6: begin del_time= d8 exptime= d9 solar_x=d10 solar_y=d11 end 7: begin del_time= d9 exptime= d10 solar_x=d11 solar_y=d12 end 8: begin del_time= d10 exptime= d11 solar_x=d12 solar_y=d13 end 9: begin del_time= d11 exptime= d12 solar_x=d13 solar_y=d14 end 10: begin del_time= d12 exptime= d13 solar_x=d14 solar_y=d15 end 11: begin del_time= d13 exptime= d14 solar_x=d15 solar_y=d16 end 12: begin del_time= d14 exptime= d15 solar_x=d16 solar_y=d17 end 13: begin del_time= d15 exptime= d16 solar_x=d17 solar_y=d18 end 14: begin del_time= d16 exptime= d17 solar_x=d18 solar_y=d19 end 15: begin del_time= d17 exptime= d18 solar_x=d19 solar_y=d20 end 16: begin del_time= d18 exptime= d19 solar_x=d20 solar_y=d21 end endcase endif n_lam=fltarr(nbcol-5) ;fills the gaps ;-------------- black_white_corr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,nbcol if fffile ne '' and ffonoff eq 0 then begin ;makes the flatfield correction ;------------------------------ ffieldcorr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,nbcol,slit,ref_pix,FFfile endif ;corrects the deadtime ;--------------------- if ans_dead eq 'Yes' or ans_dead eq 'yes' or ans_dead eq 'Y' $ or ans_dead eq 'y' then $ dead_time_corr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,detector,nbcol,expos ;corrects the pixel linearity ;---------------------------- pixlincorr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,nbcol,detector,expos ;Determine the wavelength ;------------------------ for ww=0,nbcol-6 do begin ww1=strcompress(string(ww+1),/remove_all) ext_name = FXPAR(h1,'TTYPE'+ww1) leng = STRLEN(ext_name) pos = STRPOS(ext_name,'W_') if pos ne -1 then n_lam(ww) = float(STRMID(ext_name,pos+2,leng-pos)) if pos eq -1 then begin ext_name = FXPAR(h1,'TWAVE'+ww1) leng = STRLEN(ext_name) n_lam(ww)= float(STRMID(ext_name,1,leng-pos)) endif print,'Wavelength '+ww1+' :',n_lam(ww) case ww of 0: w0=n_lam(0) 1: w1=n_lam(1) 2: w2=n_lam(2) 3: w3=n_lam(3) 4: w4=n_lam(4) 5: w5=n_lam(5) 6: w6=n_lam(6) 7: w7=n_lam(7) 8: w8=n_lam(8) 9: w9=n_lam(9) 10: w10=n_lam(10) 11: w11=n_lam(11) 12: w12=n_lam(12) 13: w13=n_lam(13) 14: w14=n_lam(14) 15: w15=n_lam(15) 16: w16=n_lam(16) endcase endfor ;destretch the lines ;-------------------- destrcorr,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,$ nbcol,detector,ref_pix,slit,repenv ;calibration ;----------- if ans_calib eq 'Y' or ans_calib eq 'y' or ans_calib eq 'Yes' $ or ans_calib eq 'yes' then begin $ print,' -------------------------------------------------------' print,' WARNING !!' print,' This up-dated version is able to determine' print,' to position of the lines on the Attenuator' print,' or on the MCP bare part, or on the KBr part,' print,' directly from the header parameters.' print,' -------------------------------------------------------' calibration,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,$ d13,d14,d15,d16,$ w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12,$ w13,w14,w15,w16,$ detector,slit,order,expos,nbcol,ref_pix,att endif else begin print,'No calibration' endelse ;------------------------------------------------------------------------------- case nbcol of 6: all_d=[d0] 7: all_d=[d0,d1] 8: all_d=[d0,d1,d2] 9: all_d=[d0,d1,d2,d3] 10: all_d=[d0,d1,d2,d3,d4] 11: all_d=[d0,d1,d2,d3,d4,d5] 12: all_d=[d0,d1,d2,d3,d4,d5,d6] 13: all_d=[d0,d1,d2,d3,d4,d5,d6,d7] 14: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8] 15: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8,d9] 16: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10] 17: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11] 18: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12] 19: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13] 20: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14] 21: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15] 22: all_d=[d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16] endcase ;help,all_d case nbcol of 6: all_exp=[d2,d3,d4,d5] 7: all_exp=[d3,d4,d5,d6] 8: all_exp=[d4,d5,d6,d7] 9: all_exp=[d5,d6,d7,d8] 10: all_exp=[d6,d7,d8,d9] 11: all_exp=[d7,d8,d9,d10] 12: all_exp=[d8,d9,d10,d11] 13: all_exp=[d9,d10,d11,d12] 14: all_exp=[d10,d11,d12,d13] 15: all_exp=[d11,d12,d13,d14] 16: all_exp=[d12,d13,d14,d15] 17: all_exp=[d13,d14,d15,d16] 18: all_exp=[d14,d15,d16,d17] 19: all_exp=[d15,d16,d17,d18] 20: all_exp=[d16,d17,d18,d19] 21: all_exp=[d17,d18,d19,d20] 22: all_exp=[d18,d19,d20,d21] endcase ;------------------------------------------------------------------------------- ;the array all_d contains the data d0 to d17 and ;the array all_all contains the data d0 to d17 from all the BTEs ;------------------------------------------------------------------------------- ;for data size_all_d=size(all_d) if size_all_alld(1) ne 0 then begin intermed=temporary(all_alld) all_alld=fltarr(size_all_d(1),size_all_d(2),size_all_alld(3)+size_all_d(3)) all_alld(*,*,0:size_all_alld(3)-1)=intermed(*,*,0:size_all_alld(3)-1) all_alld(*,*,size_all_alld(3):size_all_alld(3)+size_all_d(3)-1)=all_d(*,*,0:size_all_d(3)-1) endif if size_all_alld(1) eq 0 then all_alld=temporary(all_d) size_all_alld=size(all_alld) ;plot_image,all_alld(*,*,0) ;help,all_alld ;for instrumental parameters size_all_exp=size(all_exp) if size_all_allexp(1) ne 0 then begin intermed_exp=temporary(all_allexp) all_allexp=fltarr(size_all_exp(1),size_all_allexp(2)+size_all_exp(2)) all_allexp(*,0:size_all_allexp(2)-1)=intermed_exp(*,0:size_all_allexp(2)-1) all_allexp(*,size_all_allexp(2):size_all_allexp(2)+size_all_exp(2)-1)=all_exp(*,0:size_all_exp(2)-1) endif if size_all_allexp(1) eq 0 then all_allexp=temporary(all_exp) size_all_allexp=size(all_allexp) ;help,all_allexp ibte=ibte+1 endrep until ibte gt nbte intermed=intarr(1) intermed_exp=intarr(1) ;_________________________________________________________________________________ ;all the arrays are saved in a file as e.g 971101.sav ;---------------------------------------------------- print,repsav size_d0=size(d0) case size_all_alld(0) of 3: begin all_di=fltarr(size_d0(1),size_d0(2),size_all_alld(3),nbcol-5) for icol=0,nbcol-6 do begin all_di(0:size_d0(1)-1,0:size_d0(2)-1,0:size_all_alld(3)-1,icol)=$ float(all_alld(icol*size_d0(1):icol*size_d0(1)+size_d0(1)-1,0:size_d0(2)-1,0:size_all_alld(3)-1)) case icol of 0: w_1=temporary(all_di(*,*,*,0)) 1: w_2=temporary(all_di(*,*,*,1)) 2: w_3=temporary(all_di(*,*,*,2)) 3: w_4=temporary(all_di(*,*,*,3)) 4: w_5=temporary(all_di(*,*,*,4)) 5: w_6=temporary(all_di(*,*,*,5)) 6: w_7=temporary(all_di(*,*,*,6)) 7: w_8=temporary(all_di(*,*,*,7)) 8: w_9=temporary(all_di(*,*,*,8)) 9: w_10=temporary(all_di(*,*,*,9)) 10: w_11=temporary(all_di(*,*,*,10)) 11: w_12=temporary(all_di(*,*,*,11)) 12: w_13=temporary(all_di(*,*,*,12)) 13: w_14=temporary(all_di(*,*,*,13)) 14: w_15=temporary(all_di(*,*,*,14)) 15: w_16=temporary(all_di(*,*,*,15)) 16: w_17=temporary(all_di(*,*,*,16)) endcase endfor end 2: begin all_di=fltarr(size_d0(1),size_d0(2),nbcol-5) for icol=0,nbcol-6 do begin all_di(0:size_d0(1)-1,0:size_d0(2)-1,icol)=$ float(all_alld(icol*size_d0(1):icol*size_d0(1)+size_d0(1)-1,0:size_d0(2)-1)) case icol of 0: w_1=temporary(all_di(*,*,0)) 1: w_2=temporary(all_di(*,*,1)) 2: w_3=temporary(all_di(*,*,2)) 3: w_4=temporary(all_di(*,*,3)) 4: w_5=temporary(all_di(*,*,4)) 5: w_6=temporary(all_di(*,*,5)) 6: w_7=temporary(all_di(*,*,6)) 7: w_8=temporary(all_di(*,*,7)) 8: w_9=temporary(all_di(*,*,8)) 9: w_10=temporary(all_di(*,*,9)) 10: w_11=temporary(all_di(*,*,10)) 11: w_12=temporary(all_di(*,*,11)) 12: w_13=temporary(all_di(*,*,12)) 13: w_14=temporary(all_di(*,*,13)) 14: w_15=temporary(all_di(*,*,14)) 15: w_16=temporary(all_di(*,*,15)) 16: w_17=temporary(all_di(*,*,16)) endcase endfor end endcase if spec_scan ne KEYW_OBS then begin del_time=temporary(rotate(all_allexp(0,*),4)) exptime=temporary(rotate(all_allexp(nbcol-5,*),4)) solar_x=temporary(rotate(all_allexp(2*(nbcol-5),*),4)) solar_y=temporary(rotate(all_allexp(3*(nbcol-5),*),4)) endif ; Inversion between North and South along the Y-direction print,'' print,'' print,'********************************************' print,'* North and South will be now exchanged *' print,'* to fit with the real position on the Sun *' print,'********************************************' print,'' print,'' for icol=0,nbcol-6 do begin case icol of 0: begin w_interp1=w_1 for li=0,size_d0(2)-1 do w_interp1(*,size_d0(2)-1-li,*)=w_1(*,li,*) end 1: begin w_interp2=w_2 for li=0,size_d0(2)-1 do w_interp2(*,size_d0(2)-1-li,*)=w_2(*,li,*) end 2: begin w_interp3=w_3 for li=0,size_d0(2)-1 do w_interp3(*,size_d0(2)-1-li,*)=w_3(*,li,*) end 3: begin w_interp4=w_4 for li=0,size_d0(2)-1 do w_interp4(*,size_d0(2)-1-li,*)=w_4(*,li,*) end 4: begin w_interp5=w_5 for li=0,size_d0(2)-1 do w_interp5(*,size_d0(2)-1-li,*)=w_5(*,li,*) end 5: begin w_interp6=w_6 for li=0,size_d0(2)-1 do w_interp6(*,size_d0(2)-1-li,*)=w_6(*,li,*) end 6: begin w_interp7=w_7 for li=0,size_d0(2)-1 do w_interp7(*,size_d0(2)-1-li,*)=w_7(*,li,*) end 7: begin w_interp8=w_8 for li=0,size_d0(2)-1 do w_interp8(*,size_d0(2)-1-li,*)=w_8(*,li,*) end 8: begin w_interp9=w_9 for li=0,size_d0(2)-1 do w_interp9(*,size_d0(2)-1-li,*)=w_9(*,li,*) end 9: begin w_interp10=w_10 for li=0,size_d0(2)-1 do w_interp10(*,size_d0(2)-1-li,*)=w_10(*,li,*) end 10: begin w_interp11=w_11 for li=0,size_d0(2)-1 do w_interp11(*,size_d0(2)-1-li,*)=w_11(*,li,*) end 11: begin w_interp12=w_12 for li=0,size_d0(2)-1 do w_interp12(*,size_d0(2)-1-li,*)=w_12(*,li,*) end 12: begin w_interp13=w_13 for li=0,size_d0(2)-1 do w_interp13(*,size_d0(2)-1-li,*)=w_13(*,li,*) end 13: begin w_interp14=w_14 for li=0,size_d0(2)-1 do w_interp14(*,size_d0(2)-1-li,*)=w_14(*,li,*) end 14: begin w_interp15=w_15 for li=0,size_d0(2)-1 do w_interp15(*,size_d0(2)-1-li,*)=w_15(*,li,*) end 15: begin w_interp16=w_16 for li=0,size_d0(2)-1 do w_interp16(*,size_d0(2)-1-li,*)=w_16(*,li,*) end 16: begin w_interp17=w_17 for li=0,size_d0(2)-1 do w_interp17(*,size_d0(2)-1-li,*)=w_17(*,li,*) end endcase case icol of 0: w_1=temporary(w_interp1) 1: w_2=temporary(w_interp2) 2: w_3=temporary(w_interp3) 3: w_4=temporary(w_interp4) 4: w_5=temporary(w_interp5) 5: w_6=temporary(w_interp6) 6: w_7=temporary(w_interp7) 7: w_8=temporary(w_interp8) 8: w_9=temporary(w_interp9) 9: w_10=temporary(w_interp10) 10: w_11=temporary(w_interp11) 11: w_12=temporary(w_interp12) 12: w_13=temporary(w_interp13) 13: w_14=temporary(w_interp14) 14: w_15=temporary(w_interp15) 15: w_16=temporary(w_interp16) 16: w_17=temporary(w_interp17) endcase endfor wait,3 case nbcol of 6: save,h0,h1,w_1,del_time,exptime,solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 7: save,h0,h1,w_1,w_2,del_time,exptime,solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 8: save,h0,h1,w_1,w_2,w_3,del_time,exptime,solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 9: save,h0,h1,w_1,w_2,w_3,w_4,del_time,exptime,solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 10: save,h0,h1,w_1,w_2,w_3,w_4,w_5,del_time,exptime,solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 11: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 12: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 13: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 14: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 15: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,w_10,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 16: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 17: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 18: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 19: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,w_14,del_time,exptime,$ solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 20: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,w_14,w_15,$ del_time,exptime,solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 21: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,w_14,w_15,w_16,$ del_time,exptime,solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr 22: save,h0,h1,w_1,w_2,w_3,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,w_14,w_15,w_16,w_17,$ del_time,exptime,solar_x,solar_y,$ ref_pix,n_lam,$ filename=repsav+'.sav',/xdr endcase endrep until eof(11) ;plot_image,w_1(*,*,0) endif end