From 6f535bfd9281bb07ae28c0b8b884e17f9cdc36e2 Mon Sep 17 00:00:00 2001 From: sakul-45 <81963567+sakul-45@users.noreply.github.com> Date: Tue, 27 Jul 2021 13:17:35 +0200 Subject: [PATCH] Added loading TimeBase vector into struct. Updated intern docs --- load_bruker.m | 33 ++++++++++++++++++--------------- load_matlab.m | 36 ++++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/load_bruker.m b/load_bruker.m index b9cfb69..b6dd349 100644 --- a/load_bruker.m +++ b/load_bruker.m @@ -14,22 +14,24 @@ function [Data,params] = load_bruker(path) % Example for params output: % params = % -% struct with fields: +% struct with fields: Units % -% Field_Center: 3500 -% Field_Sweep: 3400 -% Field_Step: 5 -% Accumulations: 100 -% laser_shotreprate: 20 -% Field_Start: 1800 -% Field_End: 5200 -% Field_Vector: [1×681 double] -% mwFreq: 9.6845 -% mwPower: 0.2000 -% QValue: 22800 -% mwAtten: 30 -% mwFreqs: [681×1 double] -% Name: "/some/path" +% Field_Center: 3500 G +% Field_Sweep: 2700 G +% Field_Step: 5 G +% Accumulations: 100 - +% laser_shotreprate: 20 - +% Field_Start: 2150 G +% Field_End: 4850 G +% Field_Vector: [1×540 double] G +% mwFreq: 9.6845 GHz +% mwPower: 0.2000 W +% QValue: 22800 - +% mwAtten: 30 dB +% mwFreqs: [681×1 double] GHz +% TimeBase: [1×10001 double] s +% Path: '/some/path/' - +% Name: 'example_data' - %correct \ for / corrpath = replace(path,"\","/"); @@ -51,6 +53,7 @@ params.mwPower = bruker_params.MWPW * 1e3; params.QValue = "NOT RECORDED"; params.mwAtten = str2double(extractBefore(string(bruker_params.PowerAtten),' ')); params.mwFreqs = "NOT RECORDED"; +params.TimeBase = (bruker_params.XMIN:(bruker_params.XWID/bruker_params.XPTS):(bruker_params.XMIN+bruker_params.XWID)) .* 1e-9; %get filename for further documentation and exporting figures [datapath,dataname,~] = fileparts(corrpath); diff --git a/load_matlab.m b/load_matlab.m index 2651886..e07a977 100644 --- a/load_matlab.m +++ b/load_matlab.m @@ -10,27 +10,31 @@ function [Data,params] = load_matlab(path) % Example for params output: % params = % -% struct with fields: +% struct with fields: Units % -% Field_Center: 3500 -% Field_Sweep: 3400 -% Field_Step: 5 -% Accumulations: 100 -% laser_shotreprate: 20 -% Field_Start: 1800 -% Field_End: 5200 -% Field_Vector: [1×681 double] -% mwFreq: 9.6845 -% mwPower: 0.2000 -% QValue: 22800 -% mwAtten: 30 -% mwFreqs: [681×1 double] -% Name: "/some/path" +% Field_Center: 3500 G +% Field_Sweep: 2700 G +% Field_Step: 5 G +% Accumulations: 100 - +% laser_shotreprate: 20 - +% Field_Start: 2150 G +% Field_End: 4850 G +% Field_Vector: [1×540 double] G +% mwFreq: 9.6845 GHz +% mwPower: 0.2000 W +% QValue: 22800 - +% mwAtten: 30 dB +% mwFreqs: [681×1 double] GHz +% TimeBase: [1×10001 double] s +% Path: '/some/path/' - +% Name: 'example_data' - %correct \ for / corrpath = replace(path,"\","/"); -load(corrpath,'Data','params') +%load data and write TimeBase in params +load(corrpath,'Data','params','TimeBase') +params.TimeBase = TimeBase; %get filename for further documentation and exporting figures [datapath,dataname,~] = fileparts(corrpath);