8 #define SRC_FREQ 200 // main frequency of input signal 9 #define SRC_TH 90 // source theta 10 #define SRC_PH 0 // source phy 14 #define FITS // use as input the fits skymap (fitsName = fits file name) 18 #define PSPHA 1. // power spectrum threshold 22 #define NLMAX 256 // l max of the spherical harmonic coefficients 26 #define HEALPIX_ORDER 7 // healpix skymap order 44 cout <<
"rings " << rings << endl;
45 if(
NLMAX>(rings+1)/2) {
47 <<
" number of rings " << rings << endl;
48 cout <<
" NLMAX=" <<
NLMAX <<
" must be <= (rings+1)/2=" << (rings+1)/2 << endl;
52 for(
int l=0;
l<
L;
l++) {
57 double ifo0d1_pos_delay=gNET->
GetDelay(ifo[0], ifo[1], sph, sth);
58 double delay01=pD[0]->
getTau(th,ph)-pD[1]->
getTau(th,ph);
59 delay01-=ifo0d1_pos_delay;
61 double fdelay=
fabs(fmod(delay01,0.5/frequency));
62 int idelay =
int((
fabs(delay01)-fdelay)/(0.5/frequency));
63 delay01 = idelay%2==0 ? fdelay : (0.5/
frequency)-fdelay;
65 double ifo1d2_pos_delay=gNET->
GetDelay(ifo[1], ifo[2], sph, sth);
66 double delay12=pD[1]->
getTau(th,ph)-pD[2]->
getTau(th,ph);
67 delay12-=ifo1d2_pos_delay;
69 double fdelay=
fabs(fmod(delay12,0.5/frequency));
70 int idelay =
int((
fabs(delay12)-fdelay)/(0.5/frequency));
71 delay12 = idelay%2==0 ? fdelay : (0.5/
frequency)-fdelay;
73 double ifo0d2_pos_delay=gNET->
GetDelay(ifo[0], ifo[2], sph, sth);
74 double delay02=pD[0]->
getTau(th,ph)-pD[2]->
getTau(th,ph);
75 delay02-=ifo0d2_pos_delay;
77 double fdelay=
fabs(fmod(delay02,0.5/frequency));
78 int idelay =
int((
fabs(delay02)-fdelay)/(0.5/frequency));
79 delay02 = idelay%2==0 ? fdelay : (0.5/
frequency)-fdelay;
82 sm.
set(
l,delay01+delay12);
97 skymap smf(const_cast<char*>(fitsName.Data()));
102 for(
int i=0;
i<=order;
i++) rings=2*rings+1;
103 cout <<
"rings " << rings << endl;
104 if(
NLMAX>(rings+1)/2) {
105 cout <<
"Error : helpix resolution is " << order
106 <<
" number of rings " << rings << endl;
107 cout <<
" NLMAX=" <<
NLMAX <<
" must be <= (rings+1)/2=" << (rings+1)/2 << endl;
123 alm(3,2)=complex<double>(1,0);
132 for(
int l=0;
l<=oalm.
Lmax();
l++) {
133 int limit = TMath::Min(
l,oalm.
Mmax());
135 for (
int m=0;
m<=limit;
m++) {
136 double mod = pow(oalm(
l,
m).real(),2)+pow(oalm(
l,
m).imag(),2);
140 if(ps>psmax) {psmax=ps;lmax=
l;}
142 cout <<
"lmax : " << lmax << endl;
150 for(
int l=0;
l<=oalm.
Lmax();
l++) {
152 int limit = TMath::Min(
l,oalm.
Mmax());
153 for (
int m=0;
m<=limit;
m++) {
154 double mod = pow(oalm(
l,
m).real(),2)+pow(oalm(
l,
m).imag(),2);
157 if(
l%2) {x1[n1]=
l;y1[n1]=ps/norm;n1++;}
158 else {x2[n2]=
l;y2[n2]=ps/norm;n2++;}
161 TCanvas*
c =
new TCanvas();
163 TGraph* gr1 =
new TGraph(n1,x1,y1);
164 gr1->SetMarkerColor(kBlack);
165 gr1->SetLineColor(kBlack);
166 TGraph*
gr2 =
new TGraph(n2,x2,y2);
167 gr2->SetMarkerColor(kRed);
168 gr2->SetLineColor(kRed);
170 TMultiGraph*
mg =
new TMultiGraph();
176 cout <<
"norm : " << norm << endl;
180 double pspha =
PSPHA;
184 double* alm_a =
new double[
N];
185 int* alm_l =
new int[
N];
186 int* alm_m =
new int[
N];
188 for(
int l=0;
l<=oalm.
Lmax();
l++) {
189 int limit = TMath::Min(
l,oalm.
Mmax());
190 for (
int m=0;
m<=limit;
m++) {
191 alm_a[
N] = pow(oalm(
l,
m).real(),2)+pow(oalm(
l,
m).imag(),2);
199 TMath::Sort(N, alm_a, index,
true);
202 for(
int i=0;
i<
N;
i++) norm+=alm_a[index[
i]];
203 for(
int i=0;
i<
N;
i++) alm_a[index[
i]]/=norm;
208 for (
int i=0;
i<
N;
i++) {
209 cum+=alm_a[index[
i]];
210 if(cum>pspha) {icum=
i+1;
break;}
212 for(
int i=0;
i<icum;
i++) {
213 int ll = alm_l[index[
i]];
214 int mm = alm_m[index[
i]];
215 ialm(ll,mm)=complex<double>(oalm(ll,mm).real(),oalm(ll,mm).imag());
216 double mod = pow(oalm(ll,mm).real(),2)+pow(oalm(ll,mm).imag(),2);
detector * getifo(size_t n)
param: detector index
int Mmax() const
Returns the maximum m.
void DrawPowerSpectrumSphericalHarmonic(TString fitsName="")
double getTheta(size_t i)
void Draw(int dpaletteId=1, Option_t *option="colfz")
int Lmax() const
Returns the maximum l.
double GetDelay(TString ifo1, TString ifo2, double phi, double theta)
double fabs(const Complex &x)
double getTau(double, double)
param: source theta,phi angles in degrees
double GetAntennaPattern(double phi, double theta, double psi=0., int polarization=1)
void set(size_t i, double a)
param: sky index param: value to set