Commit 62538609 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Merge branch 'improve_model' into 'jeroen'

Improve model

See merge request !14
parents 749d3ff1 1cc4583a
...@@ -63,16 +63,16 @@ struct dt_model_params *params = &dt_model_default; ...@@ -63,16 +63,16 @@ struct dt_model_params *params = &dt_model_default;
double dt_model_azimuth_delta(double az, double el) double dt_model_azimuth_delta(double az, double el)
{ {
double delta_az; double delta_az;
double c1_div_cos_el = params->c1 / cos(el); double c1_div_cos_el = params->c1 / cos(2*M_PI*el/360.);
if (isnan(c1_div_cos_el)) if (isnan(c1_div_cos_el))
c1_div_cos_el = 0.0; c1_div_cos_el = 0.0;
delta_az = delta_az =
params->a0 params->a0
+ params->c1 / cos(el) + params->c1 / cos(2*M_PI*el/360.)
- params->c2 * tan(el) - params->c2 * tan(2*M_PI*el/360.)
- params->za * sin(az - params->aa) * tan(el); - params->za * sin(az - params->aa) * tan(2*M_PI*el/360.);
return delta_az; return delta_az;
} }
...@@ -80,7 +80,8 @@ double dt_model_azimuth_delta(double az, double el) ...@@ -80,7 +80,8 @@ double dt_model_azimuth_delta(double az, double el)
double dt_model_azimuth_delta_rev(double az, double el) double dt_model_azimuth_delta_rev(double az, double el)
{ {
/* No reverse model available, (ab)use the forward model */ /* No reverse model available, (ab)use the forward model */
return -dt_model_azimuth_delta(az, el); return -dt_model_azimuth_delta(az - params->a0 - params->c1/cos(2*M_PI*(el-params->e0)/360.),
el - params->e0);
} }
double dt_model_elevation_delta(double az, double el) double dt_model_elevation_delta(double az, double el)
...@@ -89,16 +90,17 @@ double dt_model_elevation_delta(double az, double el) ...@@ -89,16 +90,17 @@ double dt_model_elevation_delta(double az, double el)
delta_el = delta_el =
params->e0 params->e0
+ params->b * cos(el) + params->b * cos(2*M_PI*el/360.)
- params->za * cos(az - params->aa); - params->za * cos(2*M_PI*(az - params->aa)/360.);
return delta_el; return delta_el;
} }
double dt_model_elevation_delta_rev(double az, double el) double dt_model_elevation_delta_rev(double az, double el)
{ {
/* No reverse model available, (ab)use the forward model */ /* No reverse model available, (ab)use the forward model */
return -dt_model_elevation_delta(az, el); return -dt_model_elevation_delta(az - params->a0 - params->c1/cos(2*M_PI*(el-params->e0)/360.),
el - params->e0);
} }
int dt_model_init(void) int dt_model_init(void)
......
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