; ; Cette routine permet de lire dans le fichier leader la pente et l'intercept des ; differents parametres. Fonctionne pour niveau 2 et 3. ; ; Avec l'option /VERIF, elle compare les valeurs trouvĀŽes dans le leader file avec celles des "define" d'Anapol ; PRO get_slope_inter,VERIF=verif FORWARD_FUNCTION define_product filein=dialog_pickfile(/READ,FILTER='*L') pos2 = STRPOS(filein,'L2T') pos3 = STRPOS(filein,'L3T') IF pos2 GT 0 AND pos3 GT 0 THEN STOP, ' Cas ambigu' IF pos2 LE 0 AND pos3 LE 0 THEN STOP, $ ' Ce fichier n est pas reconnu comme un produit standard de niveau 2 ou 3' IF pos2 GT 0 THEN length0 = 180+360+1620+180+720l ELSE length0=180+360+720l close,1 openr,1,filein point_lun,1,length0+32 Npar = 'r' & Nbytes=' r' readf,1,Npar,Nbytes,format='(A4,A8)' print,Npar,Nbytes,format='(I3," parameters",/,I3," Bytes",/,/,"pos # size Slope (Inter)")' pos = 14 tabslope = FLTARR(Nbytes) tabinter = FLTARR(Nbytes) FOR i=1,FIX(Npar) DO BEGIN point_lun,1,length0 +44 + 26*(i-1) readf,1,nn,slope,inter,format='(I2.2,2E12.5)' IF slope GE 0.01 AND inter EQ 0. THEN print,pos,i,nn,slope ,format='(i3,2x,i2,I3,2x,F7.2)' IF slope LT 0.01 AND inter EQ 0. THEN print,pos,i,nn,slope ,format='(i3,2x,i2,I3,2x,E7.1)' IF slope GE 0.01 AND inter NE 0. THEN print,pos,i,nn,slope,inter,format='(i3,2x,i2,I3,2x,F7.2," (",F5.2,")")' IF slope LT 0.01 AND inter NE 0. THEN print,pos,i,nn,slope,inter,format='(i3,2x,i2,I3,2x,E7.1," (",F5.2,")")' ; print,pos,i,nn,slope,inter,format='(i3,2x,i2,I3,2x,F8.5,2x,F8.5)' tabslope[pos-1] = slope tabinter[pos-1] = inter pos = pos+nn ENDFOR IF KEYWORD_SET(verif) THEN BEGIN point_lun,1,36 type ='P1' READF,1,type,format='(A16)' print,type & stop parasol = STRMID(type,0,2) EQ 'P3' prod = define_product(type,Nbytes,ERROR=err,PARASOL=parasol) IF err NE 0 THEN STOP,' Erreur a l ouverture du fichier' FOR ipar=0, prod.Nu_par-1 DO BEGIN par = (prod.U_par)[ipar] pos = par.FI_BY IF pos LE 12 THEN GOTO, nextpar IF par.unit EQ '%' THEN BEGIN par.slope = par.slope*0.01 par.offset = par.offset*0.01 ENDIF IF ABS(par.slope-tabslope[pos]) GT 1.E-6 THEN print,'*** SLOPE *** ',par.name,par.slope,tabslope[pos] IF ABS(par.offset-tabinter[pos]) GT 1.E-6 THEN print,'*** INTER *** ',par.name,par.offset,tabinter[pos] nextpar: ENDFOR FOR ipar=0, prod.Nd_par-1 DO BEGIN par = (prod.D_par)[ipar] pos = par.FI_BY + prod.NBYTE_ND IF par.unit EQ '%' THEN BEGIN par.slope = par.slope*0.01 par.offset = par.offset*0.01 ENDIF IF ABS(par.slope-tabslope[pos]) GT 1.E-6 THEN print,'*** SLOPE *** ',par.name,par.slope,tabslope[pos] IF ABS(par.offset-tabinter[pos]) GT 1.E-6 THEN print,'*** INTER *** ',par.name,par.offset,tabinter[pos] ENDFOR ENDIF free_lun,1 END