Commit 939d6457 authored by Karsten Wiesner's avatar Karsten Wiesner 💬
Browse files

extended synthlisa by phasemeter noise - patch and testscript

parent 782ca626
From 509b0eca6a9f54e73ae524412c950df5e58b45f2 Mon Sep 17 00:00:00 2001
From: Karsten Wiesner <karsten.wiesner@aei.mpg.de>
Date: Tue, 14 May 2019 12:22:00 +0000
Subject: [PATCH 1/4] extended the TDINoise:TDINoise swig interface by two more
noise psds
---
lisasim/lisasim-swig.i | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/lisasim/lisasim-swig.i b/lisasim/lisasim-swig.i
index c09e0e5..3462f3c 100644
--- a/lisasim/lisasim-swig.i
+++ b/lisasim/lisasim-swig.i
@@ -1427,7 +1427,31 @@ initsave(TDInoise)
else:
self.c = [NoSignal() for i in range(6)]
- args = (self.lisa,self.pm,self.pd,self.c)
+ # extension of 2 more noises for tilt to length (ttl) coupling investigation by Sweta Shah
+ # -----------------------------------------------------------------------------------------
+
+ if len(args) > 0:
+ if type(args[0]) in (int,float): #### todo: need to add proper phasemeter noise method
+ self.phase_meter_noise = [stdlasernoise(self.lisa, args[0], args[1]) for i in range(6)]
+ args = args[2:]
+ else:
+ self.phase_meter_noise = args[0]
+ args = args[1:]
+ else:
+ self.phase_meter_noise = [NoSignal() for i in range(6)]
+
+ if len(args) > 0:
+ if type(args[0]) in (int,float): #### todo: need to add proper aux noise method
+ self.aux_noise = [stdlasernoise(self.lisa, args[0], args[1]) for i in range(6)]
+ args = args[2:]
+ else:
+ self.aux_noise = args[0]
+ args = args[1:]
+ else:
+ self.aux_noise = [NoSignal() for i in range(6)]
+
+ args = (self.lisa, self.pm, self.pd, self.c, self.phase_meter_noise, self.aux_noise)
+
%}
%apply Noise *PYTHON_SEQUENCE_NOISE[ANY] {Noise *proofnoise[6], Noise *shotnoise[6], Noise *lasernoise[6]}
--
1.9.1
From c4ef1ca48fd5013101417be1b75ad524f77ec715 Mon Sep 17 00:00:00 2001
From: Karsten Wiesner <karsten.wiesner@aei.mpg.de>
Date: Tue, 14 May 2019 13:22:36 +0000
Subject: [PATCH 2/4] extended also the C++ TDInoise::TDInoise modules by two
more noises
---
lisasim/lisasim-swig.i | 4 ++--
lisasim/lisasim-tdinoise.cpp | 34 +++++++++++++++++++++++++++++++++-
lisasim/lisasim-tdinoise.h | 4 +++-
3 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/lisasim/lisasim-swig.i b/lisasim/lisasim-swig.i
index 3462f3c..1eb33c3 100644
--- a/lisasim/lisasim-swig.i
+++ b/lisasim/lisasim-swig.i
@@ -1454,13 +1454,13 @@ initsave(TDInoise)
%}
-%apply Noise *PYTHON_SEQUENCE_NOISE[ANY] {Noise *proofnoise[6], Noise *shotnoise[6], Noise *lasernoise[6]}
+%apply Noise *PYTHON_SEQUENCE_NOISE[ANY] {Noise *proofnoise[6], Noise *shotnoise[6], Noise *lasernoise[6], Noise *phase_meter_noise[6], Noise *aux_noise[6]}
%apply double PYTHON_SEQUENCE_DOUBLE[ANY] {double stproof[6], double sdproof[6], double stshot[6], double sdshot[6], double stlaser[6], double sdlaser[6], double claser[6]}
class TDInoise : public TDI {
public:
- TDInoise(LISA *mylisa, Noise *proofnoise[6], Noise *shotnoise[6], Noise *lasernoise[6]);
+ TDInoise(LISA *mylisa, Noise *proofnoise[6], Noise *shotnoise[6], Noise *lasernoise[6], Noise *phase_meter_noise[6], Noise *aux_noise[6]);
virtual ~TDInoise();
diff --git a/lisasim/lisasim-tdinoise.cpp b/lisasim/lisasim-tdinoise.cpp
index 29fc602..4d1e853 100644
--- a/lisasim/lisasim-tdinoise.cpp
+++ b/lisasim/lisasim-tdinoise.cpp
@@ -79,8 +79,40 @@ TDInoise::TDInoise(LISA *mylisa, double *stproof, double *sdproof, double *stsho
}
// this version takes pointers to noise objects, allowing for user-specified noises on different objects
+TDInoise::TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise *lasernoise[6])
+{
+ phlisa = mylisa->physlisa();
+ lisa = mylisa;
+
+ // set noise objects
+ // the convention is {1,1*,2,2*,3,3*}, and {12,21,23,32,31,13}
+
+ for(int craft = 1; craft <= 3; craft++) {
+ pm[craft] = proofnoise[2*(craft-1)];
+ pms[craft] = proofnoise[2*(craft-1)+1];
+ }
+
+ for(int craft1 = 1; craft1 <= 3; craft1++) {
+ for(int craft2 = 1; craft2 <= 3; craft2++) {
+ if(craft1 != craft2) {
+ if( (craft1 == 1 && craft2 == 2) || (craft1 == 2 && craft2 == 3) || (craft1 == 3 && craft2 == 1) )
+ shot[craft1][craft2] = shotnoise[2*(craft1-1)];
+ else
+ shot[craft1][craft2] = shotnoise[2*(craft2-1)+1];
+ }
+ }
+ }
+
+ for(int craft = 1; craft <= 3; craft++) {
+ c[craft] = lasernoise[2*(craft-1)];
+ cs[craft] = lasernoise[2*(craft-1)+1];
+ }
+
+ allocated = 0;
+}
-TDInoise::TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise *lasernoise[6]) {
+TDInoise::TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise *lasernoise[6], Noise *phase_meter_noise[6], Noise *aux_noise[6])
+{
phlisa = mylisa->physlisa();
lisa = mylisa;
diff --git a/lisasim/lisasim-tdinoise.h b/lisasim/lisasim-tdinoise.h
index 05e4e2f..3dad513 100644
--- a/lisasim/lisasim-tdinoise.h
+++ b/lisasim/lisasim-tdinoise.h
@@ -37,9 +37,11 @@ class TDInoise : public TDI {
TDInoise(LISA *mylisa, double *stproof, double *sdproof, double *stshot, double *sdshot, double *stlaser, double *sdlaser);
// provide arrays of pointers to noise objects
-
TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise *lasernoise[6]);
+ // Extension of 2 more noises for tilt to length (ttl) coupling investigation by Sweta Shah
+ TDInoise(LISA *mylisa, Noise *proofnoise[6], Noise *shotnoise[6], Noise *lasernoise[6], Noise *phase_meter_noise[6], Noise *aux_noise[6]);
+
// the destructor will delete all the noise objects only if they were created by the constructor
virtual ~TDInoise();
--
1.9.1
From c5de2faf264c6cc8c14818060ab7d6ac591b1655 Mon Sep 17 00:00:00 2001
From: Karsten Wiesner <karsten.wiesner@aei.mpg.de>
Date: Tue, 14 May 2019 13:49:42 +0000
Subject: [PATCH 3/4] added the two new stdnoise function in the swig interface
- callgraph ok - need to be implemented bey Sweta
---
lisasim/lisasim-swig.i | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/lisasim/lisasim-swig.i b/lisasim/lisasim-swig.i
index 1eb33c3..8f5c0dc 100644
--- a/lisasim/lisasim-swig.i
+++ b/lisasim/lisasim-swig.i
@@ -1382,6 +1382,19 @@ initsave(TDInoise)
pbtlaser = 8.0 * lighttime(lisa) + 2.0*stlaser
return PowerLawNoise(stlaser,pbtlaser,sdlaser,0.0,interp,seed)
+
+ # TODO implement properly (just copied implementation from stdlasernoise) sweta
+
+ def std_phase_meter_noise(lisa,stlaser,sdlaser,interp=1,seed=0):
+ pbtlaser = 8.0 * lighttime(lisa) + 2.0*stlaser
+
+ return PowerLawNoise(stlaser,pbtlaser,sdlaser,0.0,interp,seed)
+
+ def std_aux_noise(lisa,stlaser,sdlaser,interp=1,seed=0):
+ pbtlaser = 8.0 * lighttime(lisa) + 2.0*stlaser
+
+ return PowerLawNoise(stlaser,pbtlaser,sdlaser,0.0,interp,seed)
+
%}
%feature("pythonprepend") TDInoise::TDInoise %{
@@ -1431,8 +1444,8 @@ initsave(TDInoise)
# -----------------------------------------------------------------------------------------
if len(args) > 0:
- if type(args[0]) in (int,float): #### todo: need to add proper phasemeter noise method
- self.phase_meter_noise = [stdlasernoise(self.lisa, args[0], args[1]) for i in range(6)]
+ if type(args[0]) in (int,float):
+ self.phase_meter_noise = [std_phase_meter_noise(self.lisa, args[0], args[1]) for i in range(6)]
args = args[2:]
else:
self.phase_meter_noise = args[0]
@@ -1441,8 +1454,8 @@ initsave(TDInoise)
self.phase_meter_noise = [NoSignal() for i in range(6)]
if len(args) > 0:
- if type(args[0]) in (int,float): #### todo: need to add proper aux noise method
- self.aux_noise = [stdlasernoise(self.lisa, args[0], args[1]) for i in range(6)]
+ if type(args[0]) in (int,float):
+ self.aux_noise = [std_aux_noise(self.lisa, args[0], args[1]) for i in range(6)]
args = args[2:]
else:
self.aux_noise = args[0]
--
1.9.1
From 1dc93616c42c7099ed7c2b242e0d5e02ae525c52 Mon Sep 17 00:00:00 2001
From: Karsten Wiesner <karsten.wiesner@aei.mpg.de>
Date: Wed, 15 May 2019 08:49:44 +0000
Subject: [PATCH 4/4] implemented the Noise factories in swig python and the
TDInoise constructor in C++. Preparation ready for Sweta
---
lisasim/lisasim-swig.i | 22 ++++++++++------------
lisasim/lisasim-tdinoise.cpp | 35 +++++++++++++++++++++++++++++++++--
lisasim/lisasim-tdinoise.h | 3 +++
3 files changed, 46 insertions(+), 14 deletions(-)
diff --git a/lisasim/lisasim-swig.i b/lisasim/lisasim-swig.i
index 8f5c0dc..4b0e3fd 100644
--- a/lisasim/lisasim-swig.i
+++ b/lisasim/lisasim-swig.i
@@ -1341,6 +1341,8 @@ initsave(TDInoise)
}
// utility Python functions needed by TDInoise constructor
+// these kind of noise factories are also implemented in C++ but
+// the current TDInoise constructor calls this python implementation
%pythoncode %{
def lighttime(lisa):
@@ -1373,7 +1375,6 @@ initsave(TDInoise)
# we need only triple retardations for the shot's appearing in the y's
# (septuple for 2nd-gen TDI); we add two sampling times to allow linear
# interpolation for large sampling times
-
pbtshot = 7.0 * lighttime(lisa) + 2.0*stshot
return PowerLawNoise(stshot,pbtshot,sdshot,2.0,interp,seed)
@@ -1383,18 +1384,15 @@ initsave(TDInoise)
return PowerLawNoise(stlaser,pbtlaser,sdlaser,0.0,interp,seed)
- # TODO implement properly (just copied implementation from stdlasernoise) sweta
-
- def std_phase_meter_noise(lisa,stlaser,sdlaser,interp=1,seed=0):
- pbtlaser = 8.0 * lighttime(lisa) + 2.0*stlaser
-
- return PowerLawNoise(stlaser,pbtlaser,sdlaser,0.0,interp,seed)
-
- def std_aux_noise(lisa,stlaser,sdlaser,interp=1,seed=0):
- pbtlaser = 8.0 * lighttime(lisa) + 2.0*stlaser
-
- return PowerLawNoise(stlaser,pbtlaser,sdlaser,0.0,interp,seed)
+ # prepared for tilt to length coupling investigation by Sweta Shah
+ def std_phase_meter_noise(lisa, st_phase_meter, sd_phase_meter, interp=1, seed=0):
+ pb_phase_meter = 7.0 * lighttime(lisa) + 2.0*st_phase_meter
+ return PowerLawNoise(st_phase_meter, pb_phase_meter, sd_phase_meter, 2.0, interp, seed)
+ # prepared for tilt to length coupling investigation by Sweta Shah
+ def std_aux_noise(lisa, st_aux, sd_aux, interp=1, seed=0):
+ pb_aux = 7.0 * lighttime(lisa) + 2.0*st_aux
+ return PowerLawNoise(st_aux, pb_aux, sd_aux, 2.0, interp, seed)
%}
%feature("pythonprepend") TDInoise::TDInoise %{
diff --git a/lisasim/lisasim-tdinoise.cpp b/lisasim/lisasim-tdinoise.cpp
index 4d1e853..98ec234 100644
--- a/lisasim/lisasim-tdinoise.cpp
+++ b/lisasim/lisasim-tdinoise.cpp
@@ -87,6 +87,7 @@ TDInoise::TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise
// set noise objects
// the convention is {1,1*,2,2*,3,3*}, and {12,21,23,32,31,13}
+
for(int craft = 1; craft <= 3; craft++) {
pm[craft] = proofnoise[2*(craft-1)];
pms[craft] = proofnoise[2*(craft-1)+1];
@@ -111,6 +112,7 @@ TDInoise::TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise
allocated = 0;
}
+
TDInoise::TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise *lasernoise[6], Noise *phase_meter_noise[6], Noise *aux_noise[6])
{
phlisa = mylisa->physlisa();
@@ -118,12 +120,14 @@ TDInoise::TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise
// set noise objects
// the convention is {1,1*,2,2*,3,3*}, and {12,21,23,32,31,13}
-
+
+ // proofnoise
for(int craft = 1; craft <= 3; craft++) {
pm[craft] = proofnoise[2*(craft-1)];
pms[craft] = proofnoise[2*(craft-1)+1];
}
+ // shotnoise
for(int craft1 = 1; craft1 <= 3; craft1++) {
for(int craft2 = 1; craft2 <= 3; craft2++) {
if(craft1 != craft2) {
@@ -135,11 +139,38 @@ TDInoise::TDInoise(LISA *mylisa, Noise *proofnoise[6],Noise *shotnoise[6],Noise
}
}
+ // lasernoise
for(int craft = 1; craft <= 3; craft++) {
c[craft] = lasernoise[2*(craft-1)];
cs[craft] = lasernoise[2*(craft-1)+1];
}
+ // phasemeter noise
+ // prepared for tilt to length coupling investigation by Sweta Shah
+ for(int craft1 = 1; craft1 <= 3; craft1++) {
+ for(int craft2 = 1; craft2 <= 3; craft2++) {
+ if(craft1 != craft2) {
+ if( (craft1 == 1 && craft2 == 2) || (craft1 == 2 && craft2 == 3) || (craft1 == 3 && craft2 == 1) )
+ phase_meter[craft1][craft2] = phase_meter_noise[2*(craft1-1)];
+ else
+ phase_meter[craft1][craft2] = phase_meter_noise[2*(craft2-1)+1];
+ }
+ }
+ }
+
+ // aux noise
+ // prepared for tilt to length coupling investigation by Sweta Shah
+ for(int craft1 = 1; craft1 <= 3; craft1++) {
+ for(int craft2 = 1; craft2 <= 3; craft2++) {
+ if(craft1 != craft2) {
+ if( (craft1 == 1 && craft2 == 2) || (craft1 == 2 && craft2 == 3) || (craft1 == 3 && craft2 == 1) )
+ aux[craft1][craft2] = aux_noise[2*(craft1-1)];
+ else
+ aux[craft1][craft2] = aux_noise[2*(craft2-1)+1];
+ }
+ }
+ }
+
allocated = 0;
}
@@ -456,7 +487,7 @@ Noise *stdopticalnoise(LISA *lisa,double stshot,double sdshot,int interp) {
// add two sampling times to allow linear interpolation for large
// sampling times
-
+
double pbtshot = 7.0 * lighttime(lisa) + 2.0*stshot;
return new PowerLawNoise(stshot,pbtshot,sdshot,2.0,interp);
diff --git a/lisasim/lisasim-tdinoise.h b/lisasim/lisasim-tdinoise.h
index 3dad513..61ef767 100644
--- a/lisasim/lisasim-tdinoise.h
+++ b/lisasim/lisasim-tdinoise.h
@@ -26,6 +26,9 @@ class TDInoise : public TDI {
Noise *pm[4], *pms[4];
Noise *shot[4][4];
Noise *c[4], *cs[4];
+ Noise *phase_meter[4][4];
+ Noise *aux[4][4];
+
// standard noises for everybody, same levels
--
1.9.1
......@@ -23,7 +23,7 @@ with PyCallGraph(output=GraphvizOutput()):
patches = 256
OneYear = 2**25
NYear = 0.25
stime = 124.0
stime = 124
samples = int(NYear*OneYear/stime)
lisa = EccentricInclined(2.5e9/2.99792458e8,0.0,0.,-1,0)
......@@ -35,8 +35,14 @@ with PyCallGraph(output=GraphvizOutput()):
# Sop = 0
Spm = 3.0e-15**2/(4.0*math.pi*math.pi*c**2) ## 2.5e-48
Sop = 2*((10.0e-12)**2)*(4.0*math.pi*math.pi/c**2) ## 4.4e-38
noiseTDI = TDInoise(lisa, stime,Spm, stime,Sop, stime,0.0)
# old TDInoise constructor
# noiseTDI = TDInoise(lisa, stime,Spm, stime,Sop, stime,0.0)
# prepared for tilt to length coupling investigation by Sweta Shah -> two more noise sources
# needs the ttl-coupling-extension patch for synthlisa | |
noiseTDI = TDInoise(lisa, stime,Spm, stime,Sop, stime,0.0, stime,0.0, stime,0.0)
[tn, Xmn] = np.transpose(getobs(samples,stime,[noiseTDI.t, noiseTDI.Xm]))
specXmn = spect(Xmn,stime,patches=256)
freqmn, spXmn = specXmn[1:,0], specXmn[1:,1]
......
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