Commit 4700d960 authored by perdereau's avatar perdereau
Browse files
parents 15c88dd5 088a4ad6
......@@ -69,7 +69,7 @@ int nloop = 0;
//#define TYPE_POLAR
//1= in fitAllCross fixed the position of the dishes, 0 no fixing
#define POSXYZ_FIXED 0
#define POSXYZ_FIXED 1
//JEC 20/7/18 auto-corr azimut contraint >0 (en general non => 0)
#define AZIMUT_FIXED 1
......@@ -1036,10 +1036,14 @@ void fitAutoCrossCorr(){
// Extract interactive user information
//--------------------
cout << "coucou" << endl;
int debug = param.debug;
string inputDir = param.inputDir;
string outputDir = param.outputDir;
r_4 FreqMin = param.FreqMin;
r_4 FreqMax = param.FreqMax;
r_4 FreqBand = param.FreqBand;
......@@ -1050,7 +1054,7 @@ void fitAutoCrossCorr(){
r_8 raSrcSec = param.raSrcSec;
r_8 raSrc = HdecfrHMS(raSrcHour,raSrcMin,raSrcSec); //J2000
r_8 decSrcDeg = param.decSrcDeg;
r_8 decSrcMin = param.decSrcMin;
r_8 decSrcSec = param.decSrcSec;
......@@ -1058,6 +1062,7 @@ void fitAutoCrossCorr(){
cout << "raSrc (hr): " << raSrc << ", decSrc (rad): " << decSrc << "\n";
......@@ -1335,13 +1340,22 @@ void fitAutoCrossCorr(){
{
vector<r_8> tmpStdV = FreqVec.ConvertTostdvec();
iFreqMin = closest(tmpStdV,(r_8)FreqMin);
if(iFreqMin<0)
throw RangeCheckError("fitAutoCrossCorr: FreqMin not found in FreqVec vector");
//JEC 25/7/18 for safety
iFreqMin += 1;
iFreqMax = closest(tmpStdV,(r_8)FreqMax);
if(iFreqMax<0)
if(iFreqMax<0 && iFreqMax > FreqVec.Size())
throw RangeCheckError("fitAutoCrossCorr: FreqMax not found in FreqVec vector");
//JEC 25/7/18 for safety
iFreqMax -= 1;
cout << "Debug from FreqVec: iFreqMin = " << iFreqMin << " -> " << FreqVec(iFreqMin)
<< " iFreqMax = iFreqMax " << iFreqMax << " -> " << FreqVec(iFreqMax) << endl;
}
......@@ -1374,6 +1388,7 @@ void fitAutoCrossCorr(){
objName = "VARTFM_"+nameCh[ia];
fIn >> PPFNameTag(objName) >> tmpVAR;
eyPtsAuto(Range(ia),Range::all(),Range::all()).CompactAllDimensions() =
Sqrt(tmpVAR(Range(iFreqMin,iFreqMax),Range(ifirstHA,ilastHA)));
......@@ -1398,7 +1413,9 @@ void fitAutoCrossCorr(){
//The values (REAL & IMAG) of the visibility
objName = "TFM_"+crossName[ix];
TMatrix< complex<r_4> > tmpVAL; // CARE here we load Matrix to use Range selection afterwards
fIn >> PPFNameTag(objName) >> tmpVAL;
fIn >> PPFNameTag(objName) >> tmpVAL;
//In the File are stored TVector <Time-X, Freq-Y>
......@@ -1417,6 +1434,7 @@ void fitAutoCrossCorr(){
TMatrix<r_4> tmpVAR;
objName = "RVARTFM_"+crossName[ix];
fIn >> PPFNameTag(objName) >> tmpVAR;
eyPtsCross(Range(ix),Range::all(),Range::all()).CompactAllDimensions() =
Sqrt(tmpVAR(Range(iFreqMin,iFreqMax),Range(ifirstHA,ilastHA)));
......@@ -1451,8 +1469,16 @@ void fitAutoCrossCorr(){
//--------------------
cout << "Fit process... DEBUG ONE FREQ" << endl;
// //TEST des bornes en Frequence et de la production des fichiers en sortie
// vector<int> freqBins(2);
// freqBins[0] = 0;
// freqBins[1] = Nfreq-1;
// for(int iFreqBin; iFreqBin < 2; iFreqBin++) {
// int iFreq = freqBins[iFreqBin];
for(int iFreq =0; iFreq < Nfreq; iFreq++) {
bool debug=true;
......@@ -2001,7 +2027,42 @@ void fitAutoCrossCorr(){
cout << "Save to " << file << endl;
POutPersist po(file);
po << PPFNameTag("dt") <<dt;
}
//JEC 25/7/18 extraction des phases versus freq pour fiter par la suite directement
TVector<r_8> freq(dt.GetColumnD("freq"));
size_t Nfreq = freq.Size();
vector<string> vPhaseName;
#if TYPE_POLAR == 1
vPhaseName.push_back("Phi2H");
vPhaseName.push_back("Phi3H");
vPhaseName.push_back("Phi4H");
#else
vPhaseName.push_back("Phi2V");
vPhaseName.push_back("Phi3V");
vPhaseName.push_back("Phi4V");
#endif
size_t Nphase = vPhaseName.size();
TVector<r_8> phase[Nphase];
for(size_t ip=0;ip<Nphase;ip++){
phase[ip] = dt.GetColumnD(vPhaseName[ip]);
}
file= outputDir + "/phases-" + source + "-" + polarTag + "-RE.txt";
ofstream ofs(file);
for(size_t i=0;i<Nfreq;i++){
ofs << freq(i) << " ";
for(size_t ip=0;ip<Nphase;ip++){
ofs << setprecision(10) << phase[ip](i) << " ";
}
ofs << endl;
}
ofs.close();
}//save
}//fitAutoCrossCorr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment