Daniel@0: function d = mirdesign(orig,argin,option,postoption,specif,type); %,nout) Daniel@0: Daniel@0: if isa(orig,'mirdesign') Daniel@0: d.method = orig.method; Daniel@0: d.argin = orig.argin; Daniel@0: d.option = orig.option; Daniel@0: d.postoption = orig.postoption; Daniel@0: d.specif = orig.specif; Daniel@0: d.type = orig.type; Daniel@0: d.frame = orig.frame; Daniel@0: d.segment = orig.segment; Daniel@0: d.chunkdecomposed = orig.chunkdecomposed; Daniel@0: d.size = orig.size; Daniel@0: d.file = orig.file; Daniel@0: d.channel = orig.channel; Daniel@0: d.sampling = orig.sampling; Daniel@0: d.resampling = orig.resampling; Daniel@0: d.nochunk = orig.nochunk; Daniel@0: d.ascending = orig.ascending; Daniel@0: d.overlap = orig.overlap; Daniel@0: d.separate = orig.separate; Daniel@0: d.chunk = orig.chunk; Daniel@0: d.eval = orig.eval; Daniel@0: d.interchunk = orig.interchunk; Daniel@0: d.acrosschunks = orig.acrosschunks; Daniel@0: d.ready = orig.ready; Daniel@0: d.struct = orig.struct; Daniel@0: d.stored = orig.stored; Daniel@0: d.index = orig.index; Daniel@0: d.tmpfile = orig.tmpfile; Daniel@0: d.tmpof = orig.tmpof; Daniel@0: else Daniel@0: d.method = orig; Daniel@0: d.argin = argin; Daniel@0: d.option = option; Daniel@0: d.postoption = postoption; Daniel@0: d.specif = specif; Daniel@0: d.type = type; Daniel@0: if ischar(argin) Daniel@0: d.frame = {}; Daniel@0: d.segment = {}; Daniel@0: d.chunkdecomposed = 0; Daniel@0: d.size = {}; Daniel@0: d.file = ''; Daniel@0: d.channel = []; Daniel@0: d.sampling = 0; Daniel@0: d.resampling = 0; Daniel@0: d.nochunk = 0; Daniel@0: if not(isempty(orig)) && ... Daniel@0: strcmp(func2str(orig),'mirenvelope') && d.option.zp == 2 Daniel@0: d.ascending = 0; Daniel@0: else Daniel@0: d.ascending = 1; Daniel@0: end Daniel@0: d.overlap = 0; Daniel@0: d.separate = 0; Daniel@0: else Daniel@0: if iscell(argin) Daniel@0: argin = argin{1}; Daniel@0: end Daniel@0: if (strcmp(func2str(orig),'mirspectrum') && d.option.alongbands) ... Daniel@0: || (isfield(specif,'nochunk') && specif.nochunk) Daniel@0: d.frame = []; Daniel@0: if isfield(d.specif,'eachchunk') Daniel@0: d.specif = rmfield(d.specif,'eachchunk'); Daniel@0: d.specif = rmfield(d.specif,'combinechunk'); Daniel@0: end Daniel@0: else Daniel@0: d.frame = argin.frame; Daniel@0: if not(isempty(d.frame)) Daniel@0: if isfield(d.specif,'extensive') Daniel@0: d.frame.dontchunk = 1; Daniel@0: % Some frame-decomposed extractor should not be evaluated Daniel@0: % chunk after chunk because the whole result is needed for Daniel@0: % subsequent computations. Daniel@0: elseif isfield(d.specif,'chunkframebefore') Daniel@0: d.frame.chunkbefore = 1; Daniel@0: end Daniel@0: end Daniel@0: end Daniel@0: d.segment = argin.segment; Daniel@0: d.chunkdecomposed = argin.chunkdecomposed; Daniel@0: d.size = argin.size; Daniel@0: d.file = argin.file; Daniel@0: d.channel = argin.channel; Daniel@0: d.sampling = argin.sampling; Daniel@0: d.resampling = argin.resampling; Daniel@0: if (isfield(specif,'nochunk') && specif.nochunk) Daniel@0: d.nochunk = 1; % was previously 2 Daniel@0: elseif not(isempty(argin.stored)) Daniel@0: % a temporary variable will be already computed. Daniel@0: d.nochunk = 2; % Flag to indicate that no chunk should be Daniel@0: % performed. Temporary variables cannot for the Daniel@0: % moment be dispatched to dependent variables Daniel@0: % chunk by chunk, but only once the whole Daniel@0: % variable has been computed. Daniel@0: else Daniel@0: d.nochunk = argin.nochunk; Daniel@0: end Daniel@0: if strcmp(func2str(orig),'mirenvelope') Daniel@0: if d.option.zp == 2 Daniel@0: d.ascending = not(isempty(d.segment)); Daniel@0: else Daniel@0: d.ascending = 1; Daniel@0: end Daniel@0: else Daniel@0: d.ascending = argin.ascending; Daniel@0: end Daniel@0: d.overlap = argin.overlap; Daniel@0: d.separate = argin.separate; Daniel@0: end Daniel@0: d.chunk = []; Daniel@0: d.eval = 0; Daniel@0: d.interchunk = []; % Data that can be passed between successive chunks during the main process. Daniel@0: d.acrosschunks = []; % Data that can be accumulated among chunks during the beforechunk process. Daniel@0: d.ready = 0; Daniel@0: d.struct = []; Daniel@0: d.stored = []; Daniel@0: d.index = NaN; Daniel@0: if not(isempty(orig)) && strcmp(func2str(orig),'mirenvelope') && ... Daniel@0: d.option.zp == 2 && isempty(d.segment) Daniel@0: % Triggers the use of temporary file for the mirenvelope computation Daniel@0: d.tmpfile.fid = 0; Daniel@0: else Daniel@0: d.tmpfile = []; Daniel@0: end Daniel@0: d.tmpof = []; Daniel@0: end Daniel@0: d = class(d,'mirdesign');