0001 function [mjdVec recalcVec numArray estimateArray] = ...
0002 createTemplateEstimates(mjdVec, numArray, estimateArray,startMJD,endMJD,newEstimatesDir)
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 n_phase = size(estimateArray,1);
0024 n_pol = size(estimateArray,3);
0025
0026
0027
0028 recalcVec = mjdVec > (startMJD-0.1/12) & mjdVec < (endMJD+0.1/12);
0029
0030
0031
0032 n_new = max(0,round(12*(endMJD - max(startMJD-1./12,mjdVec(end))))-1);
0033
0034
0035
0036 if n_new > 0
0037 mjdVec = [mjdVec, max(startMJD-1/12,mjdVec(end))+(1:n_new)/12];
0038 recalcVec = [recalcVec, ones(1, n_new)];
0039 numArray = [numArray, ones(n_phase, n_new)];
0040 estimateArray = [estimateArray ones(n_phase, n_new, n_pol)];
0041 end
0042
0043
0044
0045 for k=find(recalcVec)
0046
0047 mjdStart = mjdVec(k);
0048 mjdEnd = mjdVec(k) + 1/12;
0049
0050 utcStart = mjd2string(mjdStart);
0051 utcEnd = mjd2string(mjdEnd);
0052
0053
0054 disp(['Calculating template estimates for ' utcStart ' to ' utcEnd]);
0055 [new_num new_templates] = genTemplateEstimates(utcStart,utcEnd,newEstimatesDir,n_phase);
0056
0057
0058 numArray(:,k) = new_num;
0059 estimateArray(:,k,:) = new_templates;
0060 end
0061
0062
0063 end