Giter Club home page Giter Club logo

pyscatmech's Introduction

pySCATMECH Package

pySCATMECH is a Python interface to SCATMECH: Polarized Light Scattering C++ Class Library.

SCATMECH

SCATMECH is an object-oriented C++ class library developed to distribute models for light scattering applications. Included in the library are models for diffuse surface scattering that predict the bidirectional reflectance distribution function (BRDF), codes for calculating scattering by isolated particles, and codes for reflection, transmission, and diffraction from gratings. Emphasis has been given to those diffuse scatter models that are physics-based and which predict the polarization properties of the scattered light. The library also includes a number of classes that are useful for working with polarized light or the optics of thin films. The library is designed to enable expansion of new models.

See https://pages.nist.gov/SCATMECH/index.htm for full SCATMECH documentation.

pySCATMECH Modules

PySCATMECH contains nine modules:

  • mueller - Tools for handling Mueller matrices, Stokes vectors, Jones matrices, and Jones vectors
  • model - Tools for handling the SCATMECH::Model class, which handles generic models
  • fresnel - Tools for handling optical functions, thin films, and reflection and transmission coefficients
  • brdf - Tools for handling bidirectional reflectance distribution function (BRDF) models (SCATMECH::BRDF_Model)
  • local - Tools for handling differential scattering cross-section (DSC) models of local defects on surfaces (SCATMECH::Local_BRDF_Model)
  • rcw - Tools for handling rigorous couple wave (RCW) analysis of 1D periodic gratings (SCATMECH::RCW_Model)
  • crossrcw - Tools for handling RCW analysis of 2D periodic gratings (SCATMECH::CrossRCW_Model)
  • scatterer - Tools for handling free-space scattering functions (SCATMECH::FreeSpaceScatterer)
  • integrate - Tools for integrating BRDF or DSC models

See https://pages.nist.gov/pySCATMECH/index.htm for full pySCATMECH documentation.

Installation

To install pySCATMECH, run

pip install pySCATMECH

pyscatmech's People

Contributors

thomas-germer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pyscatmech's Issues

M1 Mac problem pySCATMECH implementation

Hi,

I am pretty new to Python and my computer is an M1 Mac. Could anybody help me run pySCATMECH in Python still?

There error I get is;
"Collecting pyscatmech
Using cached pySCATMECH-0.1.0.tar.gz (354 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/private/var/folders/0c/brm449sn4j539cjpxj46m2yw0000gn/T/pip-install-vynbs0il/pyscatmech_fa8e432ead0c4ae7a60509a3312f0eea/setup.py", line 172, in
extra_compile_args = extra_compile_args,
NameError: name 'extra_compile_args' is not defined
platform.system() = Darwin
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(base) o[NAME OF COMPUTER] ~ % "

Does anybody know the solution? You'll have my eternal gratitude!

Issue with materials

Hi,
I have pip installed pySCATMECH in windows 10 PC.

I am trying to run the test example code (https://github.com/usnistgov/pySCATMECH/blob/master/tests/testPySCATMECH.py) and it is getting stuck at various materials like silicon, aluminum, gold etc.
Below is a copy of first error which I could resolve by downloading the silicon.txt file in the parent folder.

Is there a way to include other materials as well? How do I download/create these materials library?

`==========================
Testing pySCATMECH.fresnel

Traceback (most recent call last):
File "D:\Python\RCWA\test.py", line 243, in
plt.plot(wavelengths, [silicon(w).real for w in wavelengths], label="Si n")
File "D:\Python\RCWA\test.py", line 243, in
plt.plot(wavelengths, [silicon(w).real for w in wavelengths], label="Si n")
File "C:\Users\K-lab_manish\anaconda3\envs\test\lib\site-packages\pySCATMECH\fresnel.py", line 73, in call
return SCATPY.GetOpticalConstant(wavelength,self.name)
Exception: At GetOpticalConstant, SCATMECH: Cannot open file "silicon.txt"`

Cannot find the material in RCW Module

From the website's example, the grating parameters can set by:

gratingParameters = {
None : 'Single_Line_Grating',
'period' : 10,
'medium_i' : 1,
'medium_t' : 'silicon',
'material' : 'silicon',
'space' : 1,
'height' : '0.5',
'topwidth' : '0.4',
'bottomwidth' : '0.15',
'offset' : '0',
'nlevels' : '10'}
But the error show : At SetParameter, SCATMECH: Cannot open file "silicon"

Are there any solution for this error? Or how can I use other parameter to replace the "silicon"?

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

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,

Cannot Calculate Jones matrices with RCW and CrossRCW models

In the documentation for the RCW_Model (https://pages.nist.gov/pySCATMECH/rcw.html) and CrossRCW_Model (https://pages.nist.gov/pySCATMECH/crossrcw.html), there is a method for calculating the Jones matrix for a given diffraction order. However, when I try to get the Jones matrix for a default set up, python returns an error:

model = RCW_Model()
print(model.DiffractionAmplitude(0))

AttributeError: 'RCW_Model' object has no attribute 'DiffractionAmplitude'

Using print(dir(model)), I can see that the model has DiffractionEfficiency and Direction as possible methods, but no DiffractionAmplitude method. Am I doing something wrong, or has the Jones matrix method been removed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.