Commit 0fad6440 authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

Amelioration des programmes tnhic.cc et readncp.cc , Reza

parent 1f4124c6
......@@ -65,10 +65,22 @@ bool fg_extract_visa = true; // if true, extract and save visibility ar
vector<int> extract_visa_bl;
vector<bool> extract_visa_fgblok;
vector< pair<int,int> > visa_all_bl_did;
/*
#define NB_SEL_BASELINES 27
static int SEL_BASELINES[NB_SEL_BASELINES]={4,5,6,7,9,12,14,17,18,19, 20,22,23,25,41,55,56,57,60,64, 65,69,72,88,92,93,102};
sa_size_t VISA_EXT_I1 = 0, VISA_EXT_I2 = 840, VISA_EXT_DI = 2; // limites en index ra pour extraction des tableaux de visibilites
*/
// Nombre total et numero des dishs presents
#define NBDISHES 14
static int DISH_NUMS[NBDISHES]={1,2,3,4,5,6,8,9,10,11,12,13,15,16} ;
// Liste des bad dishes , a ne pas garder lors de extract
#define NBADDISH 3
static int BAD_DISHES[NBADDISH]={3,9,15} ;
sa_size_t VISA_EXT_I1 = 20, VISA_EXT_I2 = 820, VISA_EXT_DI = 1; // limites en index ra pour extraction des tableaux de visibilites
sa_size_t VISA_EXT_NFREQ = 10; // Nombre de bandes en frequence
sa_size_t VISA_EXT_KSZ = 20; // largeur de la bande en frequence, en bin de 244 kHz
sa_size_t VISA_EXT_KSTART = 144;
......@@ -99,8 +111,8 @@ inline vector<int> get_bl_list(int j1, int j2) { // j1<=JB<=j2
return vbl;
}
/* Fonction */
void prepare_extract_visa_baselines()
/* Fonction
void prepare_extract_visa_baselines_old()
{
for(int i=0; i<NBASELINES; i++) extract_visa_fgblok.push_back(false);
for(int i=0; i<NB_SEL_BASELINES; i++) {
......@@ -108,6 +120,43 @@ void prepare_extract_visa_baselines()
extract_visa_fgblok[SEL_BASELINES[i]-1] = true;
}
}
*/
/* Fonction */
bool check_dish_ok(int k)
{
bool fgok=true;
for(int i=0; i<NBADDISH; i++) {
if (k==BAD_DISHES[i]) {
fgok=false; break;
}
}
return fgok;
}
/* Fonction */
void prepare_extract_visa_baselines()
{
for(int i=0; i<NBASELINES; i++) extract_visa_fgblok.push_back(false);
size_t kk=0;
for(int i=0; i<NBDISHES; i++) {
int ii=DISH_NUMS[i];
for(int j=i; j<NBDISHES; j++) {
int jj=DISH_NUMS[j];
visa_all_bl_did.push_back(pair<int,int>(ii,jj));
bool fgok=(check_dish_ok(ii) && check_dish_ok(jj));
extract_visa_fgblok[kk]=fgok; kk++;
if (fgok) extract_visa_bl.push_back(kk);
}
}
kk=0;
cout << "--- prepare_extract_visa_baselines() Number of selected baselines = "<<extract_visa_bl.size()<<endl;
for (size_t i=0; i<extract_visa_fgblok.size(); i++) {
if (!extract_visa_fgblok[i]) continue;
cout << " Selected: Baseline="<<extract_visa_bl[kk]<<" Dishes["<< visa_all_bl_did[i].first << " , " << visa_all_bl_did[i].second << " ]"<<endl;
kk++;
}
}
//--------------------------------------------------------------
//--------- Main program -------------
......
......@@ -35,8 +35,9 @@ int main(int narg, char* arg[])
cout << "\n ---- tnhic.cc Test of HICCountComputer class ------ " << endl;
if (narg < 2) {
cout << " tnhic / missing argument - \n"
<<" Usage: tnhic [-mJy -mK] OutputPPF [FluxLimit] [z1,z2,dz] [AngResDeg,delnuMHz,lmin,lmax] [N,Tsys,Omega,duration,D_array] [zp1,zp2,dzp] \n"
<< " -mJy / -mK : FluxLimit in mJy (default = 10) or in mK \n"
<<" Usage: tnhic [-mJy -mK -prt -prt2] OutputPPF [FluxLimit] [z1,z2,dz] [AngResDeg,delnuMHz,lmin,lmax] [N,Tsys,Omega,duration,D_array] [zp1,zp2,dzp] \n"
<< " -mJy / -mK : FluxLimit in mJy (default = 10) or in mK \n"
<< " -prt / -prt2 : set print level to 1 / 2 (default = 0) \n"
<< " OutputPPF : Output PPF file name \n"
<< " z1,z2,dz : redshift limit for clump count (default= 0.001,.101,0.002) \n"
<< " AngResDeg,delnuMHz,lmin,lmax : angular resolution in deg, deltaFreq-MHz, lmin, lmax (def: 0.2,1,75,850) \n"
......@@ -62,6 +63,8 @@ int main(int narg, char* arg[])
string sa1=arg[1];
if (sa1 == "-mJy") { fgmJy = true; off++; }
else if (sa1 == "-mK") { fgmJy = false; off++; }
else if (sa1 == "-prt") { prtlevel = 1; off++; }
else if (sa1 == "-prt2") { prtlevel = 2; off++; }
if (narg-off < 2) {
cout << " tnhic/ERROR : missing argument after optional arg specification \n" << endl;
return 2;
......@@ -122,8 +125,8 @@ int main(int narg, char* arg[])
NTuple ntnoisem=pncm.doCompute(z1n,z2n,dzn);
cout << " --------------------------------------------------- " << endl;
double mesz[5]={0.1, 0.2, 0.5, 1., 2.};
for(int i=0; i<5; i++) {
double mesz[8]={0.1, 0.2, 0.5, 1., 1.5, 2., 2.5, 3.};
for(int i=0; i<8; i++) {
pnc.print(mesz[i]);
pncm.print(mesz[i]);
}
......
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