Commit 42932be7 authored by riccardo's avatar riccardo
Browse files

Fixed normalization

parent 53f497bd
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -447,7 +447,7 @@ for m=1:M
    tedge(N+1) = tm(m,N) + 0.5*dt -tmid(m);
    Y0 = fft(xtemp);
    % norman = 2./mean((abs(Y0(F1>1000 & F1<Nyq)).^2)./sumx);
    norman = 2./(var(xtemp)/mean(xtemp));
    norman = 2./(Nphot.*var(xtemp)./mean(xtemp));


    % toc
@@ -479,7 +479,7 @@ for m=1:M
        % Careful! ni_0 still needs to be defined (it's the spin freq. 
        % currently being considered)
        Yenne(:)=Y1(f_ind(:)); 
        Lambda(:,i) = (abs(Yenne(:)).^2);
        Lambda(:,i) = (abs(Yenne(:)));
        % Lambda(:,i) = norman.*(abs(Yenne(:)).^2)./sumo;
        % 
        % for n = 1:length(f_gr)
@@ -490,7 +490,7 @@ for m=1:M
        % end
        % disp('1ni')
    end
    Lambda(:,:) = Lambda(:,:).*norman;
    Lambda = (Lambda.^2).*norman;
    % disp(max(Lambdacp(:,:)-Lambda(:,:)))
    % disp(min(Lambdacp(:,:)-Lambda(:,:)))
    % toc
@@ -666,7 +666,7 @@ timerapp = 24.0*summina/518260001575;

% disp(bestpar);
% save('C:\Users\Filippo\Desktop\XMM_Jxxx\risultelli.mat');
disp(['I am about to save around ',num2str(round(inGB)),' GB of data (+ headers), it should take roughly ',num2str(round(timerapp)),' minutes.']);
disp(['I am about to save around ',num2str(round(inGB)),' GB of data (+ headers), it should take roughly ',num2str(ceil(timerapp)),' minutes.']);
save([pathfi,'risultelli_test_',char(datetime('now','Format','dd_MM')),'_',num2str(Tseg),'s_amax',num2str(a_max),'_fmax',num2str(f_max),'.mat'],"-v7.3","-nocompression");
disp(['Results saved in ',pathfi,'risultelli_test_',char(datetime('now','Format','dd_MM')),'_',num2str(Tseg),'s_amax',num2str(a_max),'_fmax',num2str(f_max),'.mat']);
%%