Commit f28a7240194c8e24b4dab54c99b333ad0189fc3a

Authored by David Mayerich
1 parent e4c3ae76

added support for a cutoff filter based on the objective NA

Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
bimsim.cu
... ... @@ -289,6 +289,9 @@ void set_simulation(){
289 289 g_NA_obj[1] = args["objective"].as_float(0); //set the external condenser NA
290 290 if(args["objective"].nargs() == 2) g_NA_obj[0] = args["objective"].as_float(1); //if the internal NA is specified, use it
291 291 else g_NA_obj[0] = 0; //otherwise set the internal NA to zero
  292 + if (args["objective"].nargs() == 2) {
  293 + std::cout << "WARNING: This implementation of BIMSim does not currently support an objective central obscuration." << std::endl;
  294 + }
292 295  
293 296 if (args["simage"].is_set()) //if a source image is provided
294 297 g_sources = simage<float>(g_S_ff, args["simage"].as_string()); //convert the image to a list of sources
... ... @@ -346,6 +349,7 @@ int main(int argc, char* argv[]){
346 349 std::chrono::high_resolution_clock::time_point t_begin = std::chrono::high_resolution_clock::now();
347 350 double P = 0;
348 351 std::thread t1(progressbar_thread, &P); //start the progress bar thread
  352 + //for each point representing the illumination source
349 353 for(size_t s = 0; s < g_sources.size(); s++){
350 354 stim::scalarbeam<float> beam((float)g_lambda, 1, g_sources[s], d, (float)g_NA_cond[1], (float)g_NA_cond[0]); //create a focused beam
351 355  
... ... @@ -355,7 +359,8 @@ int main(int argc, char* argv[]){
355 359 stim::filename incident_file = outfile.prefix(outfile.prefix() + "_0_nfi");
356 360 E0.image(incident_file.str(), stim::complexMag);
357 361 }
358   - E0.crop(g_padding, Eff);
  362 + E0.lowpass(stim::TAU / g_lambda * g_NA_obj[1]); //apply the objective cut-off filter to generate the far-field image
  363 + E0.crop(g_padding, Eff); //crop out the padding to get the final incident field
359 364 Eff.intensity(I0);
360 365  
361 366 spheres.eval(E, beam, g_Nl, g_MC);
... ... @@ -372,6 +377,7 @@ int main(int argc, char* argv[]){
372 377 E.image(propagate_file.str(), stim::complexMag);
373 378 }
374 379  
  380 + E.lowpass(stim::TAU / g_lambda * g_NA_obj[1]); //apply the cut-off frequency to generate the far-field image
375 381 E.crop(g_padding, Eff); //crop out the far field slice
376 382 Eff.intensity(I); //calculate the far field intensity and add it to the single-beam image
377 383  
... ...