diff --git a/src/kat.h b/src/kat.h index 30c4f1bf81ee325f1231b334397a4b7b2775b3db..caa998f18254bdb03ba99fb02ed167da3168bf8a 100755 --- a/src/kat.h +++ b/src/kat.h @@ -635,6 +635,8 @@ typedef struct surface_merged_map { /** True if a transmission map is merged into this */ bool hasTransmissionMaps; + double map_amplitude; + knm_workspace_t knm_ws; } surface_merged_map_t; @@ -770,6 +772,8 @@ typedef struct mirror { double r_aperture; //!< physical size of mirror, infinite if set to 0 aperture_type_t aperture_type; + double map_amplitude; + double x_off; double y_off; double Rcx; //!< radius of curvature in x plane (tangential) diff --git a/src/kat_knm_mirror.c b/src/kat_knm_mirror.c index fa2ecda3bbbb2d75a41bdc619248e37645e22d35..a9706e6fa069f848a10d33b7225134e62d4d7da6 100644 --- a/src/kat_knm_mirror.c +++ b/src/kat_knm_mirror.c @@ -1272,9 +1272,9 @@ void compute_mirror_knm_integral(mirror_t *mirror, double nr1, double nr2, bitfl recompute = recompute | (map->_nr1 != nr1); recompute = recompute | (map->_nr2 != nr2); - recompute = recompute | (map->_angle != mirror->angle); + recompute = recompute | !eq(mirror->map_amplitude, map->map_amplitude); recompute = recompute | !ceq(mirror->knm_q.qxt1_11, map->mirror_knm_q.qxt1_11); recompute = recompute | !ceq(mirror->knm_q.qxt2_11, map->mirror_knm_q.qxt2_11); recompute = recompute | !ceq(mirror->knm_q.qyt1_11, map->mirror_knm_q.qyt1_11); @@ -1666,10 +1666,10 @@ void compute_mirror_knm_integral(mirror_t *mirror, double nr1, double nr2, bitfl ipfile = NULL; } - knm->k11[n][m] = results[0]; - knm->k12[n][m] = results[1]; - knm->k21[n][m] = results[2]; - knm->k22[n][m] = results[3]; + knm->k11[n][m] = z_by_x(results[0], mirror->map_amplitude); + knm->k12[n][m] = z_by_x(results[1], mirror->map_amplitude); + knm->k21[n][m] = z_by_x(results[2], mirror->map_amplitude); + knm->k22[n][m] = z_by_x(results[3], mirror->map_amplitude); // If we have a mode matched beam we are able to calculate the transposed // elements by applying a simple phase factor @@ -1704,7 +1704,7 @@ void compute_mirror_knm_integral(mirror_t *mirror, double nr1, double nr2, bitfl map->_lambda = init.lambda; map->_nr1 = nr1; map->_nr2 = nr2; - + map->map_amplitude = mirror->map_amplitude; map->mirror_knm_q.qxt1_11 = mirror->knm_q.qxt1_11; map->mirror_knm_q.qxt2_11 = mirror->knm_q.qxt2_11; map->mirror_knm_q.qyt1_11 = mirror->knm_q.qyt1_11; diff --git a/src/kat_read.c b/src/kat_read.c index 4104de98f7c0241715903ac8f8bbd5da9895be86..0e44830f0e173d89d061c8c2605a048e332a51a2 100755 --- a/src/kat_read.c +++ b/src/kat_read.c @@ -10584,7 +10584,14 @@ int assign_mirror_parameter(component_param_t *component_param) { strcpy(component_param->unit, " [deg]"); *component_param->lborder = 0; *component_param->uborder = 0; - + } else if (strcasecmp("map_amp", component_param->parameter) == 0){ + *component_param->xparam = &(mirror->map_amplitude); + mirror->rebuild = 1; + inter.rebuild |= 1; + strcpy(component_param->unit, " [real]"); + *component_param->lborder = -1; + *component_param->uborder = 1; + } else if (strcasecmp("dither_f", component_param->parameter) == 0) { *component_param->xparam = &(mirror->dither_f); strcpy(component_param->unit, " [Hz]");