diff --git a/IO/phase_history/cphd/open_cphd_reader.m b/IO/phase_history/cphd/open_cphd_reader.m index 136721b..eb28757 100644 --- a/IO/phase_history/cphd/open_cphd_reader.m +++ b/IO/phase_history/cphd/open_cphd_reader.m @@ -142,6 +142,7 @@ %% Specify reader object methods-- close() method already defined above readerobj.read_cphd = @read_data; +readerobj.get_nbdata = @get_nbdata; readerobj.get_meta = @() xml_meta; %% READ_CPHD method of this reader object @@ -183,6 +184,17 @@ end end + % Function to get only the nbdata + function [nbdata] = get_nbdata(pulse_indices, channel) + if (nargin<2) + channel = 1; + end + if (nargin<1) + pulse_indices = 'all'; + end + [~, nbdata] = read_data(pulse_indices, [], channel); + end + %% Function for reading data with memory mapped files % Faster and easier function data_out = chip_with_mm(pulse_indices, sample_indices, channel) diff --git a/IO/phase_history/cphd30/open_cphd30_reader.m b/IO/phase_history/cphd30/open_cphd30_reader.m index 166bb7b..82be0d2 100644 --- a/IO/phase_history/cphd30/open_cphd30_reader.m +++ b/IO/phase_history/cphd30/open_cphd30_reader.m @@ -65,6 +65,7 @@ meta.native.cphd30 = cphd_preamble; % Save original format readerobj.read_cphd=@read_data; +readerobj.get_nbdata =@get_nbdata; readerobj.get_meta=@() meta; readerobj.close=@() fclose(fid); @@ -161,6 +162,18 @@ end end + + % Function to get only the nbdata + function [nbdata] = get_nbdata(pulse_indices, channel) + if (nargin<2) + channel = 1; + end + if (nargin<1) + pulse_indices = 'all'; + end + [~, nbdata] = read_data(pulse_indices, [], channel); + end + % Assumes a single channel dataset function nbdata = read_all_noninterleaved_nb() fseek(fid, cphd_preamble.pulseStart, 'bof'); diff --git a/IO/phase_history/crsd/open_crsd_reader.m b/IO/phase_history/crsd/open_crsd_reader.m index 5ea2c5f..f2f441d 100644 --- a/IO/phase_history/crsd/open_crsd_reader.m +++ b/IO/phase_history/crsd/open_crsd_reader.m @@ -118,6 +118,7 @@ %% Specify reader object methods-- close() method already defined above readerobj.read_raw = @read_data; +readerobj.get_nbdata = @get_nbdata; readerobj.get_meta = @() xml_meta; %% READ_RAW method of this reader object @@ -159,6 +160,17 @@ end end + % Function to get only the nbdata + function [nbdata] = get_nbdata(pulse_indices, channel) + if (nargin<2) + channel = 1; + end + if (nargin<1) + pulse_indices = 'all'; + end + [~, nbdata] = read_data(pulse_indices, [], channel); + end + %% Function for reading data with memory mapped files % Faster and easier function data_out = chip_with_mm(pulse_indices, sample_indices, channel) diff --git a/IO/phase_history/gotcha/gotcha_public_release/open_gotchapr_reader.m b/IO/phase_history/gotcha/gotcha_public_release/open_gotchapr_reader.m index b311de2..fd44316 100644 --- a/IO/phase_history/gotcha/gotcha_public_release/open_gotchapr_reader.m +++ b/IO/phase_history/gotcha/gotcha_public_release/open_gotchapr_reader.m @@ -123,11 +123,12 @@ %% Setup reader object readerobj.read_cphd=@read_data; +readerobj.get_nbdata =@get_nbdata; readerobj.get_meta=@() cphd_meta; readerobj.close=@() 1; %% Functino for READ_CPHD method - function [wbvectors, nbdata] = read_data(pulse_indices, sample_indices, channels) + function [wbvectors, nbdata] = read_data(pulse_indices, sample_indices) % Parse input parameters if (nargin<1)||strcmpi(pulse_indices,'all') pulse_indices=1:cphd_meta.Data.Channel.NumVectors; @@ -149,6 +150,17 @@ end end + % Function to get only the nbdata + function [nbdata] = get_nbdata(pulse_indices, channel) + if (nargin<2) + channel = 1; + end + if (nargin<1) + pulse_indices = 'all'; + end + [~, nbdata] = read_data(pulse_indices, [], channel); + end + end % //////////////////////////////////////////