From 967e46a18b00f1a55612ff58d35af88300a6e5de Mon Sep 17 00:00:00 2001 From: dmayerich Date: Fri, 27 Sep 2013 14:44:28 -0500 Subject: [PATCH] added spectral script --- fileout.cu | 2 ++ microscope.cu | 9 ++++++--- nfScalarUf.cu | 1 + options.h | 2 ++ specimage.py | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100755 specimage.py diff --git a/fileout.cu b/fileout.cu index 076ea1a..8fdd091 100644 --- a/fileout.cu +++ b/fileout.cu @@ -114,6 +114,8 @@ void fileoutStruct::saveDetector(microscopeStruct* scope) if(is_binary(intFile)) I.toEnvi(intFile, scope->nf.lambda, append); + else + I.toImage(intFile); } //absorbance if(absFile != "") diff --git a/microscope.cu b/microscope.cu index e6197f3..21b5253 100644 --- a/microscope.cu +++ b/microscope.cu @@ -295,9 +295,12 @@ void microscopeStruct::LoadExtendedSource(std::string filename) //get the amplitude of the focal point QRgb rgb = sourceImage.pixel(x, y); //float A = qGray(rgb); - p.A = (ptype) qGray(rgb) / 255; + if(qGray(rgb) != 0) + { + p.A = (ptype) qGray(rgb) / 255; - //insert the point source into the list - focalPoints.push_back(p); + //insert the point source into the list + focalPoints.push_back(p); + } } } diff --git a/nfScalarUf.cu b/nfScalarUf.cu index 6bc0724..c19d767 100644 --- a/nfScalarUf.cu +++ b/nfScalarUf.cu @@ -151,6 +151,7 @@ __global__ void gpuScalarUf(bsComplex* Uf, bsVector k, ptype kmag, bsPoint f, pt } sumUf += il * jl * Pl * (Palpha[1] - Palpha[2] - Pbeta[1] + Pbeta[2]); + //sumUf += il * Pl * (Palpha[1] - Palpha[2] - Pbeta[1] + Pbeta[2]); il *= im; } diff --git a/options.h b/options.h index dfe29f5..d16d520 100644 --- a/options.h +++ b/options.h @@ -298,6 +298,8 @@ static void OutputOptions() { cout<nf.toStr(); + cout<<"# of source points: "<focalPoints.size()<