Changeset 534 in Sophya for trunk/Poubelle
- Timestamp:
- Nov 1, 1999, 10:59:29 AM (26 years ago)
- Location:
- trunk/Poubelle/archTOI.old
- Files:
-
- 50 added
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Poubelle/archTOI.old/archeopsfile.cc
r442 r534 5 5 #define utilitaires_de_block_archeops 6 6 #include "archeopsfile.h" 7 #include "gyrohandler.h"8 7 9 8 extern "C" { … … 43 42 block_type_modele curBlock; 44 43 block_type_modele peekBlock; 45 46 SSTHandler sstHandler;47 GyroHandler gyroHandler;48 GPSParser gpsParser;49 44 }; 50 45 … … 89 84 90 85 BlockSet::BlockSet(BlockSet const& x) 91 : sstHandler(x.sstHandler), gyroHandler(x.gyroHandler)92 86 { 93 87 lastParam = NULL; … … 255 249 } 256 250 } 251 252 #ifdef __MWERKS__ 253 #pragma mark - 254 #endif 255 #ifdef __MWERKS__ 256 #pragma mark - 257 #endif 258 257 259 258 260 ArcheopsFile::ArcheopsFile(string const& fname) { … … 404 406 } 405 407 406 #define bitmot 24 // nb de bit horloge dans un mot ADC407 408 double ArcheopsFile::perEchant() { // periode d'echantillonage pour le dernier bloc reglage409 double p,f1,f2,f3;410 int pp;411 if (!lastReglage()) return -1;412 pp=lastReglage()->reglage.horloge.periode;413 p=pp/5.;414 f1=1000/p;f2=f1/bitmot;f3=f2*1000./(double)(lastReglage()->reglage.horloge.nb_mesures);415 return 0.5/f3; // 2 fois la frequence de modulation416 }417 418 double ArcheopsFile::perBlock() { // duree (en secondes) correspondant a un bloc bolo419 return perEchant() * (double)lastParam()->param.n_per_block*2.;420 }421 422 int ArcheopsFile::nEchBlock() { // Nb d'echantillons dans un bloc423 return lastParam()->param.n_per_block*2;424 }425 408 426 409 string ArcheopsFile::blockKdName() { … … 448 431 } 449 432 450 451 block_type_param* ArcheopsFile::lastParam() {452 return blockSet->lastParam;453 }454 block_type_journal* ArcheopsFile::lastJournal() {455 return blockSet->lastJournal;456 }457 block_type_reglage* ArcheopsFile::lastReglage() {458 return blockSet->lastReglage;459 }460 block_type_dilution* ArcheopsFile::lastDilution() {461 return blockSet->lastDilution;462 }463 block_type_gps* ArcheopsFile::lastGPS() {464 return blockSet->lastGPS;465 }466 block_type_une_periode* ArcheopsFile::lastUnePeriode() {467 return blockSet->lastUnePeriode;468 }469 block_type_synchro_sol* ArcheopsFile::lastSynchroSol() {470 return blockSet->lastSynchroSol;471 }472 block_type_pointage_sol* ArcheopsFile::lastPointageSol() {473 return blockSet->lastPointageSol;474 }475 block_type_bolo* ArcheopsFile::lastBolo() {476 return blockSet->lastBolo;477 }478 block_type_bolo* ArcheopsFile::llastBolo() {479 return blockSet->llastBolo;480 }481 block_type_gyro* ArcheopsFile::lastGyro() {482 return blockSet->lastGyro;483 }484 block_type_sst* ArcheopsFile::lastSST() {485 return blockSet->lastSST;486 }487 block_type_bolo_comprime* ArcheopsFile::lastBoloComp() {488 return blockSet->lastBoloComp;489 }490 block_type_gyro_comprime* ArcheopsFile::lastGyroComp() {491 return blockSet->lastGyroComp;492 }493 block_type_sst_comprime* ArcheopsFile::lastSSTComp() {494 return blockSet->lastSSTComp;495 }496 497 433 void ArcheopsFile::forceBlock(block_type_modele* blk) { 498 434 blockSet->setBloc(*blk); 435 } 436 437 long ArcheopsFile::searchNextBlock(long pos) { 438 static char* buffer = 0; 439 static int4 debswp = debut_block_mesure; 440 static int4 longmax = taille_maxi_block_archeops*20; 441 if (!buffer) { 442 buffer = new char[longmax]; 443 #ifdef SWAP 444 bswap4(&debswp); 445 #endif 446 } 447 long read = longmax; 448 while (read == longmax) { 449 fseek(f,pos,SEEK_SET); 450 read = fread(buffer,1,longmax,f); 451 //if (read<taille_maxi_block_archeops*2) return -1; 452 // EA 150999 changed i+=4 to i++ -> unaligned, but can lose bytes in flight recorder 453 #ifndef __DECCXX 454 #define __unaligned 455 #endif 456 for (long i=4; i<read; i++) { 457 if (*(__unaligned int4*)(buffer+i) == debswp) { 458 cout << "trying to skip " << i << " bytes to pos="<<pos+i << endl; 459 return pos+i; 460 } 461 } 462 pos += read; 463 } 464 cout << "cannot find block start" << endl; 465 return -1; 499 466 } 500 467 … … 531 498 memcpy(&blockSet->curBlock,&blk2,sizeof(blk2)); 532 499 curKind = block_bolo; 500 postProcessBlock(); 533 501 break; 534 502 } 535 503 case block_sst_comprime: { 536 504 blockSet->setRawBloc(blockSet->curBlock); 537 if (!blockSet->sstHandler.NeedBlocks()) break; // inutile de decompresser538 505 block_type_sst blk2; 539 506 block_type_sst_comprime* blk = (block_type_sst_comprime*) &blockSet->curBlock; … … 566 533 memcpy(&blockSet->curBlock,&blk2,sizeof(blk2)); 567 534 curKind = block_sst; 568 // cout << "process " << numero_block(&blockSet->curBlock) << "\n"; 569 blockSet->sstHandler.ProcessBlock((block_type_sst*)&blockSet->curBlock); 535 postProcessBlock(); 570 536 break; 571 537 } 572 case block_sst : { 573 // cout << "process " << numero_block(&blockSet->curBlock) << "\n"; 574 blockSet->sstHandler.ProcessBlock((block_type_sst*)&blockSet->curBlock); 575 } 576 case block_gyro : { 577 blockSet->gyroHandler.ProcessBlock((block_type_gyro*)&blockSet->curBlock); 578 } 579 case block_gps : { 580 blockSet->gpsParser.ProcessBlock((block_type_gps*)&blockSet->curBlock); 581 } 582 } 583 } 538 // Delegation a tous les producers qui traitent des blocs bruts 539 } 540 } 541 542 543 544 #ifdef __MWERKS__ 545 #pragma mark - 546 #endif 547 548 block_type_param* ArcheopsFile::lastParam() { 549 return blockSet->lastParam; 550 } 551 block_type_journal* ArcheopsFile::lastJournal() { 552 return blockSet->lastJournal; 553 } 554 block_type_reglage* ArcheopsFile::lastReglage() { 555 return blockSet->lastReglage; 556 } 557 block_type_dilution* ArcheopsFile::lastDilution() { 558 return blockSet->lastDilution; 559 } 560 block_type_gps* ArcheopsFile::lastGPS() { 561 return blockSet->lastGPS; 562 } 563 block_type_une_periode* ArcheopsFile::lastUnePeriode() { 564 return blockSet->lastUnePeriode; 565 } 566 block_type_synchro_sol* ArcheopsFile::lastSynchroSol() { 567 return blockSet->lastSynchroSol; 568 } 569 block_type_pointage_sol* ArcheopsFile::lastPointageSol() { 570 return blockSet->lastPointageSol; 571 } 572 block_type_bolo* ArcheopsFile::lastBolo() { 573 return blockSet->lastBolo; 574 } 575 block_type_bolo* ArcheopsFile::llastBolo() { 576 return blockSet->llastBolo; 577 } 578 block_type_gyro* ArcheopsFile::lastGyro() { 579 return blockSet->lastGyro; 580 } 581 block_type_sst* ArcheopsFile::lastSST() { 582 return blockSet->lastSST; 583 } 584 block_type_bolo_comprime* ArcheopsFile::lastBoloComp() { 585 return blockSet->lastBoloComp; 586 } 587 block_type_gyro_comprime* ArcheopsFile::lastGyroComp() { 588 return blockSet->lastGyroComp; 589 } 590 block_type_sst_comprime* ArcheopsFile::lastSSTComp() { 591 return blockSet->lastSSTComp; 592 } 593 594 #ifdef __MWERKS__ 595 #pragma mark - 596 #endif 597 598 584 599 585 600 void ArcheopsFile::saveCurBlock() { … … 680 695 #endif 681 696 682 long ArcheopsFile::searchNextBlock(long pos) { 683 static char* buffer = 0; 684 static int4 debswp = debut_block_mesure; 685 static int4 longmax = taille_maxi_block_archeops*20; 686 if (!buffer) { 687 buffer = new char[longmax]; 688 #ifdef SWAP 689 bswap4(&debswp); 690 #endif 691 } 692 size_t read = longmax; 693 while (read == longmax) { 694 fseek(f,pos,SEEK_SET); 695 read = fread(buffer,1,longmax,f); 696 //if (read<taille_maxi_block_archeops*2) return -1; 697 // EA 150999 changed i+=4 to i++ -> unaligned, but can lose bytes in flight recorder 698 #ifndef __DECCXX 699 #define __unaligned 700 #endif 701 for (size_t i=4; i<read; i++) { 702 if (*(__unaligned int4*)(buffer+i) == debswp) { 703 cout << "trying to skip " << i << " bytes to pos="<<pos+i << endl; 704 return pos+i; 705 } 706 } 707 pos += read; 708 } 709 cout << "cannot find block start" << endl; 710 return -1; 711 } 712 713 697 #ifdef __MWERKS__ 698 #pragma mark - 699 #endif 714 700 715 701 … … 762 748 } 763 749 764 void ArcheopsFile::setUTCOffset( intUTCOffset) {750 void ArcheopsFile::setUTCOffset(double UTCOffset) { 765 751 utcOffset = UTCOffset; 766 752 startMJD = rawMJD - utcOffset/24.; … … 771 757 } 772 758 773 int ArcheopsFile::getBoloBlockNum() {774 if (!lastBolo()) return -1;775 return numero_block(lastBolo());776 }777 778 int ArcheopsFile::getBoloCompBlockNum() {779 if (!lastBolo()) return -1;780 return numero_block(lastBoloComp());781 }782 783 int ArcheopsFile::getReglageBlockNum() {784 if (!lastReglage()) return -1;785 return numero_block(lastReglage());786 }787 788 int ArcheopsFile::getDilutionBlockNum() {789 if (!lastDilution()) return -1;790 return numero_block(lastDilution());791 }792 793 794 int ArcheopsFile::getSSTBlockNum() {795 if (!lastSST()) return -1;796 return numero_block(lastSST());797 }798 799 int ArcheopsFile::getSSTCompBlockNum() {800 if (!lastSST()) return -1;801 return numero_block(lastSSTComp());802 }803 804 805 806 int ArcheopsFile::getGyroBlockNum() {807 if (!lastGyro()) return -1;808 return numero_block(lastGyro());809 }810 811 812 // GPS813 // $GPGGA,hhmmss.ss,ddmm.mmmm,n,dddmm.mmmm,e,q,ss,y.y,a.a,z,814 815 816 int ArcheopsFile::getGPSBlockNum() {817 if (!lastGPS()) return -1;818 return numero_block(lastGPS());819 }820 821 double ArcheopsFile::getGPSUTC() { // en secondes depuis minuit UTC jour courant822 if (!lastGPS()) return -9.e99;823 return blockSet->gpsParser.getUTC();824 }825 826 double ArcheopsFile::getGPSMJD() { // modified julian day du dernier bloc GPS, JD - 2450000827 double t = getGPSUTC()/86400. - 0.5;828 if (t<0) return t;829 if (t > (startMJD - int(startMJD))) {830 return int(startMJD) + t;831 } else {832 return int(startMJD) + 1. + t;833 }834 }835 836 double ArcheopsFile::getGPSLat() { // degres, + = NORD837 if (!lastGPS()) return -9.e99;838 return blockSet->gpsParser.getLatitude();839 }840 841 842 double ArcheopsFile::getGPSLong() { // degres, + = EST843 if (!lastGPS()) return -9.e99;844 return blockSet->gpsParser.getLongitude();845 }846 847 double ArcheopsFile::getGPSAlt() { // meters from sea level848 if (!lastGPS()) return -9.e99;849 return blockSet->gpsParser.getAltitude();850 }851 852 bool ArcheopsFile::hasGPSTime() {853 if (!lastGPS()) return false;854 // return blockSet->gpsParser.hasGPSTime();855 return blockSet->gpsParser.hasTime();856 }857 858 bool ArcheopsFile::hasGPSPos() {859 if (!lastGPS()) return false;860 return blockSet->gpsParser.hasPosition();861 }862 863 bool ArcheopsFile::hasGPSAlt() {864 if (!lastGPS()) return false;865 return blockSet->gpsParser.hasAltitude();866 }867 868 869 // Bolo870 #define val_DS(j,i) (blk->data_bolo[j][i]&0x1fffff)871 872 873 double ArcheopsFile::getBoloRawMuV(int ibolo, int imesure) { // microvolts bruts874 block_type_bolo* blk = imesure >= 0 ? lastBolo() : llastBolo();875 if (imesure < 0) imesure += nEchBlock();876 block_type_reglage* reglage = lastReglage();877 block_type_param* param = lastParam();878 if (!blk) return 0;879 if (!reglage) return 0;880 if (!param) return 0;881 882 int s = imesure % 2 ? 1 : -1;883 884 return s*bolo_muV(¶m->param, ®lage->reglage, val_DS(ibolo,imesure), ibolo);885 }886 887 double ArcheopsFile::getBoloRawMuVCN(int ibolo, int imesure) {888 // Si pas bloc comprime -> 1 bit889 int lastbit = 1;890 if (!(lastBoloComp() == NULL) &&891 (numero_block(lastBoloComp()) != numero_block(lastBolo()))) {892 unsigned int4* data = lastBoloComp()->data_bolo[ibolo];893 // Les deux premieres valeurs sont codees directement...894 if (imesure>=2) {895 int iExp = (imesure-2)/4 + 1;896 int expo = data[iExp] & 0xf;897 lastbit = 1 << expo;898 }899 }900 block_type_reglage* reglage = lastReglage();901 block_type_param* param = lastParam();902 if (!reglage) return 0;903 if (!param) return 0;904 double noise = (905 bolo_muV(¶m->param, ®lage->reglage, lastbit, ibolo) -906 bolo_muV(¶m->param, ®lage->reglage, 0, ibolo)) /2.;907 908 return noise;909 }910 911 912 913 def_gains914 915 double ArcheopsFile::getBoloMuV(int ibolo, int imesure) { // microvolts, filtre avec filtre carre916 double y = (getBoloRawMuV(ibolo, imesure-1) + getBoloRawMuV(ibolo, imesure))/2.;917 return y;918 }919 920 double ArcheopsFile::getBoloMuV2(int ibolo, int imesure) { // microvolts, filtre921 // On commence par trouver la valeur d'offset, en fittant une droite sur les soustractions922 if (!lastBolo() || !llastBolo()) return 0;923 //block_type_reglage* reglage = lastReglage();924 //block_type_param* param = lastParam();925 //if (!reglage) return 0;926 //if (!param) return 0;927 double sumx=0, sumy=0, sumxy=0, sumx2=0;928 int n=20;929 int s = imesure % 2 ? 1 : -1;930 for (int i=1; i<=n; i++) {931 double x = -i;932 double y = s*(getBoloRawMuV(ibolo, imesure-i+1) - getBoloRawMuV(ibolo, imesure-i))/2;933 s = -s;934 sumx += x;935 sumy += y;936 sumxy += x*y;937 sumx2 += x*x;938 }939 double a = (sumxy/n - (sumx/n)*(sumy/n)) / (sumx2/n - (sumx/n)*(sumx/n));940 double b = (sumy/n) - a*(sumx/n);941 s = imesure % 2 ? 1 : -1;942 double y = getBoloRawMuV(ibolo, imesure);943 y = y-s*b;944 return y;945 }946 947 /*948 double ArcheopsFile::getBoloMuV2(int ibolo, int imesure) { // microvolts, filtre949 // On commence par trouver la valeur d'offset, en fittant une droite sur les soustractions950 if (!lastBolo() || !llastBolo()) return 0;951 double sumx=0, sumy=0, sumxy=0, sumx2=0;952 int n=20;953 int s = (imesure-n) % 2 ? 1 : -1;954 static double* data = NULL;955 if (!data) data = new double[n+1];956 for (int i=0; i<=n; i++) {957 data[i] = getBoloRawMuV(ibolo, imesure-n+i);958 }959 for (int i=0; i<=n; i++) {960 961 }962 for (int i=1; i<=n; i++) {963 double x = -i;964 double y = s*(getBoloRawMuV(ibolo, imesure-i+1) - getBoloRawMuV(ibolo, imesure-i))/2;965 s = -s;966 sumx += x;967 sumy += y;968 sumxy += x*y;969 sumx2 += x*x;970 }971 double a = (sumxy/n - (sumx/n)*(sumy/n)) / (sumx2/n - (sumx/n)*(sumx/n));972 double b = (sumy/n) - a*(sumx/n);973 s = imesure % 2 ? 1 : -1;974 double y = getBoloRawMuV(ibolo, imesure);975 y = y-s*b;976 return y;977 }978 */979 980 981 double ArcheopsFile::getGainAmpli(int ibolo) {982 return gain_ampli(lastReglage()->reglage.bolo[ibolo]);983 }984 985 986 double ArcheopsFile::getDACV(int ibolo) {987 block_type_reglage* reglage = lastReglage();988 block_type_param* param = lastParam();989 if (!reglage) return 0;990 if (!param) return 0;991 return DAC_muV(¶m->param, ®lage->reglage, ibolo);992 }993 994 double ArcheopsFile::getDACI(int ibolo) {995 block_type_reglage* reglage = lastReglage();996 block_type_param* param = lastParam();997 if (!reglage) return 0;998 if (!param) return 0;999 return DAC_muA(¶m->param, ®lage->reglage, ibolo);1000 }1001 1002 double ArcheopsFile::getBoloMuV2T(int ibolo, int imesure) {1003 return getDACV(ibolo) - getBoloMuV2(ibolo, imesure) ;1004 }1005 1006 double ArcheopsFile::getBoloRes(int ibolo, int imesure) {1007 double i = getDACI(ibolo); // microAmps1008 double v = getBoloMuV2T(ibolo, imesure); // microVolts1009 double r = v/i; // Ohms1010 return r;1011 }1012 1013 double ArcheopsFile::getBoloTemp(int ibolo, int imesure) {1014 double r = getBoloRes(ibolo, imesure);1015 block_type_reglage* reglage = lastReglage();1016 block_type_param* param = lastParam();1017 if (!reglage) return 0;1018 if (!param) return 0;1019 return bolo_temp(¶m->param, ®lage->reglage, r, ibolo);1020 }1021 1022 1023 // Dilution1024 1025 int4 ArcheopsFile::getADCDil(int iADC) {1026 block_type_dilution* blk = lastDilution();1027 if (!blk) return 0;1028 if (iADC < 0 || iADC > 47) return 0;1029 return blk->ADC_dil[iADC];1030 }1031 1032 int4 ArcheopsFile::getSwitchDil() {1033 block_type_dilution* blk = lastDilution();1034 if (!blk) return 0;1035 return blk->switch_dil;1036 }1037 1038 1039 // SST, gyros...1040 1041 void ArcheopsFile::needSSTProcessMask(int mask) {1042 blockSet->sstHandler.NeedProcess(mask);1043 }1044 1045 long ArcheopsFile::getSSTSignal(int idiode, int imesure) {1046 return blockSet->sstHandler.getSignal(imesure, idiode);1047 }1048 1049 long ArcheopsFile::getSSTRawSignal(int idiode, int imesure) {1050 return blockSet->sstHandler.getRawSignal(imesure, idiode);1051 }1052 1053 double ArcheopsFile::getSSTSignalCN(int idiode, int imesure) {1054 return getSSTRawSignalCN(SSTHandler::getDiodPermut(idiode),imesure);1055 }1056 1057 double ArcheopsFile::getSSTRawSignalCN(int ichannel, int imesure) {1058 // Si pas bloc comprime -> 0.51059 if (lastSSTComp() == NULL) return .5;1060 if (numero_block(lastSSTComp()) != numero_block(lastSST())) return 0.5;1061 1062 // Attention, on ne transmet pas les canaux 0 et 4....1063 if (ichannel == 0 || ichannel == 4) return 0;1064 int i = ichannel - 1;1065 if (i >= 4) i--;1066 unsigned int4* data = lastSSTComp()->sst[i];1067 // Les deux premieres valeurs sont codees directement...1068 if (imesure<2) return 0.5;1069 int iExp = (imesure-2)/7 + 1;1070 int expo = data[iExp] & 0xf;1071 int noise = 1 << expo;1072 return noise/2.;1073 }1074 1075 1076 1077 double ArcheopsFile::getSSTStarZ(int istar, int imesure) {1078 return blockSet->sstHandler.getStarZ(imesure+getSSTBlockNum()*nb_per_block*2, istar);1079 }1080 1081 double ArcheopsFile::getSSTStarF(int istar, int imesure) {1082 return blockSet->sstHandler.getStarF(imesure+getSSTBlockNum()*nb_per_block*2, istar);1083 }1084 1085 double ArcheopsFile::getSSTStarT(int istar, int imesure) {1086 return blockSet->sstHandler.getStarTime(imesure+getSSTBlockNum()*nb_per_block*2, istar);1087 }1088 1089 int ArcheopsFile::getNumbStar(int imesure) {1090 return blockSet->sstHandler.getNumbStar(imesure+getSSTBlockNum()*nb_per_block*2);1091 }1092 1093 long ArcheopsFile::getGyroRaw(int igyro, int imesure) {1094 return blockSet->gyroHandler.getRawSignal(imesure, igyro);1095 }1096 1097 double ArcheopsFile::getGyroTens(int igyro, int imesure) {1098 return blockSet->gyroHandler.getSignal(imesure, igyro);1099 }1100 1101 double ArcheopsFile::getGyroSpeed(int igyro, int imesure) {1102 return blockSet->gyroHandler.getSpeed(imesure, igyro);1103 }1104 1105 1106 1107 1108 1109 // $CHECK$ TBD1110 1111 1112 double ArcheopsFile::getAzimut(int /*imesure*/) {return 0;}1113 double ArcheopsFile::getPendDirect(int /*imesure*/) {return 0;}1114 double ArcheopsFile::getPendOrth(int /*imesure*/) {return 0;}1115 double ArcheopsFile::getAlphaAxis(int /*imesure*/) {return 0;}1116 double ArcheopsFile::getDeltaAxis(int /*imesure*/) {return 0;} -
trunk/Poubelle/archTOI.old/archeopsfile.h
r436 r534 9 9 #include <stack> 10 10 11 using namespace std; 11 12 12 #ifndef nb_max_bolo 13 #define _archeops // Acquisition Archeops (avec transputer) 14 #define programme 15 extern "C" { 16 #include "archeops.h" 17 } 18 #endif 19 20 #include "ssthandler.h" 21 #include "gpsparser.h" 13 #include "ark.h" 14 #include "archexc.h" 22 15 23 16 enum { … … 50 43 class BlockSet; 51 44 52 class ArchExc {53 public:54 ArchExc(string s) : msg(s) {}55 string Msg() {return msg;}56 protected:57 string msg;58 };59 45 60 46 class ArcheopsFile { … … 64 50 virtual ~ArcheopsFile(); 65 51 66 void setUTCOffset( intUTCOffset=2); // StartMJD : decodage a partir du nom du bloc...52 void setUTCOffset(double UTCOffset=2); // StartMJD : decodage a partir du nom du bloc... 67 53 double getStartMJD(); 68 54 … … 76 62 string blockRawKdName(); 77 63 string filename() {return fn;} 78 79 double perEchant(); // periode d'echantillonage pour le dernier bloc reglage80 double perBlock(); // duree (en secondes) correspondant a un bloc bolo81 // utilise infos dernier bloc param et dernier bloc reglage.82 int nEchBlock(); // Nb d'echantillons dans un bloc bolo83 64 84 65 … … 109 90 110 91 void forceBlock(block_type_modele* blk); 111 112 // Decodage des derniers blocs..113 114 // GPS115 // On travaille en MJD = JD - 2450000.0, = 9 octobre 1995 midi UTC116 // 1er juillet 1999 minuit UTC = JD 2451360.5, MJD 1360.5117 // Ces fonctions travaillent sur le dernier bloc GPS118 int getGPSBlockNum();119 bool hasGPSTime();120 bool hasGPSPos();121 bool hasGPSAlt();122 double getGPSUTC(); // en secondes depuis minuit UTC123 double getGPSMJD(); // modified julian day du dernier bloc GPS, JD - 2450000124 double getGPSLat(); // degres, + = NORD125 double getGPSLong(); // degres, + = EST126 double getGPSAlt(); // meters from sea level127 92 128 // Bolo129 int getReglageBlockNum();130 int getBoloBlockNum();131 int getBoloCompBlockNum();132 double getBoloRawMuV(int ibolo, int imesure); // donnee brute en microvolts et signe change.133 double getBoloRawMuVCN(int ibolo, int imesure); // bruit de compression, en microVolts134 double getBoloMuV(int ibolo, int imesure); // microvolts, filtre avec filtre carre135 double getBoloMuV2(int ibolo, int imesure); // microvolts, filtre +sioux136 double getGainAmpli(int ibolo);137 double getDACV(int ibolo); // offset en microvolt138 double getDACI(int ibolo); // courant en microAmps139 double getBoloMuV2T(int ibolo, int imesure); // avec soustraction dacV140 double getBoloRes(int ibolo, int imesure); // Ohms141 double getBoloTemp(int ibolo, int imesure); // K142 143 // Dilution144 int getDilutionBlockNum();145 int4 getADCDil(int iADC);146 int4 getSwitchDil();147 148 // SST, gyros, etc149 int getSSTBlockNum();150 int getSSTCompBlockNum();151 void needSSTProcessMask(int mask);152 long getSSTRawSignal(int iDiode, int imesure);153 long getSSTSignal(int iDiode, int imesure);154 double getSSTRawSignalCN(int iDiode, int imesure);155 double getSSTSignalCN(int iDiode, int imesure);156 double getSSTStarZ(int iStar, int imesure);157 double getSSTStarF(int iStar, int imesure);158 double getSSTStarT(int iStar, int imesure);159 int getNumbStar(int imesure);160 161 int getGyroBlockNum();162 long getGyroRaw(int iGyro, int imesure);163 double getGyroTens(int iGyro, int imesure);164 double getGyroSpeed(int iGyro, int imesure);165 166 double getAzimut(int imesure);167 double getPendDirect(int imesure);168 double getPendOrth(int imesure);169 170 double getAlphaAxis(int imesure);171 double getDeltaAxis(int imesure);172 173 93 static double decodeMJD(string const& dateString); // sans tenir compte de TU-TLeg 174 94 … … 176 96 BlockSet* blockSet; 177 97 stack<BlockSet*> blockStack; 178 stack< size_t>fposStack;98 stack<long> fposStack; 179 99 180 100 void saveCurBlock(); … … 193 113 long curPos; 194 114 long peekPos; 195 size_tfLen;115 long fLen; 196 116 FILE* f; 197 117 string fn; -
trunk/Poubelle/archTOI.old/archparam.cc
r432 r534 38 38 cout << "***END" << endl; 39 39 } 40 41 double ArchParam::AcqParam::SN2MJD(double sample) { 42 return tBlock0 + sample*perEch/86400.; 43 } 44 45 46 double ArchParam::AcqParam::MJD2UTC(double mjd) { 47 return (mjd - utcOrigin)*24. ; 48 } 49 50 double ArchParam::AcqParam::UTC2MJD(double utc) { 51 return utc/24 + utcOrigin; 52 } 53 54 double ArchParam::AcqParam::SN2UTC(double sample) { 55 return MJD2UTC(SN2MJD(sample)); 56 } 57 58 59 double ArchParam::AcqParam::MJD2SN(double mjd) { 60 return (mjd - tBlock0)/perEch*86400.; 61 } 62 -
trunk/Poubelle/archTOI.old/archparam.h
r432 r534 11 11 double utcOrigin; 12 12 AcqParam(); 13 double SN2MJD(double snum); 14 double SN2UTC(double snum); 15 double MJD2UTC(double mjd); 16 double UTC2MJD(double utc); 17 double MJD2SN(double mjd); 13 18 }; 14 19 -
trunk/Poubelle/archTOI.old/archtoi.cc
r436 r534 9 9 10 10 #include "archeopsfile.h" 11 #include "toisvr.h" 11 #include "toiiter.h" 12 #include "toimanager.h" 12 13 #include "archtoi.h" 13 14 #include "archparam.h" … … 39 40 { 40 41 init(); 41 svr.readReq(str);42 iter.readReq(str); 42 43 } 43 44 … … 47 48 init(); 48 49 ifstream str(filename.c_str()); 49 svr.readReq(str);50 iter.readReq(str); 50 51 } 51 52 … … 59 60 ostr = NULL; 60 61 requestVersion = ""; 61 svr.registerReqHandler(this); 62 } 63 64 65 bool ArchTOI::processTOIReq(string line, string toiname, TOIKind /*kind*/, int index, 66 bool interp, bool repet, bool flag, bool /*notrig*/) 62 iter.registerReqHandler(this); 63 64 TOIManager::registerDefaultProducers(); 65 } 66 67 68 bool ArchTOI::processTOIReq(TOI const& toi, string line) 67 69 { 68 70 headertoi.push_back(line); 69 if (index>=0) { 70 char idx[10]; 71 sprintf(idx,"_%d",index); 72 toiname += idx; 73 } 74 if (flag) { 75 toinames.push_back("flg_"+toiname); 76 } 77 toinames.push_back(toiname); 78 toiflags.push_back(flg((flag?hasflag:0)+((!repet&&!interp)?useNA:0))); 71 tois.push_back(toi); 79 72 return true; 80 73 } … … 130 123 131 124 cout << "starting query" << endl; 132 TOIIter iter = svr.doQuery();125 iter.init(); 133 126 (this->*openFile)(outfilename); 134 127 (this->*outHeader)(iter); 135 128 136 129 cout << "processing" << endl; 137 while (iter. Next()) {138 int nn = iter.getSample Index() / iter.getUnderSampling(); // Only for tick mark...130 while (iter.next()) { 131 int nn = iter.getSampleNum() / iter.getUnderSample(); // Only for tick mark... 139 132 #ifdef __MWERKS__ 140 133 yield(); … … 145 138 if (nn%(200*80) == 0) cout << endl; 146 139 // Si rien de dispo parmi les triggering, alors on passe au suivant 147 bool hasValue = false; 148 for (int i=0; i<toiflags.size(); i++) { 149 if (!iter.isTrig(i)) continue; 150 if (iter.canGetValue(i)) {hasValue=true; break;} 151 } 152 if (!hasValue) continue; 140 // normalement, c'est gere par le toiiter... 141 //bool hasValue = false; 142 //for (int i=0; i<toiflags.size(); i++) { 143 // if (!iter.isTrig(i)) continue; 144 // if (iter.canGetValue(i)) {hasValue=true; break;} 145 //} 146 //if (!hasValue) continue; 153 147 int icol=0; 154 for (int i=0; i<toi flags.size(); i++) {148 for (int i=0; i<tois.size(); i++) { 155 149 double value = iter.getValue(i); 156 150 bool ok = iter.canGetValue(i); 157 bool isnew = iter.newValue(i); 158 flg flag = toiflags[i]; 159 if (flag & hasflag) { 160 (this->*outValue)(icol, (ok && isnew ? 1 : 0)); 161 icol++; 162 } 163 if (((flag & useNA)!=0 && !isnew) || !ok) 151 // bool isnew = iter.newValue(i); 152 // flg flag = toiflags[i]; 153 // if (flag & hasflag) { 154 // (this->*outValue)(icol, (ok && isnew ? 1 : 0)); 155 // icol++; 156 // } 157 //if (((flag & useNA)!=0 && !isnew) || !ok) 158 if (!ok) 164 159 (this->*outValue)(icol, 0, true); 165 160 else … … 184 179 for (list<string>::iterator i = headeropt.begin(); i != headeropt.end(); i++) 185 180 *ostr << (*i) << '\n';; 186 block_type_param* blk = iter. lastParam();181 block_type_param* blk = iter.getFSet().lastParam(); 187 182 if (blk) { 188 183 int nb = blk->param.n_max_bolo; … … 227 222 } 228 223 224 list<string> ArchTOI::buildNames() { 225 list<string> toinames; 226 map<string,int> namecount; 227 228 for (list<TOI>::iterator i = tois.begin(); i != tois.end(); i++) { 229 namecount[(*i).name]++; 230 } 231 232 map<string,int> curcount; 233 for (list<TOI>::iterator i = tois.begin(); i != tois.end(); i++) { 234 string toiname = (*i).name; 235 if (namecount[(*i).name]>1) { 236 char s[10]; 237 sprintf(s,"_%d",curcount[(*i).name]++); 238 toiname += s; 239 } 240 if ((*i).index != TOI::unspec) { 241 char s[10]; 242 sprintf(s,"_%d",(*i).index); 243 toiname += s; 244 } 245 toinames.push_back(toiname); 246 } 247 return toinames; 248 } 229 249 230 250 void ArchTOI::openFile_F(string const& filename) { … … 237 257 } 238 258 259 239 260 void ArchTOI::outHeader_F(TOIIter& iter) { 261 list<string> toinames = buildNames(); 262 240 263 int ncols=toinames.size(); 241 264 … … 244 267 char** colunits = new (char*[ncols]); 245 268 int j=0; 246 for (list<string>::iterator i = toinames.begin(); i != toinames.end(); i++,j++) { 269 list<TOI>::iterator kk = tois.begin(); 270 for (list<string>::iterator i = toinames.begin(); i != toinames.end(); i++,j++,kk++) { 247 271 colnames[j] = const_cast<char*>((*i).c_str()); // should work for most STL implementations... Check... 248 272 coltypes[j] = "1D"; 249 colunits[j] = " "; 273 colunits[j] = const_cast<char*>((*kk).unit.c_str()); 274 cout << (*i).c_str() << " " << ((*kk).unit.c_str()) << endl; 250 275 } 251 276 … … 261 286 int ntoireq = headertoi.size(); 262 287 fits_write_key(fptr, TINT, "TOIREQ", &ntoireq, NULL, &fitsStatus); 263 for (list<string>::iterator i = headertoi.begin(); i != headertoi.end(); i++,j++) { 288 list<string>::iterator kkk = toinames.begin(); 289 for (list<string>::iterator i = headertoi.begin(); i != headertoi.end(); i++,j++,kkk++) { 264 290 char line[80]; 265 291 strcpy(line, (*i).c_str()); 266 292 char* pline = line; 267 fits_write_keys_str(fptr, "TOIREQ", j, 1, &pline, (char**) NULL, &fitsStatus); 293 char* cmt = const_cast<char*>((*kkk).c_str()); 294 fits_write_keys_str(fptr, "TOIREQ", j, 1, &pline, &cmt, &fitsStatus); 268 295 } 269 296 j=1; … … 278 305 279 306 // Noms des bolos 280 block_type_param* blk = iter. lastParam();307 block_type_param* blk = iter.getFSet().lastParam(); 281 308 if (blk) { 282 309 int nb = blk->param.n_max_bolo; … … 338 365 fits_report_error(stderr, fitsStatus); /* print out any error messages */ 339 366 } 367 368 -
trunk/Poubelle/archTOI.old/archtoi.h
r432 r534 9 9 #include <list> 10 10 #include <vector> 11 #include "toi svr.h"11 #include "toiiter.h" 12 12 #include "fitsio.h" 13 13 … … 25 25 useNA = 2}; 26 26 27 virtual bool processTOIReq(string line, string toiname, TOIKind toi, int index, 28 bool interp, bool repet, bool flag, bool notrig); 27 virtual bool processTOIReq(TOI const& toi, string line); 29 28 virtual bool processOption(string keyw, string args); 30 29 31 30 protected: 32 31 void init(); 33 TOI Svr svr;32 TOIIter iter; 34 33 list<string> headertoi; 35 34 list<string> headeropt; 36 list<string> toinames; 37 vector<flg> toiflags; 35 list<TOI> tois; 38 36 fmt format; 39 37 string undef; … … 46 44 void (ArchTOI::*endLine)(); 47 45 void (ArchTOI::*closeFile)(); 46 47 list<string> buildNames(); 48 48 49 49 void openFile_A(string const& filename); -
trunk/Poubelle/archTOI.old/archtoimain.cc
r436 r534 7 7 8 8 #include "archeopsfile.h" 9 9 10 #include "archtoi.h" 10 #include "toi svr.h"11 #include "toimanager.h" 11 12 12 13 //#include <profiler.h> … … 23 24 argc = ccommand(&argv); 24 25 #endif 26 27 25 28 if (argc != 3) { 26 29 cerr << "usage: archtoi reqfile datafile" << endl; 30 cerr << "or: archtoi -h reqfile" << endl; 27 31 return(-1); 28 32 } … … 30 34 // ProfilerInit(collectDetailed, bestTimeBase, 10000, 200); 31 35 36 if (argv[1] == string("-h")) { 37 ArchTOI toi(argv[2]); 38 TOIManager::dumpAvailTOIs(cout); 39 exit(0); 40 } 41 32 42 33 ArchTOI toi(argv[1]); 34 toi.run(argv[2]); 43 try { 44 ArchTOI toi(argv[1]); 45 toi.run(argv[2]); 46 } catch (ArchExc exc) { 47 cerr << exc.Msg() << endl; 48 exit(-1); 49 } 35 50 36 51 // ProfilerDump("\pprofiler.data"); 37 52 return(0); 38 53 } 54 -
trunk/Poubelle/archTOI.old/archvers.h
r503 r534 2 2 #define ARCHVERS_H 3 3 4 #define ARCHTOI_VERS " 1.3"5 #define ARCHTOI_TAG "V_ 241099"4 #define ARCHTOI_VERS "2.0" 5 #define ARCHTOI_TAG "V_011199" 6 6 7 7 #endif -
trunk/Poubelle/archTOI.old/auxgps.h
r363 r534 10 10 11 11 virtual int getLocation(double mjd, double& lat, double& lon, double& alt)=0; 12 virtual bool canGetLocation(double mjd)=0; 13 virtual double getStartMJD()=0; 14 virtual double getEndMJD()=0; 12 15 virtual AuxGPS* clone()=0; 13 16 -
trunk/Poubelle/archTOI.old/auxinterpgps.cc
r416 r534 18 18 ilast = elems.upper_bound(elem(mjd,0,0,0)); 19 19 ilastok = (ilast != elems.end() && ilast != elems.begin()); 20 } 21 22 bool AuxInterpGPS::canGetLocation(double mjd) { 23 return (mjd > (*elems.begin()).mjd && mjd < (*--elems.end()).mjd); 24 } 25 26 double AuxInterpGPS::getStartMJD() { 27 return (*elems.begin()).mjd; 28 } 29 30 double AuxInterpGPS::getEndMJD() { 31 return (*--elems.end()).mjd; 20 32 } 21 33 -
trunk/Poubelle/archTOI.old/auxinterpgps.h
r363 r534 15 15 AuxInterpGPS(); 16 16 virtual int getLocation(double mjd, double& lat, double& lon, double& alt); 17 virtual bool canGetLocation(double mjd); 18 virtual double getStartMJD(); 19 virtual double getEndMJD(); 17 20 18 21 void FitsDump(string const& filename); -
trunk/Poubelle/archTOI.old/dyffttools.cc
r394 r534 1 1 #include "dyffttools.h" 2 2 3 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 3 4 4 5 // Librairie FFTMayer enrobée pour etre utilisable facilement en C++ -
trunk/Poubelle/archTOI.old/dyffttools.h
r394 r534 1 1 #ifndef DYFFTTOOLS_SEEN 2 #define DYFFTTOOLS 2 #define DYFFTTOOLS_SEEN 3 4 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 5 3 6 double DYWindow(double index, double indexMax); 4 7 -
trunk/Poubelle/archTOI.old/formepulse.cc
r394 r534 2 2 #include <fstream.h> 3 3 4 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 4 5 5 6 #include <math.h> … … 13 14 #include "ssthardware.h" 14 15 15 16 16 #define LTab (2048) 17 #define LSave ( 128)17 #define LSave (256) 18 18 #define Tpas (5.e-4) 19 19 //float PulseOptOrigin=LTab/16.*Tpas; … … 22 22 //#define DYTestRun 23 23 24 24 /* 25 FormePulse::FormePulse() { 26 gainElec=0.; 27 FullwidthHalfMax=0; 28 ShapeArr=new double[LSave]; 29 for(int i=0; i<LSave; i++) ShapeArr[i]=0.; 30 } 31 */ 25 32 26 33 FormePulse::FormePulse(TransFuncElec TF) { … … 129 136 for(int i=0; i<LSave; i++) ShapeArr[i]=PulseInReel[i]/Max; 130 137 131 #ifdef DYTestRun138 //#ifdef DYTestRun 132 139 //On ecrit le resultat dans un fichier 133 140 char s2[32]="Resultatfiltrage.txt"; … … 139 146 140 147 dlout<<"Impulsion courant de: "<<SSTFPulseCourant<<" Ampères"<<endl; 141 dlout<<"Maximum d'amplitude: "<<max<< " Volts"<<endl; 142 dlout<<" gain chaine preampli: "<<gainElec<<endl<<endl; 148 dlout<<"Maximum d'amplitude: "<<Max<< " Volts"<<endl; 149 dlout<<" gain chaine preampli: "<<gainElec<<endl; 150 dlout<<"largueur a mi hauteur: "<<FullwidthHalfMax<<endl<<endl; 143 151 dlout<<"Temps"<<"\tPartie Reelle"<<endl; 144 152 … … 146 154 dlout<<k*Tpas<<"\t"<<ShapeArr[k]<<endl; 147 155 } 148 #endif156 //#endif 149 157 150 158 … … 163 171 return *this; 164 172 } 165 173 166 174 FormePulse::~FormePulse() { 167 175 delete[] ShapeArr; … … 174 182 175 183 double FormePulse::PulseShape(double temps) { 184 double returnValue; 176 185 int ientier=(int)(temps/Tpas); 177 double returnValue;178 186 if (ientier<0) returnValue=0.; 179 else if (ientier>=LSave) returnValue= ShapeArr[ 127];187 else if (ientier>=LSave) returnValue= ShapeArr[LSave-1]; 180 188 else { 181 189 double Min=ShapeArr[ientier]; … … 193 201 //en secondes 194 202 return returnVal; 203 // return returnVal=30.e-3; //Gros BUGG!!!!! 195 204 } 196 205 -
trunk/Poubelle/archTOI.old/formepulse.h
r394 r534 2 2 #define FORMEPULSE_SEEN 3 3 4 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 4 5 5 6 #define SSTFPulseCourant 1.E-9 … … 11 12 class FormePulse { 12 13 public: 13 FormePulse(TransFuncElec); 14 FormePulse(TransFuncElec TF); 15 FormePulse(); // Cas zero lecture 14 16 FormePulse& operator =(const FormePulse&); 15 17 ~FormePulse(); -
trunk/Poubelle/archTOI.old/pisteetoile.cc
r400 r534 8 8 FormePulse PisteEtoile::FPulse(Trapani); 9 9 10 11 12 int SSTnbPasFit= (int) (2*TFExcursion/TPasTFit); 10 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 13 11 14 12 PisteEtoile::PisteEtoile(short NoPhotDiod) { 15 PasTempsEch= 0.005836818076;13 PasTempsEch=archParam.acq.perEch; 16 14 //BUGG doit changer !!!!! Doit etre extrait d'un serveur de param d'acquisition 17 15 NoPhDiod=NoPhotDiod; 18 16 DiodVivante=true; 17 18 SSTnbPasFit= (int) (2*TFExcursion/TPasTFit); 19 19 20 AmplNorm=0.; 20 // On echantillonne dix fois plus fin pour avoir une bonne estimation de AmplNorm21 // Eviter les systematiques22 21 for(int i=0; i<SSTLongIndexEvt()*10; i++){ 23 AmplNorm+=FPulse.PulseShape(i /10.*TPasTFit)*FPulse.PulseShape(i/10.*TPasTFit);22 AmplNorm+=FPulse.PulseShape(i*PasTempsEch/10.)*FPulse.PulseShape(i*PasTempsEch/10.); 24 23 } 25 24 AmplNorm/=10.; … … 39 38 PisteEtoile& PisteEtoile::operator =(PisteEtoile const & x) { 40 39 PasTempsEch=x.PasTempsEch; 41 //BUGG doit changer !!!!! Doit etre extrait d'un serveur de param d'acquisition42 40 NoPhDiod=x.NoPhDiod; 43 41 DiodVivante=x.DiodVivante; … … 115 113 void PisteEtoile::fill(int* pData, int InDebutPiste, int nData) { 116 114 // if(!isAlive()) return; 117 indexDebutPiste=InDebutPiste ;118 int* PhDiod=PhDiodArray ;115 indexDebutPiste=InDebutPiste - PhDiodTabLong + nData; 116 int* PhDiod=PhDiodArray + PhDiodTabLong - nData; 119 117 int* pDataC=pData; 120 118 for(int k=0;k<nData;k++,pDataC++, PhDiod++) (*PhDiod)=(*pDataC); … … 152 150 153 151 if(testEtoile) { 154 // On emballe une etoile. 152 // On emballe une etoile 153 LastEtoile.InpCurrent= AmplRes/FPulse.GainElectrique(); 154 LastEtoile.InpCurFin= AmplFin/FPulse.GainElectrique(); 155 LastEtoile.TEchan=TIndex; 156 LastEtoile.TFin=Tfin; 157 LastEtoile.InpCurrNoisRMS=Vrms/FPulse.GainElectrique(); 158 LastEtoile.X2Calc=X2Min; 159 LastEtoile.NoDiode=NoPhDiod; 155 160 LastEtoile.FitForme=SuccesAFine; 156 LastEtoile.X2Calc=X2Min;157 LastEtoile.InpCurrNoisRMS=Vrms/FPulse.GainElectrique();158 LastEtoile.TEchan=TIndex;159 LastEtoile.InpCurrent= AmplRes/FPulse.GainElectrique();160 LastEtoile.NoDiode=NoPhDiod;161 161 LastEtoile.LargMiHauteur=widthHalfMax; 162 163 /* cout<<setprecision(9); 164 cout<<TIndex<<" "<<Tfin<<" "<<AmplRes<<" "<<AmplFin<<endl; 165 cout<<TIndex-Tfin<<" "<<(AmplRes-AmplFin)/AmplFin<<endl; 166 */ 162 167 } 163 168 } … … 199 204 // On calcule le Vrms sur le prepulse 200 205 Vrms=0.; 201 for (int i=0; i<Prepulselong; i++) Vrms+=PhDiodPiste[i]*PhDiodPiste[i]; 202 Vrms=sqrt(Vrms)/Prepulselong; 206 for (int i=0; i<Prepulselong; i++) { 207 Vrms+=PhDiodPiste[i]*PhDiodPiste[i]; 208 } 209 Vrms=sqrt(Vrms/Prepulselong); 203 210 if(Vrms<SSTLsbVal) Vrms=SSTLsbVal; // Pour eviter les VRMS=0. 204 211 … … 281 288 // Maintenant que l'on se doute que il y a une etoile 282 289 // On veut connaitre son flux et son temps de passage 283 // Nécessite d 'avoir un ordre d'idee de la vitesse de rotation du ballon.290 // Nécessite de connaitre la vitesse de rotation du ballon. 284 291 285 292 // BUGG devra etre extrait des headers acquisition. Ca peut changer!!!!!! 286 287 288 293 289 294 int IndexDebutEvt=MaxIndex-SSTLargEvtIndex(); … … 292 297 // Pointeur origine du tableau d'echantillon sur lequel sera calculé le fit 293 298 double DeltaTemps=0.; 294 // Pour chaque decalage en temps, on estime un amplitude et calcule le X2 299 300 // Pour chaque decalage en temps, on estime une amplitude et calcule le X2 295 301 for(int k=0; k<SSTnbPasFit; k++) { 296 302 DeltaTemps=TFExcursion-k*TPasTFit; … … 314 320 X2Min=1.e99; 315 321 int X2MinIndex=-1; 316 for(int k=0; k<SSTnbPasFit; k++) 322 for(int k=0; k<SSTnbPasFit; k++) { 317 323 if (X2[k]<X2Min) { 318 324 X2Min=X2[k]; 319 325 X2MinIndex=k; 320 326 } 321 327 } 328 322 329 if((X2MinIndex>0)&&(X2MinIndex<(SSTnbPasFit-1))) { 323 330 324 331 // On fitte une parabole sur les trois X2 qui encadrent le min 325 double Di; // Index (non entier) du minimum du X2332 double Di; // Index (non entier) du minimum du X2 326 333 double X=(X2[X2MinIndex+1]-X2Min)/(X2Min-X2[X2MinIndex-1]); 327 334 Di=0.5*(X+1)/(X-1); 328 335 336 // Le X2 est mimimum pour le n° de pas de fit X2MinIndex+Di 329 337 // On calcule l'amplitude estimee a ce temps 330 338 double Som1=0.; pFitArray=pFitArray0; 331 339 DeltaTemps=TFExcursion-(X2MinIndex-Di)*TPasTFit; 332 340 for(int i=0; i<SSTLongIndexEvt(); i++, pFitArray++) 333 Som1+=(*pFitArray)*FPulse.PulseShape(i*PasTempsEch-DeltaTemps);334 Ampl Res=Som1/AmplNorm;335 336 //Le X2 est mimimum pour le n° de pas de fit X2MinIndex+Di 341 Som1+=(*pFitArray)*FPulse.PulseShape(i*PasTempsEch-DeltaTemps); 342 AmplFin=Som1/AmplNorm; 343 344 337 345 338 346 #ifdef PEtoileDebug 339 double *PulseTrak=new double [SSTLongIndexEvt()];347 double *PulseTrak=new double [SSTLongIndexEvt()]; 340 348 #endif 341 349 // On calcule le X2 correspondant 342 350 double X2Som1=0.; double dummy=0.;pFitArray=pFitArray0; 343 351 for(int i=0;i<SSTLongIndexEvt();i++,pFitArray++) { 352 344 353 #ifdef PEtoileDebug 345 354 PulseTrak[i]=FPulse.PulseShape(i*PasTempsEch-DeltaTemps); 346 355 #endif 347 dummy=(*pFitArray)-Ampl Res*FPulse.PulseShape(i*PasTempsEch-DeltaTemps); // Différence356 dummy=(*pFitArray)-AmplFin*FPulse.PulseShape(i*PasTempsEch-DeltaTemps); // Différence 348 357 X2Som1+=dummy*dummy; // Au carré 349 358 } 350 359 351 360 X2Min=X2Som1/(SSTLongIndexEvt()*Vrms*Vrms); 352 353 TIndex=indexDebutPiste+IndexDebutEvt+DeltaTemps/PasTempsEch; 354 //Ouff!!!! 361 362 Tfin= indexDebutPiste+IndexDebutEvt+DeltaTemps/PasTempsEch; 363 //Ouff!!!! 364 /* 365 cout<<setprecision(9)<<endl; 366 cout<<Tfin<<" "<<indexDebutPiste<<" "<<IndexDebutEvt<<" "<<DeltaTemps/PasTempsEch<<endl; 367 */ 355 368 SuccesAFine=true; 369 370 #ifdef PEtoileDebug 371 delete[] PulseTrak; 372 #endif 356 373 } 357 374 else { // Echec, c'est tres bizarre! On doit etre dans le bruit -
trunk/Poubelle/archTOI.old/pisteetoile.h
r394 r534 5 5 #include "formepulse.h" 6 6 7 /* // D. Yvon, CE Saclay, 08/997 /* // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 8 8 9 9 // Analyse the Photodiode track to find star pulse. 10 10 // Caracterise the time and amplitude of the star Pulse 11 11 12 We analyse a set of 32 samples. The 16first are considered as prepulse sample.12 We analyse a set of 48 samples. The 32 first are considered as prepulse sample. 13 13 On the prepulse: 14 14 We compute baseline and substract it. … … 17 17 Look for trigger 18 18 If triggered : 19 Look for maximum. If max found 20< Max< 28 19 Look for maximum. 20 Compute Full width half maximum 21 Fit a paroabole on max of the pulse 22 return max fitte and time of max fitte 23 if analfine 20 24 Iterate time fit on pulse area and compute amplitude and X2 21 25 Find best X2. … … 23 27 Build SSTStar. 24 28 25 That's it. Test code tstpisteetoile.cc can be found in tstroutines folder.29 That's it. 26 30 When done push the track eigth samples forward and iterate analysis. 27 31 */ … … 39 43 // Parametrisation du Trigger 40 44 #define SeuilGachette (6.) // On déclenche à SeuilGachette sigmas 41 #define SSTLsbVal (10./4096 )45 #define SSTLsbVal (10./4096.) 42 46 43 47 // Parametrisation Analyse Fine 44 48 #define TFExcursion (15.e-3) // Secondes: Excursion du fit autour de MaxIndex 45 #define TPasTFit ( 2.5e-3) // Secondes:49 #define TPasTFit (1.5e-3) // Secondes: 46 50 // Secondes: 47 51 … … 70 74 inline int SSTLargEvtIndex(); 71 75 inline int SSTLongIndexEvt(); 76 static TransFuncElec Trapani; 77 static FormePulse FPulse; 78 72 79 protected: 73 80 double PasTempsEch; //Secondes 74 81 // Idendificateur, repères et gestion 75 82 short NoPhDiod; 76 int indexDebutPiste; // A actualiser dans push() et Fill()! BUGG!!!!83 long indexDebutPiste; // A actualiser dans push() et Fill() 77 84 bool DiodVivante; // Si false, On ne fait rien 78 85 … … 88 95 double Vrms; 89 96 short MaxIndex; // Index de l'amplitude Max en analyse Trig() 97 double TIndex; 90 98 double AmplMax; 99 double AmplRes; 91 100 int widthHalfMax; 101 int SSTnbPasFit; 92 102 // double integ; 93 103 // Variables Resultat d'analyse fine 94 95 double AmplRes; 96 double TIndex; 104 double AmplFin; 105 double Tfin; 97 106 double X2Min; 98 107 bool SuccesAFine; … … 109 118 double* X2; //Tableau des X2 calculés 110 119 111 static TransFuncElec Trapani; 112 static FormePulse FPulse; 120 113 121 114 122 }; -
trunk/Poubelle/archTOI.old/sstetoile.cc
r394 r534 1 1 #include "sstetoile.h" 2 3 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 2 4 3 5 void SSTEtoile::print(ofstream& str) { 4 6 str<<setprecision(11); 5 str<<InpCurrent<<'\t'<<TEchan<<'\t'<<NoDiode<<'\t'<<LargMiHauteur; 6 str<<'\t'<<InpCurrNoisRMS<<endl; 7 // <<'\t'<<X2Calc<<'\t'<<FitForme 7 str<<InpCurrent<<'\t'<<InpCurFin<<'\t'<<TEchan<<'\t'<<TFin<<'\t'<<NoDiode<<'\t'<<LargMiHauteur; 8 str<<'\t'<<InpCurrNoisRMS<<'\t'<<X2Calc<<'\t'<<FitForme<<endl; 8 9 return; 9 10 } 10 11 11 12 string SSTEtoile::printHeader() { 12 string a("InpCurrent\t TempsEchan\tNoDiode\tLarMiHauteur\tICurrRMS\tX2Calc\tFitForme");13 string a("InpCurrent\tInpCurFin\tTempsEchan\tTFin\tNoDiode\tLarMiHauteur\tICurrRMS\tX2Calc\tFitForme"); 13 14 return a; 14 15 } -
trunk/Poubelle/archTOI.old/sstetoile.h
r394 r534 1 1 #ifndef SSTEtoile_H 2 2 #define SSTEtoile_H 3 4 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 3 5 4 6 #include <stdio.h> … … 11 13 public: 12 14 double InpCurrent; // En Ampère 15 double InpCurFin; // En ampère, Analyse fine 13 16 // double IInteg; // En Ampère 14 double TEchan; // Temps en indexEchantillon 17 double TEchan; // Temps en indexEchantillon analyse trig 18 double TFin; // Temps en indexEchantillon analyse fine 15 19 double InpCurrNoisRMS; // Bruit en Ampère 16 double X2Calc; // Sans dimension 20 double X2Calc; // Sans dimension, analyse fine 17 21 int NoDiode; 18 22 bool FitForme; // Fit de forme? … … 20 24 21 25 void print(ofstream& str); 22 st ring printHeader();26 static string printHeader(); 23 27 }; 24 28 -
trunk/Poubelle/archTOI.old/ssthandler.cc
r416 r534 12 12 13 13 #include <math.h> 14 #include <iostream> 14 15 #include "ssthandler.h" 15 16 #include "pisteetoile.h" 16 17 17 #ifdef SST_DUMPLOG 18 18 19 ofstream SSTHandler::sstchass("SSTChassLogFile"); 19 20 bool SSTHandler::sstchassinit=false; 20 #endif21 21 22 22 // diodpermut[i] = channel de la diode i … … 180 180 } 181 181 182 183 // D. Yvon, CEA/DAPNIA/SPP Saclay, 08/99 184 185 186 #ifdef SSTStatLog 187 static ofstream sststat("SSTStatLog"); 188 static int compteurBlock=0; 189 static int nbStar=0; 190 #include "ssthardware.h" 191 #include "archparam.h" 192 #endif 193 194 182 195 int SSTHandler::FindStars(block_type_sst* blk) { 183 196 NbStarInBlock=0; … … 224 237 //On empile sur la map. 225 238 NbStarInBlock++; 226 #ifdef SST _DEBUG239 #ifdef SSTDUMP 227 240 // On écrit les pistes ayant déclénchées 228 241 int NoDiodeEvt=LastStar.NoDiode; 229 if(pPisteDump[NoDiodeEvt]->is_open()) 230 for(int noSamp=0; noSamp<NbSampleBlock;noSamp++) 231 (*pPisteDump[NoDiodeEvt])<<noStarDet<<'\t'<<NoDiode<<'\t'<<NoFirstSpInBlock+noSamp<<'\t'<<Diodedata[noSamp]<<endl; 242 if(NoDiodeEvt<NbChanDump) { 243 if(pPisteDump[NoDiodeEvt]->is_open()) 244 for(int noSamp=0; noSamp<NbSampleBlock;noSamp++) 245 (*pPisteDump[NoDiodeEvt])<<noStarDet<<'\t'<<NoDiode<<'\t'<<NoFirstSpInBlock+noSamp<<'\t'<<Diodedata[noSamp]<<endl; 246 } 232 247 #endif 233 248 noStarDet++; … … 257 272 LastBlockStarVec.push_back((*StarHistReIter).second); 258 273 259 #ifdef SST_DUMPLOG 260 if(NbStarInBlock>0) { 261 274 #ifdef SSTChassLog 275 if(NbStarInBlock>0) { 262 276 // On écrit les étoiles detectées 263 277 vector<SSTEtoile>::reverse_iterator StarVecRevIter; … … 266 280 (*StarVecRevIter).print(sstchass); 267 281 } 268 282 #endif 283 284 #ifdef SSTStatLog 285 int nbBlockincircle=(int) (PeriodRotTeles/(archParam.acq.perEch*72.)); 286 // if((compteurBlock%nbBlockincircle)==0) 287 { 288 // if((compteurBlock%5)==0) { 289 sststat<<numero_block(blk)<<'\t'<<nbStar<<'\t'<<noStarDet<<endl; 290 nbStar=0; 291 } 292 nbStar+=NbStarInBlock; 293 compteurBlock++; 269 294 #endif 270 295 … … 276 301 for(int i=0; i<NbPhotDiodBarette; i++) PisteBar[i]=new PisteEtoile(i); 277 302 StarHistoryMap.clear(); 278 #ifdef SST_DUMPLOG279 303 if (!sstchassinit) { 280 304 sstchass<<LastStar.printHeader()<<endl; 281 305 sstchassinit = true; 282 306 } 283 #endif 284 285 #ifdef SST_DEBUG 307 308 #ifdef SSTDUMP 286 309 char s[32]; 287 310 string fileName; … … 301 324 } 302 325 */ 303 pPisteDump[pistNumb]=new ofstream(fileName.c_str(),ios::out|ios:: trunc);326 pPisteDump[pistNumb]=new ofstream(fileName.c_str(),ios::out|ios::app); 304 327 305 328 if(!(*pPisteDump[pistNumb]).is_open()) { … … 317 340 delete[] PisteBar; 318 341 319 #ifdef SST _DEBUG342 #ifdef SSTDUMP 320 343 for (int pistNumb=0; pistNumb<NbChanDump; pistNumb++) { 321 344 pPisteDump[pistNumb]->close(); 322 345 delete pPisteDump[pistNumb]; 323 346 } 324 delete 347 delete[] pPisteDump; 325 348 #endif 326 349 … … 377 400 { 378 401 lastBlkNum = numero_block(blk); 379 if (prcTodo != 0) { 380 for (int i = 0; i<nb_per_block*2; i++) { 381 DecodeTMBlock(blk, i, diodeRaw[i]); 382 } 402 for (int i = 0; i<nb_per_block*2; i++) { 403 DecodeTMBlock(blk, i, diodeRaw[i]); 383 404 } 384 405 if (prcTodo & permDiode) { -
trunk/Poubelle/archTOI.old/ssthandler.h
r416 r534 24 24 25 25 //#define SST_DEBUG 26 //#define SST_DUMPLOG 27 #define NbChanDump (10) 26 //#define SSTDUMP 27 #define SSTChassLog 28 //#define SSTStatLog 29 30 #define NbChanDump (3) 28 31 #define NbPhotDiodBarette (46) 29 32 #define NbEtInMapMax (100) 30 #define SSTChassLog (true)31 33 #define NbSampleBlock (2*nb_per_block) 32 34 // Fin Zone findStar … … 46 48 void NeedProcess(int prcMask); 47 49 void ProcessBlock(block_type_sst*); 48 bool NeedBlocks() {return prcTodo != 0;}49 50 50 51 static void Has2Bars(bool, int elecOffset=0); // elecOffset : which wired together … … 63 64 double getStarTime(int iSampl, int istar); 64 65 // return star time in this sample 65 66 static int getDiodPermut(int i) {return diodpermut[i];}67 66 68 67 protected: … … 92 91 PisteEtoile** PisteBar; 93 92 94 #ifdef SST _DEBUG93 #ifdef SSTDUMP 95 94 ofstream** pPisteDump; 96 95 #endif … … 111 110 int noStarDet; 112 111 int FirstSplNb(block_type_sst* blk); // Calcule l'index du premier echantillon du block analysé 112 113 113 static ofstream sstchass; 114 114 static bool sstchassinit; -
trunk/Poubelle/archTOI.old/ssthardware.h
r394 r534 1 1 #ifndef SSTHARDWARE_SEEN 2 2 #define SSTHARDWARE_SEEN 3 4 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 3 5 4 6 // Telescope SST … … 11 13 12 14 // Paramètres du Vol 13 #define PeriodRotTeles (20.) 14 15 #define PeriodRotTeles (20.) // Periode de rotation du telescope en seconde 16 //#define PeriodRotTeles (30.) // version Kiruna 15 17 16 18 #endif -
trunk/Poubelle/archTOI.old/templocator.cc
r436 r534 7 7 #include "fitsio.h" 8 8 #include "plgalcross.h" 9 #include "archparam.h" 9 10 10 11 #ifndef M_PI … … 78 79 79 80 // On trouve les croisements juste avant et juste apres notre sampleNum 80 int icross;81 81 for (icross=0; icross<nGalCross; icross++) { 82 82 if (crossings[icross] > sampleNum) break; … … 98 98 if (fabs(azCr2-220) < fabs(azCr1-220)) azCross = azCr2; 99 99 100 doublerotSpeed = 360./(crossings[icross] - crossings[icross-1]); // °/sample100 rotSpeed = 360./(crossings[icross] - crossings[icross-1]); // °/sample 101 101 102 102 azimBolGC = azCross - (sampleNum - (crossings[icross-1]+12))*rotSpeed; … … 104 104 if (azimBolGC > 360) azimBolGC -= 360; 105 105 } 106 107 double TempLocator::getRotSpeed(int sampleNum) { 108 findGeomFromGC(sampleNum); 109 return rotSpeed / archParam.acq.perEch; 110 } 111 112 int TempLocator::getCrossSamples(int sampleNum, int& SN1, int& SN2) { 113 findGeomFromGC(sampleNum); 114 if (icross == 0 || icross >= nGalCross) return -1; 115 SN1 = crossings[icross-1]; 116 SN2 = crossings[icross]; 117 return 0; 118 } 119 106 120 107 121 void TempLocator::getAltAzBolo(int sampleNum, int ibolo, double& elv, double& az) { … … 166 180 aa_hadec (lat * M_PI/180, elv * M_PI/180, az * M_PI/180, &ha, &dec); 167 181 ra = - (ha * 180. / M_PI / 15) + (ts/3600.); 182 while (ra>24) ra -= 24; 183 while (ra<0) ra += 24; 168 184 dec = dec * 180. / M_PI; 169 185 return ra; … … 187 203 double TempLocator::getDeltaCenter(int sampleNum) { 188 204 return getDeltaBolo(sampleNum, 11); 205 } 206 207 double TempLocator::getAzimutCenter(int sampleNum) { 208 return getAzimutBolo(sampleNum, 11); 209 } 210 211 double TempLocator::getElvCenter(int sampleNum) { 212 return getElvBolo(sampleNum, 11); 189 213 } 190 214 -
trunk/Poubelle/archTOI.old/templocator.h
r436 r534 19 19 double getAlphaBolo(int sampleNum, int ibolo); 20 20 double getDeltaBolo(int sampleNum, int ibolo); 21 double getAzimutCenter(int sampleNum); 22 double getElvCenter(int sampleNum); 21 23 double getAlphaCenter(int sampleNum); 22 24 double getDeltaCenter(int sampleNum); 25 double getRotSpeed(int sampleNum); // deg/sec 26 int getCrossSamples(int sampleNum, int& SN1, int& SN2); 23 27 24 28 void getAltAzBolo(int sampleNum, int ibolo, double& elv, double& az); … … 36 40 int xSampleNum; // pour le dernier calcul 37 41 double azimBolGC; 42 double rotSpeed; 43 int icross; 38 44 39 45 void findGeomFromGC(int sampleNum); // pour le bolo qui voit les xing -
trunk/Poubelle/archTOI.old/toiiter.cc
r436 r534 2 2 // Eric Aubourg CEA/DAPNIA/SPP juillet 1999 3 3 4 #ifndef nb_max_bolo 5 #define _archeops // Acquisition Archeops (avec transputer) 6 #define programme 7 extern "C" { 8 #include "archeops.h" 9 #include "arcunit.h" 10 } 4 #include "ark.h" 5 6 #include "toiiter.h" 7 #include "toimanager.h" 8 #include "toiproducer.h" 9 #include "archparam.h" 10 #include "asigps.h" 11 #include "toiauxgpsproducer.h" 12 #include <iostream.h> 13 #include <fstream.h> 14 15 #define CHK_INITED if (initDone) \ 16 throw ArchExc("Trying to modify TOIIter after init done."); 17 18 TOIIter::TOIIter() { 19 mjdStart = -999999999; 20 mjdEnd = 999999999; 21 utcStart = -999999999; 22 utcEnd = 999999999; 23 sStart = -999999999; 24 sEnd = 999999999; 25 26 underSample = 1; 27 curSample = -1; 28 29 initDone = false; 30 incDone = false; 31 } 32 33 #ifdef __MWERKS__ 34 #pragma mark - 11 35 #endif 12 36 13 14 #include "toiiter.h" 15 #include "toiinterpolator.h" 16 #include "archparam.h" 17 #include <dirent.h> 18 #include <iostream.h> 19 #include "templocator.h" 20 21 // Format bloc GPS 22 // $GPGGA,hhmmss.ss,ddmm.mmmm,n,dddmm.mmmm,e,q,ss,y.y,a.a,z, 23 24 TOIIter::TOIIter() { 25 // Toutes les valeurs initialisees par defaut. Le TOISvr les positionnera, 26 // puis lancera l'initialisation 37 void TOIIter::addDirectory(string dir) { 38 CHK_INITED 39 fset.addDirectory(dir); 40 } 41 42 void TOIIter::addFile(string fn) { 43 CHK_INITED 44 fset.addFile(fn); 45 } 46 47 void TOIIter::setMJDInterval(double tStart, double tEnd) { 48 CHK_INITED 49 if (tStart>0) mjdStart = tStart; 50 if (tEnd>0) mjdEnd = tEnd; 51 } 52 53 void TOIIter::setUTCInterval(double tStart, double tEnd) { 54 CHK_INITED 55 if (tStart>0) utcStart = tStart; 56 if (tEnd>0) utcEnd = tEnd; 57 } 58 59 void TOIIter::setSNInterval(long tStart, long tEnd) { 60 CHK_INITED 61 if (tStart>0) sStart = tStart; 62 if (tEnd>0) sEnd = tEnd; 63 } 64 65 void TOIIter::setUnderSample(int n) { 66 CHK_INITED 67 if (n<=1) n=1; 68 underSample = n; 69 } 70 71 int TOIIter::getUnderSample() { 72 return underSample; 73 } 74 75 void TOIIter::addTOI(TOI& toi, bool trg) { 76 CHK_INITED 77 TOIProducer* prod = TOIManager::findTOIProducer(toi); 78 if (!prod) throw ArchExc("Cannot produce " + toi.fullName()); 79 prod->addTOI(toi, this); 80 request.push_back(TOIInfo(toi,prod,trg?1:0)); 81 } 82 83 #ifdef __MWERKS__ 84 #pragma mark - 85 #endif 86 87 88 void TOIIter::registerReqHandler(RequestHandler* h) { 89 CHK_INITED 90 handlers.push_back(h); 91 } 92 93 94 void TOIIter::readReq(istream& str) { 95 CHK_INITED 96 if (!incDone) defaultInclude(); 97 string line; 98 while (str) { 99 getline(str,line); 100 if (!str) break; 101 if (line.substr(0,4)=="#END" && (line.length()==4 || line[5] == ' ')) break; 102 if (line[0] != '@' && line[0] != '#') continue; 103 if (!processRequest(line)) { 104 throw ArchExc("Unrecognized directive " + line); 105 } 106 } 107 } 108 109 110 bool TOIIter::processRequest(string line) { 111 if (line[0] == '#') { 112 int x = line.find(' '); 113 string keyw = line.substr(0, x); 114 string args = (x>0) ? line.substr(x) : string(""); 115 bool handled = processOption(keyw,args); 116 for (list<RequestHandler*>::iterator i = handlers.begin(); 117 i != handlers.end(); i++) { 118 handled |= (*i)->processOption(keyw,args); 119 } 120 return handled; 121 } 122 123 if (line[0] == '@') { 124 TOI toi(line.substr(1)); 125 // if (kind == sampleNum || kind == mjd || kind == mutc) notrig = true; 126 bool handled = processTOIReq(toi,line); 127 for (list<RequestHandler*>::iterator i = handlers.begin(); 128 i != handlers.end(); i++) { 129 handled |= (*i)->processTOIReq(toi,line); 130 } 131 return handled; 132 } 133 return false; 134 } 135 136 137 bool TOIIter::processTOIReq(TOI& toi,string) 138 { 139 TOI toi2 = toi; 140 bool trg=true; 141 if (toi.options.find("notrig") != toi.options.end()) { 142 toi2.options.erase("notrig"); 143 trg=false; 144 } 145 addTOI(toi2, trg); 146 toi.unit = toi2.unit; 147 return true; 148 } 149 150 151 bool TOIIter::processOption(string key, string arg) 152 { 153 if (arg.length()>0 && arg[0] == ' ') { 154 arg = arg.substr(arg.find_first_not_of(' ')); 155 } 156 if (key == "#MJDRANGE") { 157 double tmin, tmax; 158 sscanf(arg.c_str(), "%lg %lg", &tmin, &tmax); 159 setMJDInterval(tmin, tmax); 160 } else if (key == "#UTCRANGE") { 161 double tmin, tmax; 162 sscanf(arg.c_str(), "%lg %lg", &tmin, &tmax); 163 setUTCInterval(tmin, tmax); 164 } else if (key == "#SNRANGE") { 165 long tmin, tmax; 166 sscanf(arg.c_str(), "%ld %ld", &tmin, &tmax); 167 setSNInterval(tmin, tmax); 168 } else if (key == "#PATH") { 169 addDirectory(arg); 170 } else if (key == "#FILE") { 171 addFile(arg); 172 } else if (key == "#UNDERSAMPLE") { 173 setUnderSample(atoi(arg.c_str())); 174 } else if (key == "#MJD0") { 175 double t0; 176 sscanf(arg.c_str(), "%lg", &t0); 177 archParam.acq.tBlock0 = t0; 178 } else if (key == "#UTCORIGIN") { 179 double t0; 180 sscanf(arg.c_str(), "%lg", &t0); 181 archParam.acq.utcOrigin = t0; 182 } else if (key == "#PERECH") { 183 double t0; 184 sscanf(arg.c_str(), "%lg", &t0); 185 archParam.acq.perEch = t0; 186 } else if (key == "#ASIGPS") { 187 ASIGPS* gps = new ASIGPS(arg); 188 TOIManager::registerProducer(new TOIAuxGPSProducer(gps)); 189 // gps->FitsDump("GPSDump.fits"); 190 } else if (key == "#INCLUDE") { 191 ifstream f(arg.c_str()); 192 readReq(f); 193 } else { 194 return false; 195 } 196 return true; 197 } 198 199 200 void TOIIter::defaultInclude() { 201 incDone = true; 202 processRequest("#REQVERSION V_270999"); 203 processRequest("#MJD0 1376.8358818"); 204 processRequest("#PERECH 0.005836818076"); 205 processRequest("#UTCORIGIN 1376.5"); 206 processRequest("#ASIGPS ASI_GPS_archeops1999.ascii"); 207 processRequest("#COMMENT Archtoi V2 -- october 1999 -- Eric Aubourg CEA/DAPNIA"); 208 processRequest("#COMMENT ***WARNING***"); 209 processRequest("#COMMENT ***SOME TOI'S ARE PRELIMINARY***"); 210 processRequest("#COMMENT gyroSpeed is not calibrated"); 211 processRequest("#COMMENT azimut/alpha/delta use galaxy crossings and ASI GPS data"); 212 processRequest("#COMMENT and assume no pendulation"); 213 processRequest("#COMMENT Focal plane center elevation found at 41.5 deg"); 214 processRequest("#COMMENT with Jupiter"); 215 processRequest("#COMMENT boloMuV2 is not protected against glitches"); 216 } 217 218 #ifdef __MWERKS__ 219 #pragma mark - 220 #endif 221 222 void TOIIter::init() { 223 if (initDone) return; 224 initDone = true; 27 225 28 file = NULL; 29 directory = ""; 226 if (utcStart > 0) { 227 double t = (utcStart/24.) + archParam.acq.utcOrigin; 228 if (t > mjdStart) mjdStart=t; 229 } 230 if (utcEnd > 0) { 231 double t = (utcEnd/24.) + archParam.acq.utcOrigin; 232 if (t < mjdEnd) mjdEnd=t; 233 } 234 235 fset.setMJDRange(mjdStart-0.01, mjdEnd+0.01); 236 fset.setSNumRange(sStart-1000, sEnd+1000); 237 238 fset.init(); 239 //curSample = fset.getSampleIndex(); 240 } 241 242 bool TOIIter::isTrig(int column) { 243 return (request[column].third & triggering) != 0; 244 } 30 245 31 files.clear(); 32 33 isOnBoardRecorder = false; 34 35 imes=0; 36 37 tStart = -9.e99; 38 tEnd = 9.e99; 39 utcStart = -9.e99; 40 utcEnd = 9.e99; 41 42 sStart = -999999999; 43 sEnd = 999999999; 44 45 //tBlock0 = -1; 46 // perEch = -1; 47 // Values for Trapani 99 = default values 48 //tBlock0 = 1376.8358818; 49 //perEch = 0.005836818076; 50 51 trigMask = 0; 52 rawIter = NULL; 53 interp = NULL; 54 lastSample = -1; 55 maxLookAhead = 10000; 56 57 auxGPS = NULL; 58 59 initDone = false; 60 61 underSample = 1; 62 } 63 64 TOIIter::TOIIter(TOIIter const& x) { 65 directory = x.directory; 66 files = x.files; 67 if (x.initDone && x.curFile != x.files.end()) curFile = files.find(*(x.curFile)); 68 isOnBoardRecorder = x.isOnBoardRecorder; 69 imes = x.imes; 246 TOI TOIIter::getKind(int column) { 247 return request[column].first; 248 } 249 250 long TOIIter::getSampleNum() { 251 return curSample; 252 } 253 254 bool TOIIter::next() { 255 if (!initDone) init(); 256 for (int ii=0; ii<underSample; ii++) 257 if (!next1()) return false; 70 258 71 tStart = x.tStart; 72 tEnd = x.tEnd; 73 utcStart = x.utcStart; 74 utcEnd = x.utcEnd; 75 sStart = x.sStart; 76 sEnd = x.sEnd; 259 return true; 260 } 261 262 bool TOIIter::next1() { 263 // On tente de produire curSample+1 pour toutes les toi 264 // Eventuellement en avancant sur le fichier... 265 // Puis on regarde si une TOI triggering a eu une nouvelle 266 // valeur. 267 // Si on a epuise les fichiers de donnees, on s'arrete des qu'aucune 268 // TOI n'a de valeurs apres curSample... 269 if (curSample <= 0) curSample = sStart-1; 270 if (curSample <= 0) curSample = fset.getSampleIndex()-1; 77 271 78 trigMask = x.trigMask; 79 infos = x.infos; 80 81 if (x.file) 82 file = new ArcheopsFile(*x.file); 83 else 84 file = NULL; 85 86 if (x.rawIter) { 87 rawIter = new TOIIter(*x.rawIter); 88 interp = new TOIInterpolator[infos.size()]; 89 for (int i=0; i<infos.size(); i++) 90 interp[i] = x.interp[i]; 91 } else { 92 rawIter = NULL; 93 interp = NULL; 94 } 272 if (curSample >= sEnd || archParam.acq.SN2MJD(curSample) >= mjdEnd) return false; 95 273 96 lastSample = x.lastSample; 97 maxLookAhead = x.maxLookAhead; 98 99 auxGPS = x.auxGPS; 100 if (auxGPS) auxGPS = auxGPS->clone(); 101 102 initDone = x.initDone; 103 underSample = x.underSample; 104 } 105 106 TOIIter::~TOIIter() { 107 delete file; 108 delete rawIter; 109 delete[] interp; 110 delete auxGPS; 111 } 112 113 #ifdef __MWERKS__ 114 #define filesep ':' 115 #else 116 #define filesep '/' 117 #endif 118 119 void TOIIter::Init() { 120 if (initDone) return; 121 initDone = true; 122 if (utcStart > 0) { 123 double t = (utcStart/24.) + archParam.acq.utcOrigin; 124 if (t > tStart) tStart=t; 125 } 126 if (utcEnd > 0) { 127 double t = (utcEnd/24.) + archParam.acq.utcOrigin; 128 if (t < tEnd) tEnd=t; 129 } 130 // On a soit un repertoire, soit une liste de fichiers.... 131 if (directory == "") { 132 if (files.empty()) { // Ni repertoire, ni fichiers 133 cerr << "toiiter : pas de repertoire, pas de fichiers" << endl; 134 exit(-1); 135 } else { 136 // On a deja une liste de fichiers 274 for (int i=0; i<request.size(); i++) 275 request[i].second->wontNeedEarlier(request[i].first, this, curSample); 276 277 bool endFound = false; 278 while(1) { 279 curSample++; 280 for (vector<TOIInfo>::iterator i = request.begin(); i != request.end(); i++) { 281 while ((*i).second->canGetValueLater(curSample, (*i).first)) { 282 if (! fset.next()) {endFound = true; break;} //return false; 283 } 137 284 } 138 } else { // On a un repertoire a explorer 139 // On cherche soit les fichiers dans le repertoire donne, soit des fichiers 140 // dans un sous-repertoire "arch-YY_MM_DD". Les fichiers ont un nom en 141 // "hYY_MM_DD-hh_mm_ss". 142 // Pour l'enregistreur de vol, les fichiers ont un nom en ARKxxxxxx.DAT 143 if (directory[directory.length()-1] != filesep) 144 directory += filesep; 145 DIR* dir = opendir(directory.c_str()); 146 struct dirent* ent; 147 while ((ent = readdir(dir)) != NULL) { 148 // si c'est un repertoire, avec un nom de jour, il faut l'explorer... 149 if (!strncmp(ent->d_name, "arch-", 5)) { 150 double mjd = ArcheopsFile::decodeMJD(ent->d_name+5) - 2./24.; // ENTIER + .5 en temps local! 151 if (mjd >= tStart - 1. && mjd <= tEnd) { 152 string direc2 = directory + ent->d_name + filesep; 153 DIR* dir2 = opendir(direc2.c_str()); 154 struct dirent* ent2; 155 while ((ent2 = readdir(dir2)) != NULL) { 156 if (*ent2->d_name == 'h') { 157 double mjd2 = ArcheopsFile::decodeMJD(ent->d_name+1) - 2./24.; 158 if (mjd2 >= tStart - 1./24. && mjd2 <= tEnd) { 159 files.insert(direc2 + ent2->d_name); 160 } 161 } 162 } 163 } 164 } else { 165 if (!isOnBoardRecorder && *ent->d_name == 'h') { 166 double mjd = ArcheopsFile::decodeMJD(ent->d_name+1) - 2./24.; // $CHECK$ UTCOffset 167 if (mjd >= tStart - 1./24. && mjd <= tEnd) { 168 files.insert(directory + ent->d_name); 169 } 170 } else if (isOnBoardRecorder) { 171 if (strncmp(ent->d_name, "ARK", 3) && strncmp(ent->d_name, "ark", 3)) continue; 172 char * sfx = ent->d_name + strlen(ent->d_name) - 4; 173 if (strcmp(sfx, ".DAT") && strcmp(sfx, ".dat")) continue; 174 files.insert(directory + ent->d_name); 175 } 176 } 285 bool found=false; 286 bool valuesAhead = false; 287 for (vector<TOIInfo>::iterator i = request.begin(); i != request.end(); i++) { 288 if (((*i).third & triggering) == 0) continue; 289 if ((*i).second->canGetValue(curSample, (*i).first)) {found=true;break;} 290 if ((*i).second->lastSampleNum((*i).first)>curSample) valuesAhead=true; 177 291 } 178 closedir(dir); 179 } 180 181 ScanFiles(); 182 183 curFile = files.begin(); 184 file = new ArcheopsFile((*curFile).c_str()); 185 cout << "opening file " << (*curFile).c_str() << endl; 186 187 // On avance jusqu'a avoir au moins un bloc param et un bloc reglage, 188 // car on ne peut rien faire sans... 189 // Si on a des donnees de l'enregistreur de vol, pas de bloc param, et 190 // on en simule un 191 double oldTStart = tStart; 192 tStart = -9.e99; // pour init, on accepte des blocs avant tstart.... 193 194 if (!file->lastParam()) { 195 if (isOnBoardRecorder) { 196 extern param_bolo parametr; 197 block_type_param block; 198 block.param = parametr; 199 valide_block((block_type_modele*)&block, block_param, 0); 200 file->forceBlock((block_type_modele*)&block); 201 } else { 202 file->nextBlock(block_param_mask); 203 } 204 } 205 if (!file->lastReglage()) file->nextBlock(block_reglage_mask); 206 207 // On cherche un bloc GPS pour avoir la correspondance timestamp/UTC. 208 // Pour le moment, on se fonde sur le premier bloc GPS. On pourra faire 209 // mieux en prenant le min de tous les delta_T, a condition d'avoir un 210 // peu plus de details sur la facon dont le GPS est lu. 211 212 if (archParam.acq.tBlock0 < 0) { 213 archParam.acq.tBlock0 = file->getStartMJD(); 214 215 file->pushMark(); 216 if (file->lastGPS() || file->nextBlock(block_gps_mask)) { 217 // le temps du bloc courant, en secondes 218 double dt = file->blockNum() * file->perBlock(); 219 archParam.acq.tBlock0 = file->getGPSMJD() - dt/86400.; 220 } else { // pas de bloc GPS... 221 archParam.acq.tBlock0 = file->getStartMJD(); 222 } 223 file->popMark(); 224 } 225 tStart = oldTStart; // on restaure 226 227 if (archParam.acq.perEch < 0) 228 archParam.acq.perEch = file->perEchant(); 229 230 bool hasInterp = false; 231 232 trigMask = 0; 233 for (vector<info>::iterator i = infos.begin(); i != infos.end(); i++) { 234 if ((*i).interpolated) hasInterp = true; 235 if ((*i).triggering) { 236 switch ((*i).kind) { 237 case boloMuV: 238 case boloMuV2: 239 case boloRawMuV: 240 case boloRawMuVCN: 241 trigMask |= block_bolo_mask; 242 break; 243 case boloMuV2T: 244 case boloRes: 245 case boloTemp: 246 trigMask |= block_bolo_mask | block_reglage_mask; 247 break; 248 case dilDAC: 249 case dilSwitch: 250 trigMask |= block_dilution_mask; 251 case boloGainAmpli: 252 case boloDACV: 253 case boloDACI: 254 trigMask |= block_reglage_mask; 255 break; 256 case gpsTime: 257 case longitude: 258 case latitude: 259 case altitude: 260 trigMask |= block_gps_mask; 261 break; 262 case azimuthBolo: 263 trigMask |= block_bolo_mask; 264 //file->needSSTProcessMask(SSTHandler::findPeriod); 265 //trigMask |= block_sst_mask; 266 break; 267 case sstStarCnt: 268 case sstStarZ: 269 case sstStarF: 270 case sstStarT: 271 file->needSSTProcessMask(SSTHandler::findStars); 272 trigMask |= block_sst_mask; 273 break; 274 case sstDiode: 275 case sstDiodeCN: 276 file->needSSTProcessMask(SSTHandler::permDiode); 277 trigMask |= block_sst_mask; 278 break; 279 case sstChannel: 280 case sstChannelCN: 281 trigMask |= block_sst_mask; 282 break; 283 case gyroRaw: 284 case gyroV: 285 trigMask |= block_gyro_mask; 286 break; 287 case gyroSpeed: 288 trigMask |= block_gyro_mask; // $CHECK$ + info to calibrate gyros 289 break; 290 case alphaRotAxis: 291 case deltaRotAxis: 292 case alphaSst: 293 case deltaSst: 294 case alphaFPAxis: 295 case deltaFPAxis: 296 case alphaBolo: 297 case deltaBolo: 298 trigMask |= block_bolo_mask; 299 //file->needSSTProcessMask(SSTHandler::findAxis); 300 //trigMask |= block_sst_mask; 301 break; 302 case alphaZenith: 303 case deltaZenith: 304 trigMask |= block_gps_mask; 305 break; 306 case voyantEVO: 307 case voyantEVF: 308 case commandeEV0: 309 case commandeEVF: 310 case commandeEVB: 311 case commandeEVV: 312 case pressEnt3He: 313 case debit3He: 314 case pressSor3He: 315 case pressEnt4He: 316 case debit4He: 317 case pressSor4He: 318 case pressAirVanne: 319 case pressPompChar: 320 case pressMembrane: 321 case pressExterne: 322 case tensPile10T: 323 case tensPileP18D: 324 case tensPileM18D: 325 case tensPile10B: 326 case tensPileP18B: 327 case tensPileM18B: 328 case tensPileCh: 329 case swPile5: 330 case swPile15: 331 case tempCaissH1: 332 case tempCaissH2: 333 case tempCaissB1: 334 case tempCaissB2: 335 case tempCaissTHe: 336 case tempCaissPiles: 337 case tempCaissDrv: 338 case pressHeBain: 339 case pressPirani: 340 trigMask |= block_dilution_mask; 341 break; 342 } 343 } 344 } 345 346 if (trigMask & (block_bolo_mask | block_sst_mask)) { 347 imes = 9999; 348 } else { 349 imes = 0; 350 } 351 352 if (hasInterp) { 353 rawIter = new TOIIter(*this); 354 interp = new TOIInterpolator[infos.size()]; 355 for (int i=0; i<infos.size(); i++) { 356 rawIter->infos[i].interpolated = false; 357 } 358 delete file; file = NULL; // on ne travaille plus sur le fichier directement... 359 } 360 } 361 362 void TOIIter::ScanFiles() { 363 file1stSamp.clear(); 364 cout << "Scanning all files" << endl; 365 // Petite astuce pour les STL non conformes comme celles de digital 366 // qui ne supportent pas files.erase(i) suivi de i++.... 367 set<string> copy = files; 368 for (set<string>::iterator i = copy.begin(); i != copy.end(); i++) { 369 ArcheopsFile fich((*i).c_str()); 370 if (fich.nextBlock()) { 371 file1stSamp[*i] = fich.blockNum()*72; // premier numsample 372 cout << "File " << *i << " 1st sample = " << fich.blockNum()*72 << endl; 373 } else { 374 cout << "File " << *i << " unrecoverable, skipping" << endl; 375 files.erase(*i); 376 } 377 } 378 cout << "Scan done" << endl; 379 380 // Et maintenant, on ne garde que ceux qui tombent dans l'intervalle... 381 copy = files; 382 string prev=""; 383 for (set<string>::iterator i = copy.begin(); i != copy.end(); i++) { 384 double smp = file1stSamp[*i]; 385 double t = archParam.acq.tBlock0 + smp * archParam.acq.perEch/86400.; 386 if (t>tEnd || smp>sEnd) { // premier echantillon apres tEnd 387 files.erase(*i); 388 prev = ""; 389 continue; 390 } 391 if (t<tStart || smp<sStart) { // premier echantillon avant tStart -> on vire le precedent si existe 392 if (prev != "") { 393 files.erase(prev); 394 } 395 } 396 prev = *i; 397 } 398 } 399 400 bool TOIIter::NextFile() { 401 if (rawIter) 402 return rawIter->NextFile(); 403 404 if (files.empty()) { 405 return false; 406 } else { 407 if (curFile == files.end()) return false; 408 curFile++; 409 if (curFile == files.end()) return false; 410 cout << "opening file " << (*curFile).c_str() << endl; 411 ArcheopsFile* newfile = new ArcheopsFile((*curFile).c_str()); 412 newfile->grabLastBlocs(*file); 413 delete file; 414 file = newfile; 415 return true; 416 } 417 } 418 419 bool TOIIter::Next() { 420 for (int ii=0; ii<underSample; ii++) 421 if (!Next1()) return false; 292 if (found) break; 293 if (endFound && !valuesAhead) return false; 294 } 422 295 return true; 423 296 } 424 297 425 bool TOIIter::Next1() { 426 if (!initDone) Init(); 427 while (1) { 428 if (!NextSample()) return false; // end of files 429 double t = getMJD(); 430 if (t < tStart) continue; 431 if (t > tEnd) return false; 432 return true; 433 } 434 } 435 436 bool TOIIter::NextSample() { 437 if (rawIter) { // Delegation pour interpolation 438 // Trouve prochain sample disponible 439 for (int k=0; k<2; k++) { 440 long smp = 2147483647L; 441 for (int i=0; i<infos.size(); i++) { 442 long ss = interp[i].nextSample(lastSample+1); 443 if (ss > 0 && ss < smp) smp=ss; 444 } 445 if (smp != 2147483647L) { 446 lastSample = smp; 447 break; 448 } 449 if (!fetchAhead()) // tout le monde etait en bout de course, 450 return false; // on lit un echantillon, ca suffit, d'ou le k<2 451 } 452 // Verifie que tous les interpolateurs ont assez de donnees pour 453 // trouver la valeur correspondante 454 for (int i=0; i<infos.size(); i++) { 455 //rif (infos[i].interpolated) 456 while (interp[i].needMoreDataFor(lastSample) && 457 rawIter->getSampleIndex() - lastSample < maxLookAhead) 458 if (!fetchAhead()) return false; 459 } 460 461 // On est pret... 462 return true; 463 } 464 465 // trigger sur info indexee dans bloc bolo, bloc gyro ou bloc sst ? 466 if (trigMask & (block_bolo_mask | block_sst_mask | block_gyro_mask )) { 467 imes++; 468 if (imes < file->nEchBlock()) return true; 469 imes = 0; 470 } 471 472 // soit pas d'info indexee, soit fin bloc courant... 473 while (1) { 474 if (file->nextBlock(trigMask)) { 475 while (file->sameBlockNumAhead()) { // tant que meme numero de bloc, on lit 476 if (!file->nextBlock()) { // fin de fichier ? 477 if (NextFile()) file->nextBlock(); // fichier suivant 478 else return false; // tout fini 479 } 480 } 481 return true; 482 } 483 if (!NextFile()) return false; 484 } 485 } 486 487 /* double TOIIter::getTime() { // MJD 488 // le temps du bloc courant, en secondes 489 double dt = file->blockNum() * file->perBlock(); 490 return tBlock0 + dt/86400. + imes*file->perEchant()/86400.; 491 } 492 */ 493 298 int TOIIter::getColTOI(TOI const& toi) { 299 for (int i=0; i<request.size(); i++) 300 if (request[i].first == toi) return i; 301 throw ArchExc("getColTOI : no such TOI " + toi.name); 302 } 303 494 304 bool TOIIter::canGetValue(int column) { 495 if (!initDone) Init(); 496 if (column < 0 || column >= infos.size()) return false; 497 TOIKind kind = infos[column].kind; 498 if (auxGPS && 499 (kind == longitude || kind == latitude || kind == altitude || kind == tsid || 500 kind == alphaZenith || kind == deltaZenith)) { 501 double dummy; 502 return auxGPS->getLocation(getMJD(), dummy, dummy, dummy) == 0; 503 } 504 if (rawIter) { 505 return interp[column].canGet(lastSample); 506 } 507 int index = infos[column].index; 508 switch (kind) { 509 case sampleNum: 510 case internalTime: 511 case mjd: 512 case mutc: 513 return true; 514 case boloMuV: 515 case boloMuV2: 516 case boloMuV2T: 517 case boloRes: 518 case boloRawMuVCN: 519 case boloTemp: 520 if (imes==0 && file->llastBolo()==NULL) return false; 521 return file->lastBolo() != NULL; 522 case boloRawMuV: 523 return file->lastBolo() != NULL; 524 case boloGainAmpli: 525 case boloDACV: 526 case boloDACI: 527 return file->lastReglage() != NULL; 528 case dilDAC: 529 case dilSwitch: 530 return file->lastDilution() != NULL; 531 case sstDiode: 532 case sstChannel: 533 case sstDiodeCN: 534 case sstChannelCN: 535 return file->lastSST() != NULL; 536 case sstStarCnt: 537 case sstStarZ: 538 case sstStarF: 539 case sstStarT:{ 540 if (file->lastSST() == NULL) return false; 541 int n = file->getNumbStar(imes); 542 return (n > 0 && index < n); 543 } 544 case gyroRaw: 545 case gyroV: 546 case gyroSpeed: 547 return (file->lastGyro() != NULL); 548 case gpsTime: 549 return file->hasGPSTime(); 550 case longitude: 551 case latitude: 552 case alphaZenith: 553 case deltaZenith: 554 return file->hasGPSPos(); 555 case altitude: 556 return file->hasGPSAlt(); 557 case tsid: 558 return file->hasGPSPos(); 559 case azimuthBolo: 560 case alphaRotAxis: 561 case deltaRotAxis: 562 case alphaFPAxis: 563 case deltaFPAxis: 564 case alphaBolo: 565 case deltaBolo: 566 return true; 567 //return (file->lastGPS() != NULL && file->lastSST() != NULL); 568 case alphaSst: 569 case deltaSst: 570 return false; 571 case voyantEVO: 572 case voyantEVF: 573 case commandeEV0: 574 case commandeEVF: 575 case commandeEVB: 576 case commandeEVV: 577 case pressEnt3He: 578 case debit3He: 579 case pressSor3He: 580 case pressEnt4He: 581 case debit4He: 582 case pressSor4He: 583 case pressAirVanne: 584 case pressPompChar: 585 case pressMembrane: 586 case pressExterne: 587 case tensPile10T: 588 case tensPileP18D: 589 case tensPileM18D: 590 case tensPile10B: 591 case tensPileP18B: 592 case tensPileM18B: 593 case tensPileCh: 594 case swPile5: 595 case swPile15: 596 case tempCaissH1: 597 case tempCaissH2: 598 case tempCaissB1: 599 case tempCaissB2: 600 case tempCaissTHe: 601 case tempCaissPiles: 602 case tempCaissDrv: 603 case pressHeBain: 604 case pressPirani: 605 return file->lastDilution() != NULL; 606 } 607 return false; 608 } 609 305 TOIInfo& info = request[column]; 306 return(info.second->canGetValue(curSample, info.first)); 307 } 610 308 611 309 double TOIIter::getValue(int column) { 612 if (!initDone) Init(); 613 if (column < 0 || column >= infos.size()) return -1; 614 TOIKind kind = infos[column].kind; 615 if (auxGPS && 616 (kind == longitude || kind == latitude || kind == altitude || kind == tsid)) { 617 double lat,lon,alt; 618 if (auxGPS->getLocation(getMJD(), lat, lon, alt)) return -99999; 619 if (kind == longitude) return lon; 620 if (kind == latitude) return lat; 621 if (kind == altitude) return alt; 622 if (kind == tsid) { 623 tSid.setLongitude(lon); 624 return tSid.getLST(getMJD()); 625 } 626 627 } 628 if (rawIter) { 629 if (infos[column].interpolated) 630 return interp[column].getIValue(lastSample); 631 else 632 return interp[column].getEValue(lastSample); 633 } 634 int index = infos[column].index; 635 switch (kind) { 636 case sampleNum: 637 return getSampleIndex(); 638 case internalTime: 639 return getSampleIndex() * archParam.acq.perEch; 640 case mjd: 641 return getMJD(); 642 case mutc: 643 return (getMJD()-archParam.acq.utcOrigin)*24.; 644 case boloMuV: 645 return file->getBoloMuV(index, imes); 646 case boloMuV2: 647 return file->getBoloMuV2(index, imes); 648 case boloRawMuV: 649 return file->getBoloRawMuV(index, imes); 650 case boloRawMuVCN: 651 return file->getBoloRawMuVCN(index, imes); 652 case boloGainAmpli: 653 return file->getGainAmpli(index); 654 case boloDACV: 655 return file->getDACV(index); 656 case boloDACI: 657 return file->getDACI(index); 658 case boloMuV2T: 659 return file->getBoloMuV2T(index, imes); 660 case boloRes: 661 return file->getBoloRes(index, imes); 662 case boloTemp: 663 return file->getBoloTemp(index, imes); 664 case dilDAC: 665 return file->getADCDil(index); 666 case dilSwitch: 667 return file->getSwitchDil(); 668 case sstDiode: 669 return file->getSSTSignal(index, imes); 670 case sstChannel: 671 return file->getSSTRawSignal(index, imes); 672 case sstDiodeCN: 673 return file->getSSTSignalCN(index, imes); 674 case sstChannelCN: 675 return file->getSSTRawSignalCN(index, imes); 676 case sstStarCnt: 677 return file->getNumbStar(imes); 678 case sstStarZ: 679 return file->getSSTStarZ(index, imes); 680 case sstStarF: 681 return file->getSSTStarF(index, imes); 682 case sstStarT: 683 return file->getSSTStarT(index, imes); 684 case gyroRaw: 685 return file->getGyroRaw(index, imes); 686 case gyroV: 687 return file->getGyroTens(index, imes); 688 case gyroSpeed: 689 return file->getGyroSpeed(index, imes); 690 case gpsTime: 691 return file->getGPSUTC(); 692 case longitude: 693 return file->getGPSLong(); 694 case latitude: 695 return file->getGPSLat(); 696 case altitude: 697 return file->getGPSAlt(); 698 case tsid: 699 tSid.setLongitude(file->getGPSLong()); 700 return tSid.getLST(getMJD()); 701 case azimuthBolo: 702 case alphaRotAxis: 703 case deltaRotAxis: 704 case alphaFPAxis: 705 case deltaFPAxis: 706 case alphaZenith: 707 case deltaZenith: 708 case alphaBolo: 709 case deltaBolo: { 710 double lat, lon; 711 if (auxGPS) { 712 double alti; 713 auxGPS->getLocation(getMJD(), lat, lon, alti); 714 } else { 715 lon = file->getGPSLong(); 716 lat = file->getGPSLat(); 717 } 718 tSid.setLongitude(lon); 719 double ts = tSid.getLST(getMJD()); 720 tempLocator.setEarthPos(lon, lat); 721 tempLocator.setTSid(ts); 722 if ((kind) == alphaRotAxis) return tempLocator.getAlphaZenith(); 723 if ((kind) == deltaRotAxis) return tempLocator.getDeltaZenith(); 724 if ((kind) == alphaZenith) return tempLocator.getAlphaZenith(); 725 if ((kind) == deltaZenith) return tempLocator.getDeltaZenith(); 726 if ((kind) == azimuthBolo) return tempLocator.getAzimutBolo(getSampleIndex(),index); 727 if ((kind) == alphaBolo) return tempLocator.getAlphaBolo(getSampleIndex(),index); 728 if ((kind) == deltaBolo) return tempLocator.getDeltaBolo(getSampleIndex(),index); 729 if ((kind) == alphaFPAxis) return tempLocator.getAlphaCenter(getSampleIndex()); 730 if ((kind) == deltaFPAxis) return tempLocator.getDeltaCenter(getSampleIndex()); 731 return 0; 732 } 733 case voyantEVO: 734 return voyant_EVO(file->lastDilution()); 735 case voyantEVF: 736 return voyant_EVF(file->lastDilution()); 737 case commandeEV0: 738 return commande_EVO(file->lastDilution()); 739 case commandeEVF: 740 return commande_EVF(file->lastDilution()); 741 case commandeEVB: 742 return commande_EVB(file->lastDilution()); 743 case commandeEVV: 744 return commande_EVV(file->lastDilution()); 745 case pressEnt3He: 746 return pression_entree_3He(file->lastDilution()); 747 case debit3He: 748 return debit_3He(file->lastDilution()); 749 case pressSor3He: 750 return pression_sortie_3He(file->lastDilution()); 751 case pressEnt4He: 752 return pression_entree_4He(file->lastDilution()); 753 case debit4He: 754 return debit_4He(file->lastDilution()); 755 case pressSor4He: 756 return pression_sortie_4He(file->lastDilution()); 757 case pressAirVanne: 758 return pression_air_vanne(file->lastDilution()); 759 case pressPompChar: 760 return pression_pompe_charbon(file->lastDilution()); 761 case pressMembrane: 762 return pression_membranne(file->lastDilution()); 763 case pressExterne: 764 return pression_externe(file->lastDilution()); 765 case tensPile10T: 766 return tension_pile_10T(file->lastDilution()); 767 case tensPileP18D: 768 return tension_pile_p18D(file->lastDilution()); 769 case tensPileM18D: 770 return tension_pile_m18D(file->lastDilution()); 771 case tensPile10B: 772 return tension_pile_10B(file->lastDilution()); 773 case tensPileP18B: 774 return tension_pile_p18B(file->lastDilution()); 775 case tensPileM18B: 776 return tension_pile_m18B(file->lastDilution()); 777 case tensPileCh: 778 return tension_pile_Ch(file->lastDilution()); 779 case swPile5: 780 return switch_pile_5(file->lastDilution()); 781 case swPile15: 782 return switch_pile_15(file->lastDilution()); 783 case tempCaissH1: 784 return temperature_caisson_haut1(file->lastDilution()); 785 case tempCaissH2: 786 return temperature_caisson_haut2(file->lastDilution()); 787 case tempCaissB1: 788 return temperature_caisson_bas1(file->lastDilution()); 789 case tempCaissB2: 790 return temperature_caisson_bas2(file->lastDilution()); 791 case tempCaissTHe: 792 return temperature_caisson_tube_helium(file->lastDilution()); 793 case tempCaissPiles: 794 return temperature_caisson_piles(file->lastDilution()); 795 case tempCaissDrv: 796 return temperature_caisson_driver_moteur(file->lastDilution()); 797 case pressHeBain: 798 return pression_helium_bain(file->lastDilution()); 799 case pressPirani: 800 return pression_pirani(file->lastDilution()); 801 } 802 return -1; 803 } 804 805 bool TOIIter::newValue(int column) { 806 if (!initDone) Init(); 807 if (column < 0 || column >= infos.size()) return false; 808 TOIKind kind = infos[column].kind; 809 if (auxGPS && 810 (kind == longitude || kind == latitude || kind == altitude)) { 811 return true; 812 } 813 if (rawIter) { 814 return interp[column].isNewValue(lastSample); 815 } 816 switch (kind) { 817 case sampleNum: 818 case internalTime: 819 case mjd: 820 case mutc: 821 case tsid: 822 return true; 823 case boloMuV: 824 case boloMuV2: 825 case boloMuV2T: 826 case boloRes: 827 case boloTemp: 828 return file->blockNum() == file->getBoloBlockNum(); 829 case boloRawMuV: 830 case boloRawMuVCN: 831 return file->blockNum() == file->getBoloBlockNum(); 832 case boloGainAmpli: 833 return file->blockNum() == file->getReglageBlockNum() && imes==0; 834 case boloDACI: 835 case boloDACV: 836 return file->blockNum() == file->getReglageBlockNum() && imes==0; 837 case dilDAC: 838 case dilSwitch: 839 return file->blockNum() == file->getDilutionBlockNum() && imes==0; 840 case sstChannel: 841 case sstDiode: 842 case sstStarCnt: 843 case sstStarZ: 844 case sstStarF: 845 case sstStarT: 846 return file->blockNum() == file->getSSTBlockNum(); 847 case sstChannelCN: 848 case sstDiodeCN: 849 return file->blockNum() == file->getSSTCompBlockNum(); 850 case gyroRaw: 851 case gyroV: 852 case gyroSpeed: 853 return file->blockNum() == file->getGyroBlockNum(); 854 case gpsTime: 855 return file->blockNum() == file->getGPSBlockNum() && imes==0; 856 case longitude: 857 return file->blockNum() == file->getGPSBlockNum() && imes==0; 858 case latitude: 859 return file->blockNum() == file->getGPSBlockNum() && imes==0; 860 case altitude: 861 return file->blockNum() == file->getGPSBlockNum() && imes==0; 862 case azimuthBolo: 863 case alphaBolo: 864 case deltaBolo: 865 case alphaZenith: 866 case deltaZenith: 867 case alphaFPAxis: 868 case deltaFPAxis: 869 return true; // $CHECK$ with SSTHandler 870 case alphaRotAxis: 871 return true; // $CHECK$ with SSTHandler 872 case deltaRotAxis: 873 return true; // $CHECK$ with SSTHandler 874 case voyantEVO: 875 case voyantEVF: 876 case commandeEV0: 877 case commandeEVF: 878 case commandeEVB: 879 case commandeEVV: 880 case pressEnt3He: 881 case debit3He: 882 case pressSor3He: 883 case pressEnt4He: 884 case debit4He: 885 case pressSor4He: 886 case pressAirVanne: 887 case pressPompChar: 888 case pressMembrane: 889 case pressExterne: 890 case tensPile10T: 891 case tensPileP18D: 892 case tensPileM18D: 893 case tensPile10B: 894 case tensPileP18B: 895 case tensPileM18B: 896 case tensPileCh: 897 case swPile5: 898 case swPile15: 899 case tempCaissH1: 900 case tempCaissH2: 901 case tempCaissB1: 902 case tempCaissB2: 903 case tempCaissTHe: 904 case tempCaissPiles: 905 case tempCaissDrv: 906 case pressHeBain: 907 case pressPirani: 908 return file->blockNum() == file->getDilutionBlockNum() && imes==0; 909 } 910 return false; 911 } 912 913 bool TOIIter::extendValue(int column) { 914 return (!infos[column].interpolated && !newValue(column)); 915 } 916 917 bool TOIIter::interpValue(int column) { 918 return (infos[column].interpolated && !newValue(column)); 919 } 920 921 bool TOIIter::isTrig(int column) { 922 if (column < 0 || column >= infos.size()) return false; 923 return infos[column].triggering; 924 } 925 926 927 TOIKind TOIIter::getKind(int column) { 928 if (column < 0 || column >= infos.size()) return (TOIKind)-1; 929 return infos[column].kind; 930 } 931 932 int TOIIter::getIndex(int column) { 933 if (column < 0 || column >= infos.size()) return (TOIKind)-1; 934 return infos[column].index; 935 } 936 937 int TOIIter::getColTOI(TOIKind kind, int index) { 938 for (int i=0; i<infos.size(); i++) 939 if (infos[i].kind == kind && infos[i].index == index) 940 return i; 941 return -1; 942 } 943 944 bool TOIIter::canGetTOI(TOIKind kind, int index) { 945 int col = getColTOI(kind, index); 946 if (col<0) return false; 947 return canGetValue(col); 948 } 949 950 double TOIIter::getTOI(TOIKind kind, int index) { 951 int col = getColTOI(kind, index); 952 if (col<0) return -9.e99; 953 return getValue(col); 954 } 955 956 957 int TOIIter::getBlockSampleIndex() { 958 return imes; 959 } 960 961 int TOIIter::getUnderSampling() { 962 return underSample; 963 } 964 965 int TOIIter::getSampleIndex() { 966 if (!initDone) Init(); 967 if (file) { 968 return file->blockNum() * file->nEchBlock() + imes; 969 } else { 970 return lastSample; 971 } 972 } 973 974 double TOIIter::getMJD() { 975 if (!initDone) Init(); 976 int sample = getSampleIndex(); 977 return archParam.acq.tBlock0 + sample*archParam.acq.perEch/86400.; 978 } 979 980 bool TOIIter::fetchAhead() { // Seulement si delegation 981 if (!rawIter) return false; 982 if (!rawIter->Next()) return false; 983 long sample = rawIter->getSampleIndex(); 984 for (int i=0; i<infos.size(); i++) { 985 if (rawIter->canGetValue(i) && rawIter->newValue(i)) { 986 interp[i].enterValue(rawIter->getValue(i), sample); 987 } 988 } 989 return true; 990 } 991 992 block_type_param* TOIIter::lastParam() { 993 if (!initDone) Init(); 994 if (file) return file->lastParam(); 995 else return rawIter->lastParam(); 996 } 997 998 310 TOIInfo& info = request[column]; 311 return(info.second->getValue(curSample, info.first)); 312 } 313 314 bool TOIIter::canGetValue(TOI const& toi) { 315 return canGetValue(getColTOI(toi)); 316 } 317 318 double TOIIter::getValue(TOI const& toi) { 319 return getValue(getColTOI(toi)); 320 } 321 -
trunk/Poubelle/archTOI.old/toiiter.h
r436 r534 1 1 // toiiter.h 2 // Eric Aubourg CEA/DAPNIA/SPP juillet19992 // Eric Aubourg CEA/DAPNIA/SPP septembre 1999 3 3 4 4 #ifndef TOIITER_H 5 5 #define TOIITER_H 6 6 7 8 7 #include <vector> 8 #include <list> 9 9 #include <set> 10 10 #include <map> 11 11 #include <string> 12 #include "archeopsfile.h"13 #include "auxgps.h"14 #include "tsid.h"15 12 16 enum TOIKind { 17 sampleNum, // Numero d''echantillon (timer interne transputer) 18 internalTime, // temps transputer depuis debut manip, en secondes. 19 mjd, // UTC (en jours, MJD = JD - 2450000). 20 mutc, // UTC en heure, avec soustraction d'origine 21 boloMuV, // tension en microVolts, filtree avec filtre carre indexe par bolometre 22 boloMuV2, // tension en microVolts, avec soustraction offset filtre 23 boloRawMuV, // tension brute en microVolts, non filtree indexe par bolometre, sans chgt signe 24 boloTemp, // Kelvins, need R(T) -> N/A 25 boloDACV, // tension de reference du DAC (microVolts) 26 boloDACI, // courant (microAmps) 27 boloRawMuVCN, // compression noise on bolo (microVolts), no filter 28 boloMuV2T, // total, microVolts, avec consigne DAC 29 boloRes, // Resistance, ohms 30 boloGainAmpli, // 31 dilDAC, // dilution DAC, index = 0-47 32 dilSwitch, // dilution, mot de 32 bits 33 serviceTemp, // service temperature, K 34 sstDiode, // signal brut SST, indice = diode, 0-45 35 sstChannel, // signal brut SST, indice = canal, 0-47 36 sstDiodeCN, // compression noise 37 sstChannelCN, // compression noise 38 sstStarCnt, // nombre d''etoiles detectees durant ce sample 39 sstStarZ, // numero de diode d''une eventuelle etoile, i=etoile 0..n 40 sstStarF, // flux d''une eventuelle etoile, <0 si moins de i+1 etoiles 41 sstStarT, // temps d''une eventuelle etoile, <0 si moins de i+1 etoiles 42 gyroRaw, // valeur brute du gyro, index = 0,1,2 43 gyroV, // tension gyro, V, index = 0,1,2 44 gyroSpeed, // vitesse gyro, deg/s, index = 0,1,2, calibree... 45 gpsTime, // temps fourni par GPS 46 longitude, // position ballon, degrees +=EST 47 latitude, // position ballon, degrees +=NORD 48 altitude, // position ballon, m 49 tsid, // temps sideral en secondes 50 azimuthBolo, // azimut 51 alphaRotAxis, // 52 deltaRotAxis, // 53 alphaZenith, // 54 deltaZenith, // 55 alphaSst, // 56 deltaSst, // 57 alphaFPAxis, // 58 deltaFPAxis, // 59 alphaBolo, // sur le ciel, indexe par bolometre 60 deltaBolo, // sur le ciel, indexe par bolometre 61 voyantEVO, 62 voyantEVF, 63 commandeEV0, 64 commandeEVF, 65 commandeEVB, 66 commandeEVV, 67 pressEnt3He, 68 debit3He, 69 pressSor3He, 70 pressEnt4He, 71 debit4He, 72 pressSor4He, 73 pressAirVanne, 74 pressPompChar, 75 pressMembrane, 76 pressExterne, 77 tensPile10T, 78 tensPileP18D, 79 tensPileM18D, 80 tensPile10B, 81 tensPileP18B, 82 tensPileM18B, 83 tensPileCh, 84 swPile5, 85 swPile15, 86 tempCaissH1, 87 tempCaissH2, 88 tempCaissB1, 89 tempCaissB2, 90 tempCaissTHe, 91 tempCaissPiles, 92 tempCaissDrv, 93 pressHeBain, 94 pressPirani 95 }; 13 #include "toiabsorber.h" 14 #include "requesthandler.h" 15 #include "archfileset.h" 96 16 97 class TOIInterpolator;17 class AuxGPS; 98 18 99 class TOIIter { 19 template <class T1, class T2, class T3> 20 struct triple { 21 T1 first; 22 T2 second; 23 T3 third; 24 triple() : first(T1()), second(T2()), third(T3()) {} 25 triple (const T1& a, const T2& b, const T3& c) : 26 first (a), second (b), third (c) {} 27 }; 28 29 class TOIIter : public TOIAbsorber /*, public RequestHandler*/ { 100 30 public: 101 TOIIter(TOIIter const&); // $CHECK$ prevoir operator = ? 102 ~TOIIter(); 103 bool Next(); 31 TOIIter(); 32 // ~TOIIter(); 33 34 void readReq(istream& s); 35 void defaultInclude(); 36 37 bool processRequest(string line); 38 void registerReqHandler(RequestHandler*); 39 40 virtual bool processTOIReq(TOI& toi, string); 41 virtual bool processOption(string keyw, string args); 42 43 void addDirectory(string); 44 void addFile(string); 45 //void useAuxGPS(AuxGPS* gps); 104 46 105 bool canGetValue(int column); // data is available for that... 106 double getValue(int column); 107 bool newValue(int column); // a juste change ? 108 bool extendValue(int column); // une valeur plus ancienne, etendue ? 109 bool interpValue(int column); // une valeur interpolee avec valeur future ? 110 bool isTrig(int column); 111 TOIKind getKind(int column); 112 int getIndex(int column); // si plusieurs, exemple, tension bolo 2 47 void setMJDInterval(double tStart, double tEnd); 48 void setUTCInterval(double tStart, double tEnd); 49 void setSNInterval(long sStart, long sEnd); 50 void setUnderSample(int n); 51 int getUnderSample(); 52 53 void addTOI(TOI& toi, bool triggering=true); 54 55 void init(); 56 57 bool next(); 113 58 114 bool canGetTOI(TOIKind kind, int index=0); 115 double getTOI(TOIKind kind, int index=0); 59 long getSampleNum(); 60 bool canGetValue(int column); // data is available for that... 61 double getValue(int column); 62 bool canGetValue(TOI const& toi); // data is available for that... 63 double getValue(TOI const& toi); 64 bool newValue(int column); // a juste change ? 65 bool extendValue(int column); // une valeur plus ancienne, etendue ? 66 bool interpValue(int column); // une valeur interpolee avec valeur future ? 67 bool isTrig(int column); 68 TOI getKind(int column); 69 70 ArchFileSet& getFSet() {return fset;} 71 72 protected: 73 ArchFileSet fset; 74 list<RequestHandler*> handlers; 75 enum {triggering = 1}; 76 typedef ::triple<TOI,TOIProducer*,long> TOIInfo; 77 vector<TOIInfo> request; 116 78 79 double mjdStart, mjdEnd; // MJD 80 double utcStart, utcEnd; // UTC, will be converted towards tStart tEnd at init 81 long sStart, sEnd; // samplenum 82 83 int underSample; 84 long curSample; 117 85 118 int getBlockSampleIndex(); // numero d''echantillon dans dernier bloc bolo 119 int getSampleIndex(); // numero d''echantillon 120 int getUnderSampling(); 121 double getMJD(); 86 int getColTOI(TOI const& toi); 87 bool next1(); 122 88 123 block_type_param* lastParam(); 124 block_type_journal* lastJournal(); 125 block_type_reglage* lastReglage(); 126 block_type_dilution* lastDilution(); 127 block_type_gps* lastGPS(); 128 block_type_une_periode* lastUnePeriode(); 129 block_type_synchro_sol* lastSynchroSol(); 130 block_type_pointage_sol* lastPointageSol(); 131 block_type_bolo* lastBolo(); 132 block_type_gyro* lastGyro(); 133 block_type_sst* lastSST(); 134 block_type_bolo_comprime* lastBoloComp(); 135 block_type_gyro_comprime* lastGyroComp(); 136 block_type_sst_comprime* lastSSTComp(); 137 138 ArcheopsFile* currentFile() {if (!initDone) Init(); return file;} 139 140 protected: 141 TOIIter(); 142 void Init(); // After setting the options, opens the first file. 143 void ScanFiles(); // Parcourt tous les fichiers, cherche le premier echantillon... 144 145 bool Next1(); 146 bool NextSample(); // no test of trange 147 bool NextFile(); 148 149 ArcheopsFile* file; 150 string directory; // If directory scanning 151 set<string> files; // list of files to be read... 152 map<string, long> file1stSamp; // premier echantillon de chaque fichier 153 set<string>::iterator curFile; 154 bool isOnBoardRecorder; 155 156 int imes; 157 158 double tStart, tEnd; // MJD 159 double utcStart, utcEnd; // UTC, will be converted towards tStart tEnd at init 160 long sStart, sEnd; // samplenum 161 162 //double tBlock0; // MJD du bloc numero zero... 163 //double perEch; // periode d''echantillonage en secondes 164 165 struct info { 166 TOIKind kind; 167 int index; 168 bool triggering; 169 bool interpolated; 170 }; 171 172 int getColTOI(TOIKind kind, int index=0); 173 174 long trigMask; 175 176 vector<info> infos; 177 178 friend class TOISvr; 179 180 // Gestion de l''interpolation, par delegation a un autre iterateur 181 TOIIter* rawIter; // iterateur sans interpolation, qui avance avec retard 182 // en bufferisant les valeurs. S''il existe, on lui delegue 183 // toutes les operations agissant sur le fichier. 184 TOIInterpolator* interp; // interpolateurs pour stocker les valeurs 185 long lastSample; // last interpolated sample 186 long maxLookAhead; 187 bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs 188 189 AuxGPS* auxGPS; 190 TSid tSid; 191 192 int underSample; 193 194 private: 195 bool initDone; 89 private: 90 bool initDone; 91 bool incDone; 196 92 }; 197 93 -
trunk/Poubelle/archTOI.old/toisvr.cc
r465 r534 162 162 else tsttoi(alphaBolo) 163 163 else tsttoi(deltaBolo) 164 else tsttoi(voyantEVO)165 else tsttoi(voyantEVF)166 else tsttoi(commandeEV0)167 else tsttoi(commandeEVF)168 else tsttoi(commandeEVB)169 else tsttoi(commandeEVV)170 else tsttoi(pressEnt3He)171 else tsttoi(debit3He)172 else tsttoi(pressSor3He)173 else tsttoi(pressEnt4He)174 else tsttoi(debit4He)175 else tsttoi(pressSor4He)176 else tsttoi(pressAirVanne)177 else tsttoi(pressPompChar)178 else tsttoi(pressMembrane)179 else tsttoi(pressExterne)180 else tsttoi(tensPile10T)181 else tsttoi(tensPileP18D)182 else tsttoi(tensPileM18D)183 else tsttoi(tensPile10B)184 else tsttoi(tensPileP18B)185 else tsttoi(tensPileM18B)186 else tsttoi(tensPileCh)187 else tsttoi(swPile5)188 else tsttoi(swPile15)189 else tsttoi(tempCaissH1)190 else tsttoi(tempCaissH2)191 else tsttoi(tempCaissB1)192 else tsttoi(tempCaissB2)193 else tsttoi(tempCaissTHe)194 else tsttoi(tempCaissPiles)195 else tsttoi(tempCaissDrv)196 else tsttoi(pressHeBain)197 else tsttoi(pressPirani)198 164 else { 199 165 // cerr << "*Warning, unrecognized TOI " << line << endl; -
trunk/Poubelle/archTOI.old/transfelec.cc
r394 r534 1 1 #include "transfelec.h" 2 2 3 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 3 4 4 5 // Parametres du circuit electrique de lecture SST -
trunk/Poubelle/archTOI.old/transfelec.h
r394 r534 3 3 4 4 //#include <math.h> 5 6 // D. Yvon, CE Saclay, DAPNIA/SPP, 08/99 7 5 8 6 9 #ifdef __MWERKS__
Note:
See TracChangeset
for help on using the changeset viewer.