usnistgov / pySCATMECH

pySCATMECH is a Python interface to SCATMECH: Polarized Light Scattering C++ Class Library
https://pages.nist.gov/pySCATMECH/index.html
Other
30 stars 12 forks source link

The "density" parameter does not work in the BV local model #3

Open LYXCoding opened 1 year ago

LYXCoding commented 1 year ago

First of all, thank Germer @thomas-germer lot for this useful open source code project, which helped me in my work.

During my using local BRDF model, I found below issue.

particleModel = Local_BRDF_Model("Bobbert_Vlieger_BRDF_Model",parameters)

As for the above model, if we change the value for the 'density' key in the parameters dict, the result(DSC, or cross section) does not change, which I believe should be changed as the MIST sw does.

parameters = {'lambda' : 0.532, 'substrate' : Si, 'type' : 0, 'sphere' : SiO2, 'radius' : diameter/2, 'spherecoat' : spherecoat, 'stack' : stack, 'density': 1, 'delta' : 0, 'lmax' : 0, 'order' : -1, 'Norm_Inc_Approx' : 0, 'improve' : 3}

BTW, the default value for density is 1, but the DSC or cross section result with density=1 does not match with MIST output with the same parameters,

thomas-germer commented 1 year ago

Models that inherit Local_BRDF_Model in SCATMECH have the parameter "density," since a Local_BRDF_Model is a BRDF_Model which in turn must return a BRDF. The internal code for all classes inheriting Local_BRDF_Model calculate a differential scattering cross section (DSC) instead of the BRDF, and the virtual class Local_BRDF_Model multiplies the DSC by density/cos(thetai)/cos(thetas) to determine the BRDF for a uniform flat surface covered with these local scatterers.

A Local_BRDF_Model in pySCATMECH provides access to the DSC functionality of Local_BRDF_Model. Unfortunately, the way these models are set up, the parameter "density" is there, but it is not used.

The DSC is a characteristic of an individual scatterer and does not depend upon the density of those scatterers.

I hope this helps!

LYXCoding commented 1 year ago

Thanks a lot for the reply! image

But I'm still a little bit confused why MIST use this paramter differently for calculating the integrated cross section. As explained above on the NIST website, this parameter should set as cos(thetai) when one wants to calculate the integrated cross section for an isolated particle, and if set it another value, the result will be changed. But in pySCATMECH, it seems not need to set this parameter, and no matter what value set to this paramter, the result will NOT be changed.

thomas-germer commented 1 year ago

It is a kludge. MIST only accesses the BRDF functionality of BRDF_Model in SCATMECH. If you are interested in cross section of individual particles, you need to reverse the calculation that goes from cross section to BRDF. One way to do that is to set the parameter density to cos(incidentangle). You could also do this by setting density to 1, but further down, in the OUTPUTS section, to output crosssection = Detector*cos(incidentangle).

I hope this helps!

LYXCoding commented 1 year ago

Thanks Germer! Yes, it helps. I see why I was confused by this cos(incidentangle) thing. In the pySCATMECH document, the definition of the BRDF of local defects is below one, which has cos(thetai) in the definition, so if one wants cross section then need to calculate it from BRDF*cos(thetai), is this right? image

But in Stover's paper, the definition of dsc is : image

there is no cos(thetai), could you please help to explain more on this difference?

thomas-germer commented 1 year ago

Yes, this is correct.