[637] | 1 | #include "diabolo.h"
|
---|
| 2 | #include "bolo.h"
|
---|
[651] | 3 | #include "arcunit.h"
|
---|
[637] | 4 |
|
---|
| 5 | //********* coefficients pour les mesures bolo ***************************************************
|
---|
| 6 | // //
|
---|
| 7 | // -1- loi de reponse thermique des bolos avec R en ohms et T en Kelvin coef 0,1,2 //
|
---|
| 8 | // //
|
---|
| 9 | // T = coef2 * ( ln ( R / coef1) ** ( -1 / coef0 ) //
|
---|
| 10 | // //
|
---|
| 11 | // -2- fuite thermique du bolo coef 3,4 //
|
---|
| 12 | // //
|
---|
| 13 | // Ptot = coef3 * ( Tb ** coef4 - Tcryo ** coef4 ) //
|
---|
| 14 | // //
|
---|
| 15 | // -3- calcul empirique de Pciel et de tau coef 5,6 //
|
---|
| 16 | // //
|
---|
| 17 | // Pciel = V * I - coef5 coef5= I * Ai (tables xavier) //
|
---|
| 18 | // tau = - ln ( 1 + Pciel / coef6 ) coef6= I * Bi (tables xavier) //
|
---|
| 19 | // //
|
---|
| 20 | //******************************************************************************************************//
|
---|
| 21 |
|
---|
[643] | 22 | #define c(i) (1e-4*(double)parametr.nom_coef[parametr.bolo[fen-1].numero_nom_coef].coef[i])
|
---|
[637] | 23 |
|
---|
| 24 |
|
---|
| 25 | void mesures_bolo(int fen,int carr,int tri,int flag)
|
---|
| 26 | {
|
---|
| 27 | double I,V,R,T,Pelec,Tcryo,Ptot,Pciel,tau;
|
---|
| 28 | double a;
|
---|
| 29 | def_gains;
|
---|
| 30 |
|
---|
| 31 | if(parametr.bolo[fen-1].bolo_diviseur) // BEBO normale ou MLPA
|
---|
| 32 | {
|
---|
| 33 | I = (double)tri / pt_micA(fen); // I en µA
|
---|
| 34 | V= (double) carr / pt_micV(fen); // V en µVolts
|
---|
| 35 | if(I>0.0000001) R=V/I; else R=0; // R en
|
---|
| 36 | if(R>=1e6) ecritD(fen,b_res,"%7.3fM %6.3fnA %7.3fmV",R*1e-6,I*1e3,V*1e-3);// R en M I en nA et V en mV
|
---|
| 37 | else ecritD(fen,b_res,"%6.2fK %6.3fnA %7.3fmV",R*1e-3,I*1e3,V*1e-3);// R en K I en nA et V en mV
|
---|
| 38 | V=V-xbolbrut(fen-1); // corrigée du déséquilibre en µV
|
---|
| 39 | }
|
---|
| 40 | else // pour carte BEBO modifiée (mesure temperature)
|
---|
| 41 | {
|
---|
| 42 | I = 1e-3 * (double)carr * 2441. / parametr.bolo[fen-1].bolo_capa; // I en µA
|
---|
| 43 | V=xbolbrut(fen-1); // V en µVolts
|
---|
| 44 | if(I>0.0000001) R=V/I; else R=0; // R en
|
---|
| 45 | if(R>=1e3) ecritD(fen,b_res,"%7.3fK %6.3fnA %7.3fmV",R*1e-3,I*1e3,V*1e-3);// R en K I en nA et V en mV
|
---|
| 46 | else ecritD(fen,b_res,"%6.2f %6.3fnA %7.3fmV",R,I*1e3,V*1e-3); // R en I en nA et V en mV
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | if(!flag) return;
|
---|
| 51 |
|
---|
| 52 | if(!fenetre(fenetre_mesures_bolo)) nouveauT(fenetre_mesures_bolo,mesures_bolo_id,"mesures bolos");
|
---|
| 53 |
|
---|
| 54 | //**************** tension corrigée du déséquilibre *******************
|
---|
| 55 |
|
---|
| 56 | if(I<0.000001) return;
|
---|
| 57 | if(V<-1000000) return;
|
---|
| 58 | if(V>1000000) return;
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 | Pelec=V*I; // pW
|
---|
| 62 |
|
---|
| 63 | // -1- loi de reponse thermique des bolos avec R en ohms et T en Kelvin coef 0,1,2 //
|
---|
| 64 | // //
|
---|
| 65 | // T = coef2 * ( ln ( R / coef1) ** ( -1 / coef0 ) //
|
---|
| 66 |
|
---|
| 67 | a=1; if( (R>0) && (c(1) >0.01) ) a= log ( R / c(1) );
|
---|
| 68 | T=0; if( (a>0) && (c(0)>0.01) ) T= c(2) * pow( a , -1 / c(0) );
|
---|
| 69 |
|
---|
| 70 | // -2- fuite thermique du bolo coef 3,4 //
|
---|
| 71 | // //
|
---|
| 72 | // Ptot = coef3 * ( (10*Tb) ** coef4 - (10*Tcryo) ** coef4 ) //
|
---|
[649] | 73 | /* Desormais 30/06/1999, Tcryo est calculee avec la germanium */
|
---|
| 74 | //Tcryo=0.1;
|
---|
| 75 | Tcryo= gg->temperature_cryo ;
|
---|
[637] | 76 | Ptot=0; if( (c(4)>0.01) && (T>0.01) ) Ptot = c(3) * ( pow(10.*T,c(4)) - pow(10.*Tcryo,c(4)) );
|
---|
| 77 |
|
---|
| 78 | // -3- calcul empirique de Pciel et de tau coef 5,6 //
|
---|
| 79 | // //
|
---|
| 80 | // Pciel = coef5 - V * I coef5= I * Ai (tables xavier) //
|
---|
| 81 | // tau = - ln ( 1 + Pciel / coef6 ) coef6= I * Bi (tables xavier) //
|
---|
| 82 |
|
---|
[649] | 83 | //Pciel = 0; if( c(5)>Pelec) Pciel = c(5) - Pelec;
|
---|
| 84 | Pciel = 0; if( Ptot>Pelec) Pciel = Ptot - Pelec; /* Pour avoir la puissance de rayonnement absorbé */
|
---|
| 85 | //a=1; if( c(6) >0.1 ) a = 1 - Pciel / c(6) ;
|
---|
| 86 | //tau=0; if( a>0 ) tau = - log ( a );
|
---|
| 87 | tau=Tcryo ; /* FXD pour avoir Tcryo 16/07/99 */
|
---|
[637] | 88 |
|
---|
| 89 |
|
---|
[643] | 90 | ecritT(fenetre_mesures_bolo,fin_f,"%d %s :",fen,parametr.nom_coef[parametr.bolo[fen-1].numero_nom_coef].bolo_nom);
|
---|
[637] | 91 |
|
---|
| 92 | //ecritT(fenetre_mesures_bolo,fin_f,"%s (b%d) :"/* bebo=%d num=%d gain_pa=%d coef0=%g coef1=%g coef2=%g */,
|
---|
| 93 | // parametr.bolo_nom[fen-1],fen,parametr.bolo[fen-1].bolo_bebo,parametr.bolo[fen-1].bolo_num,parametr.bolo_gain[fen-1]
|
---|
| 94 | // ,parametr.coef[fen-1][0],parametr.coef[fen-1][1],parametr.coef[fen-1][2]);
|
---|
| 95 |
|
---|
| 96 |
|
---|
[649] | 97 | ecritT(fenetre_mesures_bolo,fin_f," R=%7.3fM I=%6.3fnA V=%7.3fmV Pelec=%6.2fpW",R*1e-6,I*1e3,V*1e-3,Pelec);
|
---|
[637] | 98 |
|
---|
| 99 | if(T>0.01) ecritT(fenetre_mesures_bolo,fin_f," T=%6.1fmK ", T*1e3);
|
---|
| 100 |
|
---|
[649] | 101 | if( Ptot>0.01) ecritT(fenetre_mesures_bolo,fin_f," Ptot=%6.2fpW Pciel=%6.2fpW Tcryo=%6.1f ",Ptot,Pciel,tau*1e3);
|
---|
[637] | 102 |
|
---|
| 103 |
|
---|
| 104 | //ecritT(fenetre_mesures_bolo,fin_f,": C=%g ptmic=%g\n",capa(fen),pt_micA(fen));
|
---|
| 105 |
|
---|
| 106 | ecritT(fenetre_mesures_bolo,fin_f,"\n");
|
---|
| 107 | } |
---|