Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
pulsatingscience
Commits
794ad94d
Commit
794ad94d
authored
Sep 14, 2017
by
Bruce Allen
Browse files
Fix sign of psi, add phase shifts into plot (assuming starting at 30 Hz)
parent
9ae59e9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pulsaranimationwidget.cpp
View file @
794ad94d
...
...
@@ -368,7 +368,7 @@ void PulsarAnimationWidget::paintGL()
glPushMatrix
();
{
glRotatef
(
m_sourceInclination
+
23.5
,
0.0
,
0.0
,
1.0
);
glRotatef
(
-
m_sourceInclination
+
23.5
,
0.0
,
0.0
,
1.0
);
glRotatef
(
180
,
0.0
,
1.0
,
0.0
);
glRotatef
(
m_sourceIota
,
0.0
,
1.0
,
0.0
);
...
...
@@ -593,6 +593,7 @@ void PulsarAnimationWidget::updatePulseProfile()
{
struct
InputStruct
in
;
struct
OutputStruct
out
;
double
dx
[
3
];
in
.
iota
=
m_sourceIota
;
in
.
psi
=
m_sourceInclination
;
...
...
@@ -604,12 +605,24 @@ void PulsarAnimationWidget::updatePulseProfile()
get_antenna
(
&
out
,
&
in
);
// populate plot data object
// suppose that the initial frequency is 30 Hz and dx is the
// amount of x range in one cycle. That means that dx freq0= 360
// => dx = 360/freq0 = 30ms. Hence freq0 = 360/30ms. The phase
// delay in degrees caused by the offset in arrival time will then
// be phase_delay_degrees = freq0 * out.dt = 360*out.dt/30ms. The
// x delay is then freq0*dx=360*out.dt/30ms => dx =
// 360*out.dt/(freq0*30ms).
double
freq0
=
1.0
/
pow
(
1.1
,
0.375
);
for
(
int
i
=
0
;
i
<
3
;
i
++
)
dx
[
i
]
=
360
*
out
.
dt
[
0
]
/
(
30.0
*
freq0
);
for
(
int
x
=
0
;
x
<
360
*
PERIODS
;
++
x
)
{
double
t
=
x
/
(
PERIODS
*
360.0
);
double
freq
=
1.0
/
pow
(
1.1
-
t
,
0.375
);
m_plotData
.
m_dataLLO
[
x
]
=
out
.
amp
[
0
]
*
freq
*
freq
*
sin
((
freq
*
x
+
out
.
phase
[
0
])
*
deg2rad
);
// + out.dt[0];
m_plotData
.
m_dataLHO
[
x
]
=
out
.
amp
[
1
]
*
freq
*
freq
*
sin
((
freq
*
x
+
out
.
phase
[
1
])
*
deg2rad
);
// + out.dt[1];
m_plotData
.
m_dataVirgo
[
x
]
=
out
.
amp
[
2
]
*
freq
*
freq
*
sin
((
freq
*
x
+
out
.
phase
[
2
])
*
deg2rad
);
// + out.dt[2];
m_plotData
.
m_dataLLO
[
x
]
=
0.8
*
out
.
amp
[
0
]
*
freq
*
freq
*
sin
((
freq
*
(
x
+
dx
[
i
])
+
out
.
phase
[
0
])
*
deg2rad
);
m_plotData
.
m_dataLHO
[
x
]
=
0.8
*
out
.
amp
[
1
]
*
freq
*
freq
*
sin
((
freq
*
(
x
+
dx
[
1
])
+
out
.
phase
[
1
])
*
deg2rad
);
m_plotData
.
m_dataVirgo
[
x
]
=
0.8
*
out
.
amp
[
2
]
*
freq
*
freq
*
sin
((
freq
*
(
x
+
dx
[
2
])
+
out
.
phase
[
2
])
*
deg2rad
);
}
m_plotData
.
m_ampLLO
=
out
.
amp
[
0
];
...
...
src/pulsescopewidget.cpp
View file @
794ad94d
...
...
@@ -49,6 +49,7 @@ PulseScopeWidget::PulseScopeWidget(QWidget *parent) : QGraphicsView(parent),
}
m_scopeSizeH
=
360.0
*
PERIODS
;
// vertical axes range
m_scopeSizeV
=
10.0
;
m_pathLHO
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment