is possible to load ASCII file using Deernet with spinach

Topics related to DEERNet
Post Reply
Khalil
Posts: 12
Joined: Fri Sep 10, 2021 11:15 am

is possible to load ASCII file using Deernet with spinach

Post 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
kuprov
Posts: 201
Joined: Mon Mar 29, 2021 4:26 pm

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

Post 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.
Khalil
Posts: 12
Joined: Fri Sep 10, 2021 11:15 am

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

Post 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
Attachments
result
result
Output.png (35.83 KiB) Viewed 166906 times
kuprov
Posts: 201
Joined: Mon Mar 29, 2021 4:26 pm

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

Post 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.
Khalil
Posts: 12
Joined: Fri Sep 10, 2021 11:15 am

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

Post by Khalil »

Dear Ilya,
It did work, many thanks.
Regards
kuprov
Posts: 201
Joined: Mon Mar 29, 2021 4:26 pm

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

Post by kuprov »

Lovely! This minimalist approach (command line, no adjustable parameters) is quite deliberate. The fewer settings there are, the fewer headaches.
Post Reply