71 Eigen::Index n_dets = in.scans.data.cols();
72 Eigen::Index n_pts = in.scans.data.rows();
75 in.kernel.data.resize(n_pts,n_dets);
79 for (Eigen::Index i=0; i<n_dets; ++i) {
82 pixel_axes, in.pointing_offsets_arcsec.data,
map_grouping);
85 auto dist = ((lat.array()).pow(2) + (lon.array()).pow(2)).sqrt();
93 for (Eigen::Index j=0; j<n_pts; ++j) {
96 in.kernel.data(j,i) = exp(-0.5*pow(dist(j)/sigma,2));
99 in.kernel.data(j,i) = 0;
109 Eigen::Index n_dets = in.scans.data.cols();
110 Eigen::Index n_pts = in.scans.data.rows();
113 in.kernel.data.resize(n_pts,n_dets);
117 double off_lat = 0.0;
118 double off_lon = 0.0;
124 for (Eigen::Index i=0; i<n_dets; ++i) {
127 pixel_axes, in.pointing_offsets_arcsec.data,
map_grouping);
130 auto dist = ((lat.array()).pow(2) + (lon.array()).pow(2)).sqrt();
139 double rot_ang = apt[
"angle"](i);
141 auto cost2 = cos(rot_ang) * cos(rot_ang);
142 auto sint2 = sin(rot_ang) * sin(rot_ang);
143 auto sin2t = sin(2. * rot_ang);
144 auto xstd2 = sigma_lon * sigma_lon;
145 auto ystd2 = sigma_lat * sigma_lat;
146 auto a = - 0.5 * ((cost2 / xstd2) + (sint2 / ystd2));
147 auto b = - 0.5 * ((sin2t / xstd2) - (sin2t / ystd2));
148 auto c = - 0.5 * ((sint2 / xstd2) + (cost2 / ystd2));
150 double sigma_limit_det =
sigma_limit * (sigma_lat + sigma_lon)/2;
153 for (Eigen::Index j=0; j<n_pts; ++j) {
155 if (dist(j) <= sigma_limit_det) {
156 in.kernel.data(j,i) = amp*exp(pow(lon(j) - off_lon, 2) * a +
157 (lon(j) - off_lon) * (lat(j) - off_lat) * b +
158 pow(lat(j) - off_lat, 2) * c);
161 in.kernel.data(j,i) = 0;
170 Eigen::Index n_dets = in.scans.data.cols();
171 Eigen::Index n_pts = in.scans.data.rows();
173 in.kernel.data.resize(n_pts,n_dets);
178 for (Eigen::Index i=0; i<n_dets; ++i) {
181 pixel_axes, in.pointing_offsets_arcsec.data,
map_grouping);
184 auto dist = ((lat.array()).pow(2) + (lon.array()).pow(2)).sqrt();
188 fwhm =
ASEC_TO_RAD*(apt[
"a_fwhm"](i) + apt[
"b_fwhm"](i))/2;
192 double factor =
pi*(1.028/fwhm);
194 for (Eigen::Index j=0; j<n_pts; ++j) {
196 in.kernel.data(j,i) = pow(2*boost::math::cyl_bessel_j(1,factor*dist(j))/(factor*dist(j)),2);
199 in.kernel.data(j,i) = 0;
207 double pixel_size_rad, Eigen::DenseBase<Derived> &map_indices) {
209 Eigen::Index n_dets = in.scans.data.cols();
210 Eigen::Index n_pts = in.scans.data.rows();
212 in.kernel.data.resize(n_pts,n_dets);
214 Eigen::Index map_index = 0;
217 for (Eigen::Index i=0; i<n_dets; ++i) {
220 pixel_axes, in.pointing_offsets_arcsec.data,
map_grouping);
223 map_index = map_indices(i);
227 Eigen::VectorXd irows = lat.array()/pixel_size_rad + (
images[map_index].rows())/2.;
228 Eigen::VectorXd icols = lon.array()/pixel_size_rad + (
images[map_index].cols())/2.;
230 for (Eigen::Index j = 0; j<n_pts; ++j) {
232 Eigen::Index ir = irows(j);
233 Eigen::Index ic = icols(j);
236 if ((ir >= 0) && (ir <
images[map_index].rows()) && (ic >= 0) && (ic <
images[map_index].cols())) {
237 in.kernel.data(j,i) =
images[map_index](ir,ic);
void create_kernel_from_fits(TCData< TCDataKind::RTC, Eigen::MatrixXd > &, std::string &, apt_t &, double, Eigen::DenseBase< Derived > &)
Definition kernel.h:206
auto calc_det_pointing(tel_data_t &tel_data, double az_off, double el_off, const std::string pixel_axes, pointing_offset_t &pointing_offsets, const std::string map_grouping)
Definition pointing.h:11