Commit 0dccb7d4 authored by Alexander Lapshin's avatar Alexander Lapshin

.

parent b4d011f3
......@@ -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";
......
......@@ -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;
}
......@@ -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;
......
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