jdhuang-csm / scatter-opt

Scattering parameter extraction and optimization
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

loading data error #3

Open katto01 opened 5 months ago

katto01 commented 5 months ago

Hi,

  1. in your documentation docx, the first command is missing an input argument: Lambda_c.
  2. I ran this script which is a collection of commands from the documentation document
tef = Sproc(1.92e-3,0.04572,0.041);
tef.L = 2.7e-3;
tef.lambda_c = 0.041;
tef.load('X_band_teflon_notape.txt');

the last line gave me this error:

Unable to resolve the name scatter_opt.loadconvert_raw.

Error in Sproc/load (line 35) obj.Sdata = scatter_opt.loadconvert_raw(file,...

Error in run_scatter_opt_master (line 7) tef.load('X_band_teflon_notape.txt');

jdhuang-csm commented 5 months ago

Sorry for the out-of-date documentation - I think it is lagging behind the code by a couple of updates that I made toward the end of the project. I updated the documentation for Sproc instantiation and the extract method. I also added a MATLAB file that walks through the full fitting process with several different options shown.

Is the package folder (+scatter-opt) on the MATLAB search path? If not, please add it to the search path (see the accepted answer here: https://www.mathworks.com/matlabcentral/answers/480267-error-unable-to-resolve-name-issue).

katto01 commented 5 months ago

great, thank you. I will check it out

katto01 commented 5 months ago

it still fails in

obj.Sdata = scatter_opt.loadconvert_raw(file,... 'HeaderLines',parser.Results.HeaderLines,... 'Delimiter',parser.Results.Delimiter);

Unable to resolve the name scatter_opt.loadconvert_raw.

Error in Sproc/load (line 35) obj.Sdata = scatter_opt.loadconvert_raw(file,...

jdhuang-csm commented 5 months ago

In the terminal, can you run import scatter_opt without errors?

I no longer have a MATLAB license, so I cannot test this myself, but I did not have this problem when I was using the package in the past.

katto01 commented 5 months ago

will try

katto01 commented 5 months ago

is this supposed to run in octave too?

katto01 commented 5 months ago

Is scatter_opt.loadconvert_raw a script/function/file that is missing?

jdhuang-csm commented 5 months ago

I'm not familiar with octave, but I certainly wouldn't count on this running in Octave.

loadconvert_raw is a MATLAB file in the +scatter_opt package folder. If you cloned the package from GitHub, it should be there (you can verify that the file is on your computer). I believe that your error is simply an issue of MATLAB not recognizing or not being aware of the path to the +scatter_opt package, which is why I recommended verifying that the package directory is in your MATLAB search path.

katto01 commented 5 months ago

yes, but scatterer_opt.loadconvert_raw seems to be an object that is not defined. see picture attached Capture

jdhuang-csm commented 5 months ago

Hmm, maybe there is something wrong with the way I've referenced scatter_opt in Sproc. In the Sproc.m file, in function load (line 29), can you add the line "import scatter_opt.*" at the beginning of the function, and then remove the scatter_opt prefix from the function calls scatter_opt.loadconvert_raw and scatter_opt.rev_gamma_0?

katto01 commented 5 months ago

will try.

can you try to run it on octave? its free

katto01 commented 5 months ago

Hi, I replaced all scatter_opt. with , i.e deleted all scatter_opt everywhere and it works all the way, however it gives weird results (eps=200). Do you remember the case? was this in a waveguide and if it was, was it WR90 waveguide (8.4 to 12.4GHz), or it was a periodic unit cell. Since you provide a cutoff frequency I suspect that was a waveguide. In both cases what were the dimensions of the dielectric sample? I would like to simulate the case in HFSS and confirm that the data file is identical to what you provided.

Thank you

jdhuang-csm commented 5 months ago

Hi, thanks for testing that and sorry for the error. I'm not sure why the scatter_opt references were not working, but I haven't worked with MATLAB in a while and may have forgotten how it handles imports within a package. I will update the Sproc code accordingly.

The example data was collected with a waveguide by a colleague. I do not know the dimensions; I will ask my colleague, but I am not sure if they still have access to the metadata. Have you tried the Teflon data?