Code C7: Waveform comparison
Last edited by Jens Boos (jens.boos@kit.edu), Oct 9, 2024.
(For definitions and conventions refer to the lecture notes.)
Website: http://www.spintwo.net/Courses/EMRI-101/

<<CustomTicks`
SetDirectory[NotebookDirectory[]];

(* load waveforms *)
schwp=Import["emri-101-d1-schw-plus-tau-0-50.dat","Table"];
schwc=Import["emri-101-d2-schw-cross-tau-0-50.dat","Table"];
reissp=Import["emri-101-d3-reiss-plus-tau-0-50.dat","Table"];
reissc=Import["emri-101-d4-reiss-cross-tau-0-50.dat","Table"];

p0[size_,dat1_,dat2_,amp_]:=ListPlot[{dat1,dat2},
Axes->False,
Frame->True,
Joined->True,
FrameStyle->{{Gray,AbsoluteThickness[(size/800)]},{Gray,AbsoluteThickness[(size/800)]},{Gray,AbsoluteThickness[(size/800)]},{Gray,AbsoluteThickness[(size/800)]}},
					FrameTicksStyle->Directive[FontSize->25(size/800)],
FrameTicks->{{LinTicks[-amp,amp,TickLabelStep->1,MajorTickLength->0.01,MinorTickLength->0.005,TickLabelFunction->(Framed[#2,FrameStyle->None,FrameMargins->3.5(size/500)]&)],None},				
{LinTicks[0,50,TickLabelStep->1,MajorTickLength->0.01,MinorTickLength->0.005,TickLabelFunction->(Framed[#2,FrameStyle->None,FrameMargins->0.5(size/500)]&)],None}},
PlotStyle->{
Directive[ColorData[97,"ColorList"][[1]],Thickness[0.0035]],
Directive[ColorData[97,"ColorList"][[2]],Thickness[0.0035]]
},
GridLines->Automatic,
AspectRatio->0.626,
ImageSize->size];

Show[p0[600,schwp,schwc,40]]
Export["plot-schw-v1.png",Show[p0[2000,schwp,schwc,40]]];

Show[p0[600,reissp,reissc,40]]
Export["plot-reiss-v1.png",Show[p0[2000,reissp,reissc,40]]];

diffp=Transpose[{schwp[[All,1]],(schwp-reissp)[[All,2]]}];
diffc=Transpose[{schwc[[All,1]],(schwc-reissc)[[All,2]]}];
Show[p0[600,diffp,diffc,1],PlotRange->{Automatic,{-0.75,0.75}}]
Export["plot-diff-v1.png",Show[p0[2000,diffp,diffc,1],PlotRange->{Automatic,{-0.75,0.75}}]];