Loading scsearch.m +18 −15 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ t_raw = t_raw{1}; t_raw=t_raw./86400+50814; MJDREF=t_raw(1); t_raw=(t_raw-MJDREF).*86400; % t_raw=t_raw(t_raw>=t_raw(1) & t_raw<t_raw(1)+1200); t_raw=t_raw(t_raw>=t_raw(1) & t_raw<(t_raw(1)+ 10*256 + 1)); % info = fitsinfo(finame).BinaryTable.Keywords; % for i = 1:length(info) Loading Loading @@ -91,7 +91,7 @@ t=(t(1:end-1)+(t(2)-t(1))/2).'; % vettore tempi rebinnato, prendo il centro del toc tic Tseg=256; %segments' length in seconds Tseg=128; %segments' length in seconds M=fix((t(end)-t(1))/Tseg); %number of segments %con fix prendo la parte intera, scarto l'ultimo segmento che tanto non %sarà mai di lunghezza Tseg (molto improbabile) Loading Loading @@ -217,7 +217,7 @@ tic % Try s* and check \nu_s range g_jj=((pi*Tseg)^2)/3.*[1; (Tseg^2)/60; (Tseg^4)/1344; (Tseg^6)/172800]; %eq. 22 M2015 + calcoli da eq. 21 M2015 mu_s=0.1; %massimo mismatch sulla griglia coerente da scegliere mu_s=0.005; %massimo mismatch sulla griglia coerente da scegliere %s_s=uint8(4); s_s = 4; while(1) Loading @@ -241,6 +241,9 @@ end Nni = zeros(s_s,1); for s = 1:s_s Nni(s) = ceil((nismax(s)-nismin(s))/delta_ni(mu_s,s,g_jj(s))); if (mod(Nni(s),2)==0) Nni(s) = Nni(s)+1; end franco=nismin(s):((nismax(s)-nismin(s))/(Nni(s))):nismax(s); nis{s}=franco; end Loading @@ -260,11 +263,11 @@ tic % Cercheremo un modo per combinare in tutti i possibili modi vettori di % vari ni1,ni2,...,nis_s %%%[kung,fu,fight] = ndgrid(nis{1},nino{2},nino{3}); tm=gpuArray(tm); nibank = gpuArray(combinations(nis{:}).Variables); Lambda = zeros(length(nibank),length(f_gr),M,'gpuArray'); % nibank = combinations(nis{:}).Variables; % Lambda = zeros(length(nibank),length(f_gr),M); % tm=gpuArray(tm); % nibank = gpuArray(combinations(nis{:}).Variables); % Lambda = zeros(length(nibank),length(f_gr),M,'gpuArray'); nibank = combinations(nis{:}).Variables; Lambda = zeros(length(nibank),length(f_gr),M); toc %Fourier transform on original time-series -------------------------------- %per mantenere l'informazione di fase, non faccio il valore assoluto al quadrato della fft Loading @@ -285,10 +288,10 @@ for m=1:M % Y=Y(cond); % X=ifft(Y); %inverse-fourier transf. ttemp = gpuArray(tm(m,:)); xtemp = gpuArray(x(:,m).'); % ttemp = tm(m,:); % xtemp = x(:,m).'; % ttemp = gpuArray(tm(m,:)); % xtemp = gpuArray(x(:,m).'); ttemp = tm(m,:); xtemp = x(:,m).'; % toc Loading Loading @@ -360,8 +363,8 @@ for m=1:M end tic % nisearcher = KDTreeSearcher(nibank,'BucketSize',100); nisearcher = KDTreeSearcher(gather(nibank),'BucketSize',100); nisearcher = KDTreeSearcher(nibank,'BucketSize',100); % nisearcher = KDTreeSearcher(gather(nibank),'BucketSize',100); %% The line above will have to be substituted with something along the lines %% of the ones below to account for the metric g_jj in the phase derivatives % gdistance = @(a,b)sqrt(((a-b).^2)*(g_jj(1:s_s))); Loading @@ -381,7 +384,7 @@ for n=1:length(f_gr) curpar(2) = 2*pi/curpar(2); totlam = 0; for m = 1:M curpar(4) = curpar(2)*(tmid(m) - curpar(4)); curpar(4) = curpar(2)*(tmid(m) - parbank(i,3)); curni=zeros(1,s_s); for s=1:s_s curni(s) = (curpar(2)^s)*sin(curpar(4)+0.5*s*pi); Loading Loading
scsearch.m +18 −15 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ t_raw = t_raw{1}; t_raw=t_raw./86400+50814; MJDREF=t_raw(1); t_raw=(t_raw-MJDREF).*86400; % t_raw=t_raw(t_raw>=t_raw(1) & t_raw<t_raw(1)+1200); t_raw=t_raw(t_raw>=t_raw(1) & t_raw<(t_raw(1)+ 10*256 + 1)); % info = fitsinfo(finame).BinaryTable.Keywords; % for i = 1:length(info) Loading Loading @@ -91,7 +91,7 @@ t=(t(1:end-1)+(t(2)-t(1))/2).'; % vettore tempi rebinnato, prendo il centro del toc tic Tseg=256; %segments' length in seconds Tseg=128; %segments' length in seconds M=fix((t(end)-t(1))/Tseg); %number of segments %con fix prendo la parte intera, scarto l'ultimo segmento che tanto non %sarà mai di lunghezza Tseg (molto improbabile) Loading Loading @@ -217,7 +217,7 @@ tic % Try s* and check \nu_s range g_jj=((pi*Tseg)^2)/3.*[1; (Tseg^2)/60; (Tseg^4)/1344; (Tseg^6)/172800]; %eq. 22 M2015 + calcoli da eq. 21 M2015 mu_s=0.1; %massimo mismatch sulla griglia coerente da scegliere mu_s=0.005; %massimo mismatch sulla griglia coerente da scegliere %s_s=uint8(4); s_s = 4; while(1) Loading @@ -241,6 +241,9 @@ end Nni = zeros(s_s,1); for s = 1:s_s Nni(s) = ceil((nismax(s)-nismin(s))/delta_ni(mu_s,s,g_jj(s))); if (mod(Nni(s),2)==0) Nni(s) = Nni(s)+1; end franco=nismin(s):((nismax(s)-nismin(s))/(Nni(s))):nismax(s); nis{s}=franco; end Loading @@ -260,11 +263,11 @@ tic % Cercheremo un modo per combinare in tutti i possibili modi vettori di % vari ni1,ni2,...,nis_s %%%[kung,fu,fight] = ndgrid(nis{1},nino{2},nino{3}); tm=gpuArray(tm); nibank = gpuArray(combinations(nis{:}).Variables); Lambda = zeros(length(nibank),length(f_gr),M,'gpuArray'); % nibank = combinations(nis{:}).Variables; % Lambda = zeros(length(nibank),length(f_gr),M); % tm=gpuArray(tm); % nibank = gpuArray(combinations(nis{:}).Variables); % Lambda = zeros(length(nibank),length(f_gr),M,'gpuArray'); nibank = combinations(nis{:}).Variables; Lambda = zeros(length(nibank),length(f_gr),M); toc %Fourier transform on original time-series -------------------------------- %per mantenere l'informazione di fase, non faccio il valore assoluto al quadrato della fft Loading @@ -285,10 +288,10 @@ for m=1:M % Y=Y(cond); % X=ifft(Y); %inverse-fourier transf. ttemp = gpuArray(tm(m,:)); xtemp = gpuArray(x(:,m).'); % ttemp = tm(m,:); % xtemp = x(:,m).'; % ttemp = gpuArray(tm(m,:)); % xtemp = gpuArray(x(:,m).'); ttemp = tm(m,:); xtemp = x(:,m).'; % toc Loading Loading @@ -360,8 +363,8 @@ for m=1:M end tic % nisearcher = KDTreeSearcher(nibank,'BucketSize',100); nisearcher = KDTreeSearcher(gather(nibank),'BucketSize',100); nisearcher = KDTreeSearcher(nibank,'BucketSize',100); % nisearcher = KDTreeSearcher(gather(nibank),'BucketSize',100); %% The line above will have to be substituted with something along the lines %% of the ones below to account for the metric g_jj in the phase derivatives % gdistance = @(a,b)sqrt(((a-b).^2)*(g_jj(1:s_s))); Loading @@ -381,7 +384,7 @@ for n=1:length(f_gr) curpar(2) = 2*pi/curpar(2); totlam = 0; for m = 1:M curpar(4) = curpar(2)*(tmid(m) - curpar(4)); curpar(4) = curpar(2)*(tmid(m) - parbank(i,3)); curni=zeros(1,s_s); for s=1:s_s curni(s) = (curpar(2)^s)*sin(curpar(4)+0.5*s*pi); Loading