TomVincentUK / snompy

A Python package for modelling scanning near-field optical microscopy measurements.
https://snompy.readthedocs.io/
MIT License
7 stars 2 forks source link

Calculation of sample properties from built-in function "snompy.sample.lorentz_perm" #43

Closed rOivlys closed 1 month ago

rOivlys commented 1 month ago

Dear Tom,

Thank you for the development of such a helpful package.

I've stumbled upon a problem when using the built-in function for calculating dielectric functions, "snompy.sample.lorentz_perm".

The sample is SiC.

Almost no difference is observed between a home-calculated dielectric function and the one from sample.lorentz_perm, with the same parameters.

Yet, he difference is striking in the simulated sSNOM spectra. The simulated spectra are calculated with the fdm method ("snompy.fdm.eff_pol_n").

I basically use the same parameters, despite the dielectric functions. You can find attached a code where i compute spectra in the 2 cases:

Running the code will provide the comparison of the dielectric functions provided by the 2 methods (both real and imaginary parts), and the simulated spectra for harmonics n° 2,3 & 4.

Is it a mistake that I made? In this case, I apologize for this unecessary issue.

Otherwise, I look forward to your answer and to explanations to this issue!

code.txt.txt

Respectfully,

Sylvio

TomVincentUK commented 1 month ago

Hi Sylvio,

Thanks for using our package. I had a look at your text file, and unfortunately it seems as though there's quite a few issues with the script that mean I can't run it. There are some functions and variables that you've used but not defined, as well as some syntax errors like missing multiplication operators, and a few other errors. If you're happy to create a single .py script, and make sure that it runs on your own computer, then I'll be happy to take a look to see what your issue could be.

Either way, I'm going to close this issue, as the GitHub Issues tab for this project is more of a place to report problems with the code, rather than to ask questions about the physics of the models.

If you'd still like help with this problem, I'll be happy to look into it, but please could you start by creating a working Python script, then post your question as a new discussion on the snompy Discussions channel.

If we discover that there's an issue with the code that needs to be resolved after looking into it there, then we can create a new Issue to resolve that. But I suspect that the answer to your question is more related to the sensitivity of the models to small changes in permittivity.

Cheers, Tom

TomVincentUK commented 1 month ago

Closing this issue, as it relates to the results of using the models, rather than to a specific identified issue with the code.

I'm happy to help with this question if the original poster can post a working Python script to the discussions channel.

For future, I'll create an issue template that redirects users to the Discussions channel if their questions are related to the physics/use of the models.