Changeset 612 in Sophya for trunk/Poubelle
- Timestamp:
- Nov 22, 1999, 10:43:44 AM (26 years ago)
- Location:
- trunk/Poubelle/archTOI.old
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Poubelle/archTOI.old/archfileset.cc
r534 r612 155 155 if (fich.nextBlock()) { 156 156 file1stSamp[*i] = fich.blockNum()*72; // premier numsample 157 cout << "File " << *i << " 1st sample = " << fich.blockNum()*72 << endl; 157 cout << "File " << *i << " 1st sample = " << fich.blockNum()*72 158 << " UTC " << archParam.acq.SN2UTC(fich.blockNum()*72) << endl; 158 159 } else { 159 160 cout << "File " << *i << " unrecoverable, skipping" << endl; -
trunk/Poubelle/archTOI.old/archparam.cc
r534 r612 21 21 ArchParam::SSTParam::SSTParam() 22 22 : soustPente (true), 23 analFine ( false)23 analFine (true) 24 24 {} 25 25 -
trunk/Poubelle/archTOI.old/archvers.h
r534 r612 2 2 #define ARCHVERS_H 3 3 4 #define ARCHTOI_VERS " 2.0"5 #define ARCHTOI_TAG "V_ 011199"4 #define ARCHTOI_VERS "3.0" 5 #define ARCHTOI_TAG "V_191199" 6 6 7 7 #endif -
trunk/Poubelle/archTOI.old/gondolageom.cc
r581 r612 4 4 #include <math.h> 5 5 #include "gondolageom.h" 6 7 6 8 extern "C" { 7 9 #include "aa_hadec.h" … … 27 29 28 30 29 GondolaGeom::GondolaGeom() { 31 GondolaGeom::GondolaGeom() 32 : fit(200, 2) 33 { 30 34 azPend = 0; 31 35 angPend = 0; … … 51 55 if (nstars<0) { 52 56 nstars = 0; 53 saz=staz=st=st2=0;57 fit.clear(); 54 58 } 55 59 … … 61 65 if (azCor - az0 > 180) azCor -= 360; 62 66 if (azCor - az0 < -180) azCor += 360; 63 saz += azCor; 64 staz += azCor*deltasn; 65 st += deltasn; 66 st2 += deltasn*deltasn; 67 68 fit.addData(deltasn, azCor); 67 69 } 68 70 … … 70 72 int GondolaGeom::solveStars() { 71 73 if (nstars<2) return -1; 72 staz /= nstars; 73 st /= nstars; 74 saz /= nstars; 75 st2 /= nstars; 76 double a = (staz - st*saz) / (st2 - st*st); 77 double b = saz - a*st; 78 79 nstars = -1; 80 81 azimut = b; 74 fit.doFit(); 75 azimut = fit.value(0); 82 76 83 77 if (azimut > 360) azimut -= 360; 84 78 if (azimut < 0) azimut += 360; 85 79 80 nstars = -1; 81 86 82 return 0; 87 83 } -
trunk/Poubelle/archTOI.old/gondolageom.h
r581 r612 4 4 #ifndef GONDOLAGEOM_H 5 5 #define GONDOLAGEOM_H 6 7 #include "polfitclip.h" 6 8 7 9 class GondolaGeom { … … 59 61 60 62 long nstars; 61 double saz,staz,st,st2;62 63 double az0; 64 65 PolFitClip fit; 63 66 }; 64 67 -
trunk/Poubelle/archTOI.old/starmatcher.cc
r581 r612 11 11 12 12 #define STARDUMP 13 14 #define TEchan TFin 13 15 14 16 #include <math.h> … … 271 273 272 274 double da = azim-az; if (da>360) da -= 360; 273 if (da < -0.6 || da > 0.4) continue; 275 // if (da < -0.6 || da > 0.4) continue; // appropriate for TEchan 276 if (da < -0.7 || da > 0.3) continue; // appropriate for TFin 274 277 double elv0 = elv - GondolaGeom::sstPixelHeight * lastStar.NoDiode; 275 278 if (fabs(elv0-GondolaGeom::elevSST0) > 0.25) continue; // Might be too strong … … 568 571 int StarMatcher::getPendulInfo(double sampleNum, pendulInfo& info) { 569 572 573 static double lastSN = -1; 574 static pendulInfo lastPendul; 575 576 if (sampleNum == lastSN) { 577 info = lastPendul; 578 return 0; 579 } 580 570 581 PolFitClip2 fitPendul(30,2); 571 582 572 583 map<double, pendulInfo>::iterator i = pendulInfos.lower_bound(sampleNum); 573 584 if (i == pendulInfos.begin() && (*i).second.SN >= sampleNum) return -1; 574 if (i == pendulInfos.end() && (*i).second.SN <= sampleNum) return -1; 575 576 if ((*i).second.SN > sampleNum) i--; 585 if (i == pendulInfos.end()) return -1; 586 map<double, pendulInfo>::iterator last = pendulInfos.end(); 587 if (last == pendulInfos.begin()) return -1; 588 last--; 589 if (i == last && (*i).second.SN <= sampleNum) return -1; 590 591 if ((*i).second.SN > sampleNum) i--; // i just before us... 592 593 //$CHECK$ reject if too large a gap... 594 if (sampleNum - (*i).second.SN > 1000) return -1; 595 last = i; last++; 596 if ((*last).second.SN - sampleNum > 1000) return -1; 577 597 578 598 int nn=0; 579 599 double aziprev=0, azicur=0, azi0=0; 580 600 for (map<double, pendulInfo>::iterator ii=i; ii != pendulInfos.begin(); ii--) { 581 nn++;582 601 pendulInfo inf1 = (*ii).second; 602 if (fabs(inf1.SN - sampleNum) > 1000) continue; 583 603 aziprev = azicur; 584 604 azicur = inf1.azPendul; 605 nn++; 585 606 if (nn==1) azi0 = azicur; 586 607 if (nn>1 && azicur - aziprev > 180) azicur -= 360; … … 593 614 if (i != pendulInfos.end()) i++; 594 615 for (map<double, pendulInfo>::iterator ii=i; ii != pendulInfos.end(); ii++) { 595 nn++;596 616 pendulInfo inf1 = (*ii).second; 617 if (fabs(inf1.SN - sampleNum) > 1000) continue; 597 618 aziprev = azicur; 598 619 azicur = inf1.azPendul; 620 nn++; 599 621 if (nn>1 && azicur - aziprev > 180) azicur -= 360; 600 622 if (nn>1 && azicur - aziprev < -180) azicur += 360; … … 610 632 if (info.azPendul < 0) info.azPendul += 360; 611 633 info.angPendul = fitPendul.valueY(sampleNum); 634 635 lastSN = sampleNum; 636 lastPendul = info; 637 612 638 return 0; 613 639 } 614 615 #if 0616 617 int StarMatcher::getPendulInfo(double sampleNum, pendulInfo& info) {618 static double* sn = ::vector(1, 100);619 static double* aziP = ::vector(1, 100);620 static double* ampP = ::vector(1, 100);621 static double* sig = ::vector(1, 100);622 static double* aAzi = ::vector(1, 3);623 static double* aAmp = ::vector(1, 3);624 static int* ia = ::ivector(1,3);625 static double** cov = ::matrix(1,3,1,3);626 int ndata = 0;627 map<double, pendulInfo>::iterator i = pendulInfos.lower_bound(sampleNum);628 if (i == pendulInfos.begin() && (*i).second.SN >= sampleNum) return -1;629 if (i == pendulInfos.end() && (*i).second.SN <= sampleNum) return -1;630 631 if ((*i).second.SN > sampleNum) i--;632 633 int nn=0;634 for (map<double, pendulInfo>::iterator ii=i; ii != pendulInfos.begin(); ii--) {635 nn++;636 ndata++;637 pendulInfo inf1 = (*ii).second;638 sn[ndata] = inf1.SN;639 ampP[ndata] = inf1.angPendul;640 aziP[ndata] = inf1.azPendul;641 int prev = ndata-1;642 if (ndata>1 && aziP[ndata] - aziP[prev] > 180) aziP[ndata] -= 360;643 if (ndata>1 && aziP[ndata] - aziP[prev] < -180) aziP[ndata] += 360;644 sig[ndata] = 1;645 if (nn>=50) break;646 }647 648 nn=0;649 if (i != pendulInfos.end()) i++;650 for (map<double, pendulInfo>::iterator ii=i; ii != pendulInfos.end(); ii++) {651 nn++;652 ndata++;653 pendulInfo inf1 = (*ii).second;654 sn[ndata] = inf1.SN;655 ampP[ndata] = inf1.angPendul;656 aziP[ndata] = inf1.azPendul;657 int prev = ndata-1;658 if (nn==1) prev=1;659 if (ndata>1 && aziP[ndata] - aziP[prev] > 180) aziP[ndata] -= 360;660 if (ndata>1 && aziP[ndata] - aziP[prev] < -180) aziP[ndata] += 360;661 sig[ndata] = 1;662 if (nn>=50) break;663 }664 665 if (ndata < 3) return -1;666 667 ia[1] = ia[2] = ia[3] = 1;668 double chi2;669 try {670 lfit(sn, aziP, sig, ndata, aAzi, ia, 3, cov, &chi2, polfunc);671 lfit(sn, ampP, sig, ndata, aAmp, ia, 3, cov, &chi2, polfunc);672 } catch(string st) {673 return -1;674 }675 676 info.SN = sampleNum;677 info.azPendul = polval(sampleNum, aAzi, 3);678 if (info.azPendul > 360) info.azPendul -= 360;679 if (info.azPendul < 0) info.azPendul += 360;680 info.angPendul = polval(sampleNum, aAmp, 3);681 return 0;682 }683 684 #endif685 686 #if 0687 688 int StarMatcher::getPendulInfo(double sampleNum, pendulInfo& info) {689 map<double, pendulInfo>::iterator i = pendulInfos.lower_bound(sampleNum);690 if (i == pendulInfos.begin() && (*i).second.SN >= sampleNum) return -1;691 if (i == pendulInfos.end() && (*i).second.SN <= sampleNum) return -1;692 693 if ((*i).second.SN > sampleNum) i--;694 pendulInfo inf1 = (*i).second;695 i++;696 pendulInfo inf2 = (*i).second;697 698 info.SN = sampleNum;699 if (inf2.azPendul - inf1.azPendul > 180) inf2.azPendul -= 360;700 if (inf2.azPendul - inf1.azPendul < -180) inf2.azPendul += 360;701 info.azPendul = inf1.azPendul + (inf2.azPendul - inf1.azPendul) * (sampleNum - inf1.SN) / (inf2.SN - inf1.SN);702 if (info.azPendul<0) info.azPendul += 360;703 if (info.azPendul>360) info.azPendul += 360;704 info.angPendul = inf1.angPendul + (inf2.angPendul - inf1.angPendul) * (sampleNum - inf1.SN) / (inf2.SN - inf1.SN);705 return 0;706 }707 708 #endif709 640 710 641 -
trunk/Poubelle/archTOI.old/toiboloproducer.cc
r555 r612 5 5 #include "archexc.h" 6 6 #include "requesthandler.h" 7 #include "polfitclip.h" 7 8 8 #define filt2"boloMuV"9 #define boloMuV "boloMuV" 9 10 10 11 11 12 TOIBoloProducer::TOIBoloProducer() { 12 possibleTOIs.insert(TOI( filt2, TOI::all, "", "microVolts"));13 possibleTOIs.insert(TOI(boloMuV, TOI::all, "linfilt sqfilt", "microVolts")); 13 14 } 14 15 16 // No option == linfilt 17 15 18 string TOIBoloProducer::getName() { 16 return("TOIBoloProducer 1. 0");19 return("TOIBoloProducer 1.1"); 17 20 } 21 22 int TOIBoloProducer::filtHalfRange = 20; 18 23 19 24 … … 21 26 if (source->canGetValue(sampleNum-1, toi)) { 22 27 value = (value + source->getValue(sampleNum-1, toi))/2.; 23 TOI toi2 = toi; 24 toi2.name = filt2; 28 29 //TOI toi2 = toi; 30 //toi2.name = boloMuV; 31 32 TOI toi2(boloMuV, toi.index, "sqfilt", toi.unit); 25 33 computedValue(toi2, sampleNum, value); 34 } 35 36 // $CHECK$ possible optimization : keep fit for several successive values 37 38 if (source->canGetValue(sampleNum-2*filtHalfRange, toi)) { 39 PolFitClip fit(2*filtHalfRange,1); 40 int s = sampleNum % 2 ? 1 : -1; 41 for (int i=0; i<2*filtHalfRange-1; i++) { 42 fit.addData(sampleNum - i, 43 s*(source->getValue(sampleNum - i, toi) - source->getValue(sampleNum - i -1, toi))/2); 44 s = -s; 45 } 46 fit.doFit(); 47 double y = source->getValue(sampleNum - filtHalfRange, toi); 48 s = sampleNum % 2 ? 1 : -1; 49 y =y - s*fit.value(sampleNum - filtHalfRange); 50 TOI toi2(boloMuV, toi.index, "linfilt", toi.unit); 51 if (isProducing(toi2)) 52 computedValue(toi2, sampleNum - filtHalfRange, y); 53 TOI toi3(boloMuV, toi.index, "", toi.unit); 54 if (isProducing(toi3)) 55 computedValue(toi3, sampleNum - filtHalfRange, y); 26 56 } 27 57 } 28 58 29 59 set<TOI> TOIBoloProducer::reqTOIFor(TOI const& toi) { 30 TOI toi2 = toi;31 60 set<TOI> t; 32 if (toi.name == filt2) { 33 toi2.name = "boloRawMuV"; 61 if (toi.name == boloMuV) { 62 TOI toi2("boloRawMuV", toi.index); 63 //toi2.name = "boloRawMuV"; 34 64 t.insert(toi2); 35 65 } else { -
trunk/Poubelle/archTOI.old/toiboloproducer.h
r534 r612 18 18 virtual set<TOI> reqTOIFor(TOI const&); 19 19 virtual void propagateLowBound(TOI const&, long sampleNum); 20 21 static int filtHalfRange; 20 22 }; 21 23 -
trunk/Poubelle/archTOI.old/toiiter.cc
r555 r612 205 205 processRequest("#UTCORIGIN 1376.5"); 206 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"); 207 processRequest("#COMMENT Archtoi V3 -- novembre 1999 -- Eric Aubourg CEA/DAPNIA"); 216 208 } 217 209 … … 233 225 } 234 226 235 fset.setMJDRange(mjdStart-0.01, mjdEnd+0.01); 236 fset.setSNumRange(sStart-1000, sEnd+1000); 227 // Let's add some time on each side, 30 seconds should be ok, at least 228 // for Trapani 229 230 double delT = 30. / 86400; 231 long delSN = long(delT / archParam.acq.perEch); 232 233 fset.setMJDRange(mjdStart-delT, mjdEnd+delT); 234 fset.setSNumRange(sStart-delSN, sEnd+delSN); 237 235 238 236 fset.init(); … … 267 265 // Si on a epuise les fichiers de donnees, on s'arrete des qu'aucune 268 266 // TOI n'a de valeurs apres curSample... 269 if (curSample <= 0) curSample = sStart-1; 267 if (curSample <= 0) curSample = sStart-1; 268 if (curSample <= 0) { 269 long sn = archParam.acq.MJD2SN(mjdStart) - 1; 270 if (sn > curSample) curSample = sn; 271 } 272 270 273 if (curSample <= 0) curSample = fset.getSampleIndex()-1; 271 274 … … 288 291 } 289 292 bool found=false; 290 bool valuesAhead = false;293 //bool valuesAhead = false; 291 294 for (vector<TOIInfo>::iterator i = request.begin(); i != request.end(); i++) { 292 295 if (((*i).third & triggering) == 0) continue; 293 296 if ((*i).second->canGetValue(curSample, (*i).first)) {found=true;break;} 294 if ((*i).second->lastSampleNum((*i).first)>curSample) valuesAhead=true;297 //if ((*i).second->lastSampleNum((*i).first)>curSample) valuesAhead=true; 295 298 } 296 299 if (found) break; 297 if (endFound && !valuesAhead) return false;300 if (endFound && curSample >= fset.getSampleIndex()+71) return false; 298 301 } 299 302 return true;
Note:
See TracChangeset
for help on using the changeset viewer.