68 Eigen::Index n_dets = in.scans.data.cols();
69 Eigen::Index n_pts = in.scans.data.rows();
72 in.kernel.data.resize(n_pts,n_dets);
76 for (Eigen::Index i=0; i<n_dets; ++i) {
79 pixel_axes, in.pointing_offsets_arcsec.data,
map_grouping);
82 auto dist = ((lat.array()).pow(2) + (lon.array()).pow(2)).sqrt();
90 for (Eigen::Index j=0; j<n_pts; ++j) {
93 in.kernel.data(j,i) = exp(-0.5*pow(dist(j)/sigma,2));
96 in.kernel.data(j,i) = 0;
106 Eigen::Index n_dets = in.scans.data.cols();
107 Eigen::Index n_pts = in.scans.data.rows();
110 in.kernel.data.resize(n_pts,n_dets);
114 double off_lat = 0.0;
115 double off_lon = 0.0;
121 for (Eigen::Index i=0; i<n_dets; ++i) {
124 pixel_axes, in.pointing_offsets_arcsec.data,
map_grouping);
127 auto dist = ((lat.array()).pow(2) + (lon.array()).pow(2)).sqrt();
136 double rot_ang = apt[
"angle"](i);
138 auto cost2 = cos(rot_ang) * cos(rot_ang);
139 auto sint2 = sin(rot_ang) * sin(rot_ang);
140 auto sin2t = sin(2. * rot_ang);
141 auto xstd2 = sigma_lon * sigma_lon;
142 auto ystd2 = sigma_lat * sigma_lat;
143 auto a = - 0.5 * ((cost2 / xstd2) + (sint2 / ystd2));
144 auto b = - 0.5 * ((sin2t / xstd2) - (sin2t / ystd2));
145 auto c = - 0.5 * ((sint2 / xstd2) + (cost2 / ystd2));
147 double sigma_limit_det =
sigma_limit * (sigma_lat + sigma_lon)/2;
150 for (Eigen::Index j=0; j<n_pts; ++j) {
152 if (dist(j) <= sigma_limit_det) {
153 in.kernel.data(j,i) = amp*exp(pow(lon(j) - off_lon, 2) * a +
154 (lon(j) - off_lon) * (lat(j) - off_lat) * b +
155 pow(lat(j) - off_lat, 2) * c);
158 in.kernel.data(j,i) = 0;
167 Eigen::Index n_dets = in.scans.data.cols();
168 Eigen::Index n_pts = in.scans.data.rows();
170 in.kernel.data.resize(n_pts,n_dets);
175 for (Eigen::Index i=0; i<n_dets; ++i) {
178 pixel_axes, in.pointing_offsets_arcsec.data,
map_grouping);
181 auto dist = ((lat.array()).pow(2) + (lon.array()).pow(2)).sqrt();
185 fwhm =
ASEC_TO_RAD*(apt[
"a_fwhm"](i) + apt[
"b_fwhm"](i))/2;
189 double factor =
pi*(1.028/fwhm);
191 for (Eigen::Index j=0; j<n_pts; ++j) {
193 in.kernel.data(j,i) = pow(2*boost::math::cyl_bessel_j(1,factor*dist(j))/(factor*dist(j)),2);
196 in.kernel.data(j,i) = 0;
204 double pixel_size_rad, Eigen::DenseBase<Derived> &map_indices) {
206 Eigen::Index n_dets = in.scans.data.cols();
207 Eigen::Index n_pts = in.scans.data.rows();
209 in.kernel.data.resize(n_pts,n_dets);
211 Eigen::Index map_index = 0;
214 for (Eigen::Index i=0; i<n_dets; ++i) {
217 pixel_axes, in.pointing_offsets_arcsec.data,
map_grouping);
220 map_index = map_indices(i);
224 Eigen::VectorXd irows = lat.array()/pixel_size_rad + (
images[map_index].rows())/2.;
225 Eigen::VectorXd icols = lon.array()/pixel_size_rad + (
images[map_index].cols())/2.;
227 for (Eigen::Index j = 0; j<n_pts; ++j) {
229 Eigen::Index ir = irows(j);
230 Eigen::Index ic = icols(j);
233 if ((ir >= 0) && (ir <
images[map_index].rows()) && (ic >= 0) && (ic <
images[map_index].cols())) {
234 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:203
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