Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexander Lapshin
common
Commits
0dccb7d4
Commit
0dccb7d4
authored
Apr 23, 2020
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b4d011f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
22 deletions
+24
-22
json_functions.h
json/json_functions.h
+2
-0
MagData.cpp
utils/MagData.cpp
+16
-16
MagData.h
utils/MagData.h
+6
-6
No files found.
json/json_functions.h
View file @
0dccb7d4
...
...
@@ -161,6 +161,8 @@ static bool loadjson(const jsonval& parent, const std::string& key, std::vector<
for
(
jsonval
::
ConstValueIterator
it
=
a
.
Begin
();
it
!=
a
.
End
();
++
it
)
{
if
(
it
->
IsDouble
())
{
vec
.
push_back
(
it
->
GetDouble
());
}
else
if
(
it
->
IsInt
())
{
vec
.
push_back
(
it
->
GetInt
());
}
else
{
throw
Exp
()
<<
"error: unsupported type"
;
...
...
utils/MagData.cpp
View file @
0dccb7d4
...
...
@@ -12,7 +12,7 @@ void MagData::SetOpticData(const double stdphase_deg, const double stdtrange_km,
m_stdmag
=
stdmag
;
}
void
MagData
::
SetGeomData
(
double
rcs
,
double
albedo
)
void
MagData
::
SetGeomData
(
const
double
rcs
,
const
double
albedo
)
{
m_hasGeomData
=
true
;
m_mag
=
0
;
...
...
@@ -28,33 +28,33 @@ void MagData::load(const jsonval& parent)
m_hasData
=
true
;
}
double
MagData
::
CalcA0g
(
double
stdmag
,
double
stdphase
,
double
stdrange
,
double
sunMag
)
double
MagData
::
CalcA0g
(
const
double
stdmag
,
const
double
stdphase_rad
,
const
double
stdrange_tkm
,
const
double
sunMag
)
{
const
double
C
=
pow
(
10.0
,
((
sunMag
-
stdmag
)
/
2.5
));
const
double
F
=
2
/
3.0
*
sqr
(
Pi
)
*
((
Pi
-
stdphase
)
*
cos
(
stdphase
)
+
sin
(
stdphase
))
*
(
1
-
stdphase
/
Pi
);
return
C
*
sqr
(
stdrange
*
1E6
)
/
F
;
const
double
F
=
2
/
3.0
*
sqr
(
Pi
)
*
((
Pi
-
stdphase
_rad
)
*
cos
(
stdphase_rad
)
+
sin
(
stdphase_rad
))
*
(
1
-
stdphase_rad
/
Pi
);
return
C
*
sqr
(
stdrange
_tkm
*
1E6
)
/
F
;
}
double
MagData
::
CalcRealMag
(
double
A0g
,
double
sunMag
,
double
phase
,
double
range
)
double
MagData
::
CalcRealMag
(
const
double
A0g
,
const
double
sunMag
,
const
double
phase_rad
,
const
double
range_tkm
)
{
const
double
F
=
2
/
3.0
*
sqr
(
Pi
)
*
((
Pi
-
phase
)
*
cos
(
phase
)
+
sin
(
phase
))
*
(
1
-
phase
/
Pi
);
return
sunMag
-
2.5
*
log10
(
F
*
A0g
/
sqr
(
range
*
1E6
));
const
double
F
=
2
/
3.0
*
sqr
(
Pi
)
*
((
Pi
-
phase
_rad
)
*
cos
(
phase_rad
)
+
sin
(
phase_rad
))
*
(
1
-
phase_rad
/
Pi
);
return
sunMag
-
2.5
*
log10
(
F
*
A0g
/
sqr
(
range
_tkm
*
1E6
));
}
void
MagData
::
CalcMag
(
double
phase
,
double
range
)
void
MagData
::
CalcMag
(
const
double
phase_rad
,
const
double
range_tkm
)
{
const
double
sunMag
=
-
26.58
;
m_mag
=
CalcRealMag
(
CalcA0g
(
m_stdmag
,
m_stdphase_rad
,
m_stdrange_tkm
,
sunMag
),
sunMag
,
phase
,
range
);
m_phase
=
phase
;
m_range
=
range
;
m_mag
=
CalcRealMag
(
CalcA0g
(
m_stdmag
,
m_stdphase_rad
,
m_stdrange_tkm
,
sunMag
),
sunMag
,
phase
_rad
,
range_tkm
);
m_phase
_rad
=
phase_rad
;
m_range
_tkm
=
range_tkm
;
}
void
MagData
::
CalcGeomMag
(
double
phase
,
double
range
)
void
MagData
::
CalcGeomMag
(
const
double
phase_rad
,
const
double
range_tkm
)
{
const
double
sunMag
=
-
26.58
;
const
double
F
=
2
/
3.0
*
sqr
(
Pi
)
*
((
Pi
-
phase
)
*
cos
(
phase
)
+
sin
(
phase
))
*
(
1
-
phase
/
Pi
);
const
double
F
=
2
/
3.0
*
sqr
(
Pi
)
*
((
Pi
-
phase
_rad
)
*
cos
(
phase_rad
)
+
sin
(
phase_rad
))
*
(
1
-
phase_rad
/
Pi
);
const
double
A0g
=
m_rcs
*
0.15
;
m_mag
=
sunMag
-
2.5
*
log10
(
F
*
A0g
/
sqr
(
range
*
1E6
));
m_phase
=
phase
;
m_range
=
range
;
m_mag
=
sunMag
-
2.5
*
log10
(
F
*
A0g
/
sqr
(
range
_tkm
*
1E6
));
m_phase
_rad
=
phase_rad
;
m_range
_tkm
=
range_tkm
;
}
utils/MagData.h
View file @
0dccb7d4
...
...
@@ -13,20 +13,20 @@ public:
double
GetRcs
()
const
{
return
m_rcs
;
}
bool
HasData
()
const
{
return
m_hasData
;
}
bool
HasGeomData
()
const
{
return
m_hasGeomData
;
}
void
CalcMag
(
double
phase
,
double
range
);
void
CalcGeomMag
(
double
phase
,
double
range
);
void
CalcMag
(
double
phase
_rad
,
double
range_tkm
);
void
CalcGeomMag
(
double
phase
_rad
,
double
range_tkm
);
double
get_std_mag
()
const
{
return
m_stdmag
;
}
double
get_std_phase
()
const
{
return
m_stdphase_rad
;
}
double
get_std_range
()
const
{
return
m_stdrange_tkm
;
}
private
:
static
double
CalcA0g
(
double
stdmag
,
double
stdphase
,
double
stdrange
,
double
sunMag
);
static
double
CalcRealMag
(
double
A0g
,
double
sunMag
,
double
phase
,
double
range
);
static
double
CalcA0g
(
double
stdmag
,
double
stdphase
_rad
,
double
stdrange_tkm
,
double
sunMag
);
static
double
CalcRealMag
(
double
A0g
,
double
sunMag
,
double
phase
_rad
,
double
range_tkm
);
double
m_stdmag
;
double
m_stdphase_rad
{
0
};
double
m_stdrange_tkm
{
40
};
double
m_phase
;
double
m_range
;
double
m_phase
_rad
;
double
m_range
_tkm
;
double
m_mag
;
double
m_rcs
;
double
m_albedo
;
...
...
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