Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
imager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NML
imager
Commits
e529054a
Commit
e529054a
authored
3 years ago
by
mingf2
Browse files
Options
Downloads
Patches
Plain Diff
fix marker position
parent
4868b6f3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Headers/draw.h
+2
-2
2 additions, 2 deletions
Headers/draw.h
Headers/setup.h
+4
-4
4 additions, 4 deletions
Headers/setup.h
Sources/draw.cpp
+13
-24
13 additions, 24 deletions
Sources/draw.cpp
Sources/main.cpp
+1
-3
1 addition, 3 deletions
Sources/main.cpp
with
20 additions
and
33 deletions
Headers/draw.h
+
2
−
2
View file @
e529054a
...
...
@@ -7,8 +7,7 @@
#include
"TH2F.h"
#include
"TGraph.h"
#include
"TStyle.h"
// #include "TEllipse.h"
#include
"TMarker.h"
#include
"TEllipse.h"
#include
"../Headers/setup.h"
...
...
@@ -17,4 +16,5 @@ int Backprojection(const Setup& config, const std::vector<Cone>& cones,
int
drawImage
(
const
Setup
&
config
,
const
std
::
vector
<
std
::
vector
<
double
>>&
image
);
// convert cartesian to worldmap coordinates
int
aitoff2xy
(
const
double
&
l
,
const
double
&
b
,
double
&
Al
,
double
&
Ab
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Headers/setup.h
+
4
−
4
View file @
e529054a
...
...
@@ -56,11 +56,11 @@ public:
// image setup
// Altitude angle, rad
const
int
thetaBins
=
1
79
;
const
int
thetaBins
=
1
80
;
const
int
phiBins
=
360
;
const
double
dtheta
=
1
79
/
double
(
thetaBins
)
*
M_PI
/
180
;
const
double
thetaMin
=
-
8
9
*
M_PI
/
180
;
const
double
thetaMax
=
8
9
*
M_PI
/
180
;
const
double
dtheta
=
1
80
/
double
(
thetaBins
)
*
M_PI
/
180
;
const
double
thetaMin
=
-
9
0
*
M_PI
/
180
+
dtheta
/
2
;
const
double
thetaMax
=
9
0
*
M_PI
/
180
-
dtheta
/
2
;
// Azimuthal angle, rad
const
double
dphi
=
2
*
M_PI
/
double
(
phiBins
);
const
double
phiMin
=
-
M_PI
+
dphi
/
2
;
...
...
This diff is collapsed.
Click to expand it.
Sources/draw.cpp
+
13
−
24
View file @
e529054a
...
...
@@ -46,13 +46,13 @@ int Backprojection(const Setup& config, const std::vector<Cone>& cones,
int
drawImage
(
const
Setup
&
config
,
const
std
::
vector
<
std
::
vector
<
double
>>&
image
){
TH2D
*
histo
=
new
TH2D
(
"ROI"
,
" ; Azimuth; Elevation"
,
config
.
phiBins
,
-
180
,
180
,
config
.
thetaBins
,
-
89.5
,
89.5
);
config
.
thetaBins
,
-
90
,
90
);
TCanvas
*
canvas
=
new
TCanvas
(
"THCanvas"
,
"Sinocanvas"
,
1000
,
500
);
for
(
int
i
=
1
;
i
<
=
config
.
phiBins
;
i
++
)
for
(
int
i
=
0
;
i
<
config
.
phiBins
;
i
++
)
{
for
(
int
j
=
1
;
j
<
config
.
thetaBins
;
j
++
)
for
(
int
j
=
0
;
j
<
config
.
thetaBins
;
j
++
)
{
histo
->
SetBinContent
(
i
,
j
,
image
[
j
][
i
]);
histo
->
SetBinContent
(
i
+
1
,
j
+
1
,
image
[
j
][
i
]);
}
}
gStyle
->
SetOptStat
(
0
);
...
...
@@ -60,7 +60,7 @@ int drawImage(const Setup& config, const std::vector<std::vector<double>>& image
histo
->
Draw
(
"z aitoff"
);
// grid
float
conv
=
M_PI
/
180
;
// I am also aware of TMath::DegToRad() and TMath::Pi() which could be used there...
float
conv
=
M_PI
/
180
;
float
la
,
lo
,
x
,
y
,
z
;
const
int
Nl
=
19
;
// Number of drawn latitudes
...
...
@@ -116,27 +116,16 @@ int drawImage(const Setup& config, const std::vector<std::vector<double>>& image
for
(
int
j
=
0
;
j
<
NL
;
++
j
)
longitudes
[
j
]
->
Draw
(
"l"
);
// // // canvas1->cd(4)->SetLogz();
// // // draw source 1
// // TEllipse* el1 = new TEllipse(86.5276, 0, 5., 5.);
// // el1->SetFillColor(0);
// // el1->SetFillStyle(0);
// // el1->SetLineColor(4);
// // el1->Draw("SAME");
// draw source 2
// double sigma = 5;
// TEllipse* el2 = new TEllipse(config.truePhi / conv, config.trueTheta / conv, sigma, sigma);
// el2->SetFillColor(0);
// el2->SetFillStyle(0);
// el2->SetLineColor(4);
// el2->Draw("SAME");
// draw source in aitoff
// draw source marker
double
sigma
=
1
;
double
Ax
,
Ay
;
aitoff2xy
(
config
.
truePhi
/
conv
,
config
.
trueTheta
/
conv
,
Ax
,
Ay
);
TMarker
*
marker
=
new
TMarker
(
Ax
,
Ay
,
24
);
// marker->SetMarkerColorAlpha(kBlue, 0.0);
marker
->
Draw
(
"SAME"
);
TEllipse
*
el2
=
new
TEllipse
(
Ax
,
Ay
,
sigma
,
sigma
);
el2
->
SetFillColor
(
0
);
el2
->
SetFillStyle
(
0
);
el2
->
SetLineWidth
(
2
);
el2
->
SetLineColor
(
kRed
);
el2
->
Draw
(
"SAME"
);
canvas
->
Draw
();
...
...
This diff is collapsed.
Click to expand it.
Sources/main.cpp
+
1
−
3
View file @
e529054a
...
...
@@ -14,9 +14,7 @@ int main(int argc, char** argv) {
const
Setup
config
(
10
);
// simulate some cones
std
::
vector
<
Cone
>
cones
;
// std::srand(std::time(nullptr));
std
::
srand
(
0
);
// for (int i = 0; i < 10; i++)
std
::
srand
(
std
::
time
(
nullptr
));
for
(
int
i
=
0
;
i
<
config
.
nCones
;
i
++
)
{
cones
.
push_back
(
createCone
(
config
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment