From f28a7240194c8e24b4dab54c99b333ad0189fc3a Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Tue, 24 Apr 2018 15:01:51 -0500 Subject: [PATCH] added support for a cutoff filter based on the objective NA --- bimsim.cu | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bimsim.cu b/bimsim.cu index 935e3da..2899b2f 100644 --- a/bimsim.cu +++ b/bimsim.cu @@ -289,6 +289,9 @@ void set_simulation(){ g_NA_obj[1] = args["objective"].as_float(0); //set the external condenser NA if(args["objective"].nargs() == 2) g_NA_obj[0] = args["objective"].as_float(1); //if the internal NA is specified, use it else g_NA_obj[0] = 0; //otherwise set the internal NA to zero + if (args["objective"].nargs() == 2) { + std::cout << "WARNING: This implementation of BIMSim does not currently support an objective central obscuration." << std::endl; + } if (args["simage"].is_set()) //if a source image is provided g_sources = simage(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[]){ std::chrono::high_resolution_clock::time_point t_begin = std::chrono::high_resolution_clock::now(); double P = 0; std::thread t1(progressbar_thread, &P); //start the progress bar thread + //for each point representing the illumination source for(size_t s = 0; s < g_sources.size(); s++){ stim::scalarbeam beam((float)g_lambda, 1, g_sources[s], d, (float)g_NA_cond[1], (float)g_NA_cond[0]); //create a focused beam @@ -355,7 +359,8 @@ int main(int argc, char* argv[]){ stim::filename incident_file = outfile.prefix(outfile.prefix() + "_0_nfi"); E0.image(incident_file.str(), stim::complexMag); } - E0.crop(g_padding, Eff); + E0.lowpass(stim::TAU / g_lambda * g_NA_obj[1]); //apply the objective cut-off filter to generate the far-field image + E0.crop(g_padding, Eff); //crop out the padding to get the final incident field Eff.intensity(I0); spheres.eval(E, beam, g_Nl, g_MC); @@ -372,6 +377,7 @@ int main(int argc, char* argv[]){ E.image(propagate_file.str(), stim::complexMag); } + E.lowpass(stim::TAU / g_lambda * g_NA_obj[1]); //apply the cut-off frequency to generate the far-field image E.crop(g_padding, Eff); //crop out the far field slice Eff.intensity(I); //calculate the far field intensity and add it to the single-beam image -- libgit2 0.21.4