// Utilisation de SOPHYA pour faciliter les tests ... #include "sopnamsp.h" #include "machdefs.h" /* ---------------------------------------------------------- Projet BAORadio/PAON4 - (C) LAL/IRFU 2008-2015 visi2ntac: programme de lecture des fichiers matrices de visibilites de PAON4, remplissage et ecriture d'un DataTable avec la puissance des 8 voies en fonction du temps R. Ansari, J.E. Campagne, C. Magneville - LAL/Irfu ---------------------------------------------------------- */ // include standard c/c++ #include #include #include #include #include #include #include "pexceptions.h" #include "tvector.h" #include "fioarr.h" // #include "tarrinit.h" #include "ntuple.h" #include "datatable.h" #include "histinit.h" #include "matharr.h" #include "timestamp.h" #include // include sophya mesure ressource CPU/memoire ... #include "resusage.h" #include "ctimer.h" #include "timing.h" // include lecteur de fichiers visibilites #include "visip4reader.h" //--------------------------- Fonctions de ce fichier ------------------- int Usage(bool fgshort=true); // int DecodeArgs(int narg, char* arg[]); /* --Fonction-- */ int Usage(bool fgea) { cout << " --- visi2ntac.cc : Read PPF files produced by mfacq time-frequency\n" << endl; if (fgea) cout << " visi2ntac: Missing or wrong argument ! " << endl; cout << " Usage: visi2ntac InPathBAO5 InPathBAO6 Imin,Imax OutPPFFile [Jf1,Jf2] [DeltaIAvg] [PrtLev=0] \n" << " InPathBAO5/6: path for input vismtx_J_iii.ppf on bao5/6 \n" << " Imin,Imax : read files for Imin<=iii<=Imax iii+=step \n" << " OutPPFFile: Output PPF file name \n" << " Jf1,Jf2: frequency index (Jf1<=f<=Jf2) range for power integration, def=768,2304 \n" << " DeltaIAvg: compute average power every DeltaI input vismtx files, def=1 \n"<1)&&(strcmp(arg[1],"-h")==0)) return Usage(false); if (narg<5) return Usage(true); string path5 = arg[1]; string path6 = arg[2]; int Imin,Imax,Istep=1; sscanf(arg[3],"%d,%d",&Imin,&Imax); Istep=1; string outfile=arg[4]; // frequency range definition sa_size_t JFmin=768,JFmax=2304; int jf1,jf2; if ((narg>5)&&(strcmp(arg[5],".")!=0)) sscanf(arg[5],"%d,%d",&jf1,&jf2); JFmin=jf1; JFmax=jf2; // time averaging interval definition, in term of visibility files int deltaIavg=1; if (narg>6) deltaIavg=atoi(arg[6]); if (deltaIavg<1) deltaIavg=1; int prtlev=1; if (narg>7) prtlev=atoi(arg[7]); cout << " visi2ntac/Info: Path BAO5:"< paths; paths.push_back(path5); paths.push_back(path6); const char* ntnames[26]={"k","time", "p1","p2","p3","p4","p5","p6","p7","p8", "p1HI","p2HI","p3HI","p4HI","p5HI","p6HI","p7HI","p8HI", "p1HI5","p2HI5","p3HI5","p4HI5","p5HI5","p6HI5","p7HI5","p8HI5"}; NTuple nt(26,ntnames); r_8 xnt[30]; // Numero de ligne des auto-correlations dans la matrice des visibilites sa_size_t KVAC[8]={0,8,15,21,26,30,33,35}; Range freqs(JFmin,JFmax); Range freqs21(JFmin21,JFmax21); Range freqs21_5(JFmin21_5,JFmax21_5); VisiP4Reader vreader(paths, Imin,Imax,Istep,true); vreader.setPrintLevel(prtlev); bool fgok=true; TMatrix< complex > vismtx; TimeStamp dateobs; double mttag; int cnt=0, cntnt=0, pcntnt=0; int I=0; while (fgok) { fgok=vreader.ReadNext(vismtx, dateobs, mttag); if (fgok) { if (I==0) { xnt[0]=cnt; xnt[1]=dateobs.SecondsPart(); if (prtlev>0) cout << "visi2ntac/Info: dateobs="<>>> visi2ntac.cc ------- END ----------- RC=" << rc << endl; return rc; }