Commit ca649da0 authored by Riccardo La Placa's avatar Riccardo La Placa
Browse files

Mannaggia, non ho fatto in tempo a finire

Tutti i pezzi aggiunti in questa versione sono circondati da doppie barrre di %, eccetto il commento finale %%Finire domani che indica da dove ripartire
parent 69ee2188
Loading
Loading
Loading
Loading
+53 −1
Original line number Diff line number Diff line
@@ -14,6 +14,38 @@ t_raw = t_raw{1};
%     end
% end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Lines added just to test what was done until now
f_tru = 592.42146827248556; %Hz
porb_tru = 17115.5216592; %s
a_tru = 0.343356; %lt-s
tasc_tru = 58107.009477; %MJD?

f_gr = zeros(5,1);
porb_gr = zeros(5,1);
a_gr = zeros(5,1);
tasc_gr = zeros(5,1);

for j = 1:5
    f_gr(j) = f_tru*((j^3)/9);
    porb_gr(j) = porb_tru*((j^3)/9);
    a_gr(j) = a_tru*((j^3)/9);
    tasc_gr(j) = tasc_tru*((j^3)/9);
end

f_min = min(f_gr);
f_max = max(f_gr);
porb_min = min(porb_gr);
porb_max = max(porb_gr);
a_min = min(a_gr);
a_max = max(a_gr);
tasc_min = min(tasc_gr);
tasc_max = max(tasc_gr);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%NOTE: t0 used to define the orbital phase γ is equal to the mid point
%of the observation span for dataset; M2015, Sec.7
t0 = (t_raw(end)+t_raw(1))/2;
@@ -123,6 +155,12 @@ for s = 1:s_s
    nis{s}=franco;
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nis{s_s+1}=f_gr;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Resampling the times over nism{m,s} templates
% ---- Andrà fatto per ogni possibile combinazione di nism a un dato m 
% mi sa
@@ -130,6 +168,7 @@ end
% vari ni1,ni2,...,nis_s
%%%[kung,fu,fight] = ndgrid(nis{1},nino{2},nino{3});
nibank = combinations(nis{:}).Variables;
Lambda = zeros(length(nibank),1);

%Fourier transform on original time-series --------------------------------
%per mantenere l'informazione di fase, non faccio il valore assoluto al quadrato della fft
@@ -157,6 +196,11 @@ for m=1:M
        % questa templ combini 
        % Careful! ni_0 still needs to be defined (it's the spin freq. 
        % currently being considered)
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        nizero = nibank(i,s_s+1);
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        ta = zeros(N,1);
        for j = 1:N
            for s = 1:s_s
@@ -181,12 +225,20 @@ for m=1:M

        %Calcolo della detection statistic
        %QUESTA SARA' DA INIZIALIZZARE ALL'ESTERNO tipo Lambda = zeros(length(template),1);
        Lambda(template)=sum(Y1)/sum(x(m,:)); %CREDO (oppure prendono la potenza massima?)
        Lambda(i)=sum(Y1)/sum(x(m,:)); %CREDO (oppure prendono la potenza massima?)
    end

end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
parbank = combinations(f_gr,porb_gr,a_gr,tasc_gr).Variables;

%% Finire domani
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%COMPLETARE DOPO AVER STUDIATO I RANDOM TEMP. BANKS
%E VEDERE CODICE https://pyfstat.readthedocs.io/en/latest/pyfstat.html#pyfstat.core.SemiCoherentSearch