Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
docs
  • Loading branch information
bsumlin committed Sep 25, 2017
1 parent 2cdbcc4 commit 69ae8a8
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 29 deletions.
4 changes: 2 additions & 2 deletions PyMieScatt/Inverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ def fastMie_SD(m, wavelength, ndpdp, ndp):
for i in range(_length):
Q_sca[i],Q_abs[i],_ = fastMieQ(m,wavelength,ndpdp[i])

Bsca = trapz(Q_sca*aSDn)
Babs = trapz(Q_abs*aSDn)
Bsca = trapz(Q_sca*aSDn,ndpdp)
Babs = trapz(Q_abs*aSDn,ndpdp)

return Bsca, Babs

Expand Down
2 changes: 1 addition & 1 deletion PyMieScatt/Mie.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def SF_withSizeDistribution(m, wavelength, ndp, dp, minAngle=0, maxAngle=180, an
SU = np.zeros(_steps)
for num,size in zip(ndp,dp):
if space=='qspace':
measure,l,r,u = qSpaceScatteringFunction(m,wavelength,size,minAngle=minAngle,maxAngle=maxAngle,angularResolution=angularResolution)
measure,l,r,u = ScatteringFunction(m,wavelength,size,minAngle=minAngle,maxAngle=maxAngle,angularResolution=angularResolution,space='qspace')
else:
measure,l,r,u = ScatteringFunction(m,wavelength,size,minAngle=minAngle,maxAngle=maxAngle,angularResolution=angularResolution)
SL += l*num
Expand Down
7 changes: 5 additions & 2 deletions build/lib/PyMieScatt/Inverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,11 @@ def fastMie_SD(m, wavelength, ndpdp, ndp):
for i in range(_length):
Q_sca[i],Q_abs[i],_ = fastMieQ(m,wavelength,ndpdp[i])

Bsca = trapz(Q_sca*aSDn)
Babs = trapz(Q_abs*aSDn)
# Bsca = trapz(Q_sca*aSDn,ndpdp)
# Babs = trapz(Q_abs*aSDn,ndpdp)

Bsca = np.sum(Q_sca*aSDn)
Babs = np.sum(Q_abs*aSDn)

return Bsca, Babs

Expand Down
23 changes: 1 addition & 22 deletions build/lib/PyMieScatt/Mie.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,27 +255,6 @@ def ScatteringFunction(m, wavelength, diameter, minAngle=0, maxAngle=180, angula
measure = (4*np.pi/wavelength)*np.sin(measure/2)*(diameter/2)
return measure,SL,SR,SU

def qSpaceScatteringFunction(m,wavelength,diameter,minAngle=0,maxAngle=180,angularResolution=0.5,normed=False):
# http://pymiescatt.readthedocs.io/en/latest/forward.html#qSpaceScatteringFunction
x = np.pi*diameter/wavelength
_steps = int(1+(maxAngle-minAngle)/angularResolution)
theta = np.logspace(np.log10(minAngle),np.log10(maxAngle),_steps)*np.pi/180
qR = (4*np.pi/wavelength)*np.sin(theta/2)*(diameter/2)
SL = np.zeros(_steps)
SR = np.zeros(_steps)
SU = np.zeros(_steps)
for j in range(_steps):
u = np.cos(theta[j])
S1, S2 = MieS1S2(m,x,u)
SL[j] = (np.sum(np.conjugate(S1)*S1)).real
SR[j] = (np.sum(np.conjugate(S2)*S2)).real
SU[j] = (SR[j]+SL[j])/2
if normed:
SL /= np.max(SL)
SR /= np.max(SR)
SU /= np.max(SU)
return qR,SL,SR,SU

def SF_withSizeDistribution(m, wavelength, ndp, dp, minAngle=0, maxAngle=180, angularResolution=0.5, space='theta', normed=False):
# http://pymiescatt.readthedocs.io/en/latest/forward.html#SF_withSizeDistribution
_steps = int(1+maxAngle/angularResolution)
Expand All @@ -286,7 +265,7 @@ def SF_withSizeDistribution(m, wavelength, ndp, dp, minAngle=0, maxAngle=180, an
SU = np.zeros(_steps)
for num,size in zip(ndp,dp):
if space=='qspace':
measure,l,r,u = qSpaceScatteringFunction(m,wavelength,size,minAngle=minAngle,maxAngle=maxAngle,angularResolution=angularResolution)
measure,l,r,u = ScatteringFunction(m,wavelength,size,minAngle=minAngle,maxAngle=maxAngle,angularResolution=angularResolution,space='qspace')
else:
measure,l,r,u = ScatteringFunction(m,wavelength,size,minAngle=minAngle,maxAngle=maxAngle,angularResolution=angularResolution)
SL += l*num
Expand Down
2 changes: 1 addition & 1 deletion build/lib/PyMieScatt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A collection of forward and inverse Mie routines, q-Space analysis tools, and structure factor tools

from PyMieScatt.Mie import MieQ, RayleighMieQ, LowFrequencyMieQ, Mie_withSizeDistribution, ScatteringFunction, SF_withSizeDistribution, qSpaceScatteringFunction, MatrixElements, MieQ_withDiameterRange, MieQ_withWavelengthRange, MieQ_withSizeParameterRange, Mie_Lognormal
from PyMieScatt.Mie import MieQ, RayleighMieQ, LowFrequencyMieQ, Mie_withSizeDistribution, ScatteringFunction, SF_withSizeDistribution, MatrixElements, MieQ_withDiameterRange, MieQ_withWavelengthRange, MieQ_withSizeParameterRange, Mie_Lognormal
from PyMieScatt.CoreShell import MieQCoreShell, CoreShellScatteringFunction, CoreShellMatrixElements
from PyMieScatt.Inverse import GraphicalInversion, GraphicalInversion_SD, IterativeInversion, IterativeInversion_SD, Inversion, Inversion_SD
from PyMieScatt._version import __version__
Binary file modified dist/PyMieScatt-1.2.1-py3-none-any.whl
Binary file not shown.
Binary file modified dist/PyMieScatt-1.2.1.tar.gz
Binary file not shown.
5 changes: 4 additions & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,7 @@ Recently, a colleague needed to know how much light a distribution of salt aeros
xytext=(2*np.pi/5, 2), textcoords='data',
arrowprops=dict(arrowstyle="->",
connectionstyle="arc3"),
)
)
.. image:: images/saltsif.png
Binary file added docs/images/saltsif.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 69ae8a8

Please sign in to comment.