% xferOverridesExample - how to transfer flagbadadv overrides between beams % grabbing the override as bad and passing it to the next beam in % flagbadadv outFileRoot = '7864adv'; % the name for the output files % starting with unmarked/unmasked data % do flagbad on beam 1 flagbadadv('QualityFile',[outFileRoot 'q.cdf']) previousBeam = 1; % take overrides from beam 1 settings.currentBeam = 2; % and apply it to beam 2 cdfq = netcdf([outFileRoot 'q.cdf']); override_as_bad = cdfq{'flagbadadv_override_as_bad'}(:,previousBeam,:); % now translate to a set of burst numbers because this is how they are send % in to flagbad (perhaps using a mask is better? but I wanted to allow the % user to say 'force burst #n as good or bad') burstnums = cdfq{'burst'}(:); for iSubburst = 1:5, settings.new_bad{iSubburst} = burstnums(find(override_as_bad(:,iSubburst))); end % FYI ncnames(var(cdfq))' % to get a list of variable names when I can't remember the spelling cdfq{'flagbadadv_override_as_bad'} % displays useful info about the netcdf object, such as shape close(cdfq) flagbadadv('QualityFile',[outFileRoot 'q.cdf'],'settings',settings)