Commit b81be905 authored by Reza  ANSARI's avatar Reza ANSARI
Browse files

1/ Modification calcul RA from TU : calcul Xephem (XAstroPack) pas correct, on...

1/ Modification calcul RA from TU : calcul Xephem (XAstroPack) pas correct, on utilise le code datime.h.c de EROS ds NTools
2/ Ajout petit programme de test tstutls.cc  et MAJ makefile
                      Reza 31/05/2018
parent 1cc3250e
......@@ -10,7 +10,7 @@ MYINCLISTHERE = p4autils.h visip4reader.h visp4winreader.h p4gnugain.h p4gvcor.h
MYOLISTHERE = $(OBJ)/p4autils.o $(OBJ)/visip4reader.o $(OBJ)/visp4winreader.o $(OBJ)/p4gnugain.o $(OBJ)/p4gvcor.o $(OBJ)/p4phcor.o
# Define our target list
all : rdvisip4 visi2ntac visi2dtacx visi2tmfreq p4conv2fits msvis2dt visiavg filt_blind ckconvphases vis2ra
all : rdvisip4 visi2ntac visi2dtacx visi2tmfreq tstutls p4conv2fits msvis2dt visiavg filt_blind ckconvphases vis2ra
clean :
rm -f $(EXE)/rdvisip4 $(EXE)/visi2ntac $(EXE)/visi2dtacx $(EXE)/visi2tmfreq $(EXE)/p4conv2fits $(EXE)/msvis2dt $(EXE)/visiavg \
......@@ -134,6 +134,17 @@ $(EXE)/rdvisip4 : $(OBJ)/rdvisip4.o $(MYOLISTHERE)
$(OBJ)/rdvisip4.o : rdvisip4.cc $(MYINCLISTHERE)
$(CXXCOMPILE) -o $(OBJ)/rdvisip4.o rdvisip4.cc
######
## programme de tests de base pour diverses classes / fonctions
tstutls : $(EXE)/tstutls
echo '---tstutls made'
$(EXE)/tstutls : $(OBJ)/tstutls.o $(MYOLISTHERE)
$(CXXLINK) -o $(EXE)/tstutls $(OBJ)/tstutls.o $(MYOLISTHERE) $(SOPHYAEXTSLBLIST)
$(OBJ)/tstutls.o : tstutls.cc $(MYINCLISTHERE)
$(CXXCOMPILE) -o $(OBJ)/tstutls.o tstutls.cc
######
## programme de conversion de matrices de visibilites de PPF en FITS
p4conv2fits : $(EXE)/p4conv2fits
......
......@@ -15,6 +15,7 @@
#include "datacards.h"
#include "strutilxx.h"
#include "xastropack.h"
#include "datime.h"
//---------------------------------------------------------------------
......@@ -526,7 +527,24 @@ static double paon_lon = 2.19964; // 2deg 11' 58.7''
double P4Coords::getLon(){return(paon_lon);}
double P4Coords::getLat(){return(paon_lat);}
double P4Coords::RAFromTimeTU(TimeStamp const & tu){
double P4Coords::RAFromTimeTU(TimeStamp const & tu)
{
// Compute RA from TU-time , using the old code from EROS in SOPHYA
JMA day;
tu.GetDate(day.Annee,day.Mois,day.Jour);
HMS hour;
tu.GetHour(hour.Heures, hour.Minutes, hour.Secondes);
HMS tsid;
tsid=TUtoTSid(day, hour);
double ra = HMStoH(tsid); // le ra si lobservatoire etait a Greenwich (longitude 0 deg)
ra += getLon()/15.;
return (ra);
}
double P4Coords::RAFromTimeTUXE(TimeStamp const & tu)
{
// Compute RA from TU-time , using the code from Xephem
// Reza+Olivier , 30 Mai 2018: semblerait qu'il y ait un probleme ...
int y,mn,dd;
tu.GetDate(y,mn,dd);
......@@ -538,6 +556,7 @@ double P4Coords::RAFromTimeTU(TimeStamp const & tu){
}
//------------------------------------------------------
//----------------- class P4RAMapUtil ------------------
//------------------------------------------------------
......
......@@ -229,8 +229,11 @@ public :
static double getLon();
//! static method returning PAON4 (central antenna) latitude in decimal degrees (positive -> north)
static double getLat();
//! static method Converting a TU time into RA (Right Ascension sky coordinates) in decimal degrees
//! static method Converting a TU time into RA (Right Ascension sky coordinates) in decimal degrees (uses old EROS code in SOPHYA, datime.h)
static double RAFromTimeTU(TimeStamp const & tu);
//! static method Converting a TU time into RA (Right Ascension sky coordinates) in decimal degrees (uses Xephem code through XAstroPack, seems to have an error)
static double RAFromTimeTUXE(TimeStamp const & tu);
};
//! Class to facilitate projection into RA map
......
// Utilisation de SOPHYA pour faciliter les tests ...
#include "sopnamsp.h"
#include "machdefs.h"
/* ----------------------------------------------------------
Projet BAORadio/PAON4 - (C) LAL/IRFU 2008-2015
Programme de test pour ce module
Reza, Mai 2018
---------------------------------------------------------- */
// include standard c/c++
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <string>
#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 <utilarr.h>
// include sophya mesure ressource CPU/memoire ...
#include "resusage.h"
#include "ctimer.h"
#include "timing.h"
// include lecteur de fichiers visibilites
#include "p4autils.h"
#include "visip4reader.h"
#include "p4gnugain.h"
int Usage(void)
{
cout<<"--- tstutls.cc : Test for various classes in this module \n"<<endl;
cout<<"Usage: tstutls [-options] \n";
P4AnaParams::UsageOptions();
cout<<endl;
return 1;
}
//----------------------------------------------------
int main(int narg, const char* arg[])
{
int rc=0;
// --- Decoding parameters
if ((narg>1)&&(strcmp(arg[1],"-h")==0)) return Usage();
P4AnaParams params;
params.DecodeArgs(narg, arg);
string path5 = params.inpath5_;
string path6 = params.inpath6_;
int Imin=params.Imin_, Imax=params.Imax_, Istep=params.Istep_;
string outfile=params.outfile_;
string gainfile=params.gain_gnu_file_;
int prtlev=params.prtlev_;
params.Print(cout);
cout<<"rdvisip4/Info: Path BAO5:"<<path5<<" BAO6:"<<path6<<"\n"
<<"fgreorderfreq="<<params.fgreorderfreq_<<"\n"
<<"Imin,max,step="<<Imin<<","<<Imax<<","<<Istep<<"\n"
<<"PrtLev="<<prtlev<<" OutFile:"<<outfile<<endl;
P4AVisiNumEncoder vencod;
cout << vencod;
TimeStamp ttt; ttt.SetNow();
for(int k=0; k<60*30; k++) {
ttt.ShiftSeconds(600.);
double ra=P4Coords::RAFromTimeTU(ttt);
double raxe=P4Coords::RAFromTimeTUXE(ttt);
cout << " Time="<<ttt<<" ra="<<ra<<" raXE="<<raxe<<" diff="<<ra-raxe<<endl;
}
cout << ">>>> tstutls.cc ------- END ----------- RC=" << rc << endl;
return rc;
}
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