Page 1 of 1

is possible to load ASCII file using Deernet with spinach

Posted: Mon Sep 13, 2021 11:53 am
by Khalil
Dear Ilya
I was trying to load ASCII file generated by our spectrometer ( two columns time (ns) and spectrum (magnitude)) and tried to store the associated data in time_axis ( in us) and in deer_trace and to use deernet(deer_trace,time_axis); but it seems not working as I am a getting an error message:

Running startup checks...
Error using deernet>grumble (line 392)
time axis units must be seconds

Error in deernet (line 110)
grumble(input_traces,input_axis,netset);

Error in Untitled (line 11)
deernet(deer_trace,time_axis); drawnow();


Here is my code:
clear all
[data,DR]= uigetfile('*.dat', 'Select a file');%Get data to plot
cd(DR) %set this location as working directory,
filepath = fullfile(DR,data);
S = load(filepath);

time_axis = S(:,1)*1e-3;% in us
deer_trace = S(:,2); % only real spectrum is stored.

deernet(deer_trace,time_axis); drawnow();

Regards

Re: is possible to load ASCII file using Deernet with spinach

Posted: Mon Sep 13, 2021 12:08 pm
by kuprov
Try converting the time axis into seconds; then it should work - at the moment the program does not think that the time units are correct.

Re: is possible to load ASCII file using Deernet with spinach

Posted: Mon Sep 13, 2021 2:03 pm
by Khalil
Dear Ilya,
Many thanks. I was able to run the simulation. However, it seems that the program struggles to find the time zero or I have mistaken somewhere. I have to emphasize that the data shown in the attached figure is the raw data as it was run at W-band and you can see it's almost background free and this might be the problem? I tried to attach the raw data as txt or ASCII file but without success as an error shows up saying invalid file extension.
Many thanks for your assistance.
Regards

Re: is possible to load ASCII file using Deernet with spinach

Posted: Mon Sep 13, 2021 2:18 pm
by kuprov
If you are submitting the data manually (i.e. not importing from Elexsys) then you need to shift it to zero manually, then it should be fine.

Re: is possible to load ASCII file using Deernet with spinach

Posted: Mon Sep 13, 2021 2:24 pm
by Khalil
Dear Ilya,
It did work, many thanks.
Regards

Re: is possible to load ASCII file using Deernet with spinach

Posted: Mon Sep 13, 2021 2:31 pm
by kuprov
Lovely! This minimalist approach (command line, no adjustable parameters) is quite deliberate. The fewer settings there are, the fewer headaches.