Skip to content

Commit 6d56cea

Browse files
authored
Merge pull request #1408 from TeamCOMPAS/Matlab
Matlab
2 parents 88415fb + d8df345 commit 6d56cea

File tree

4 files changed

+422
-138
lines changed

4 files changed

+422
-138
lines changed

compas_matlab_utils/BSEDetailedOutput.m

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
file='~/Work/COMPAS/src/COMPAS_Output/Detailed_Output/BSE_Detailed_Output_0.h5';
1+
function BSEDetailedOutput(file)
2+
% Carries out some basic analysis and makes plots for a single BSE run
3+
%
4+
% USAGE:
5+
% BSEDetailedOutput(file)
6+
%
7+
% INPUTS:
8+
% file: name of detailed output file in COMPAS h5 format
9+
%
10+
% examples:
11+
% BSEDetailedOutput('~/Work/COMPAS/src/COMPAS_Output/Detailed_Output/BSE_Detailed_Output_0.h5')
12+
%
213

3-
tic
414
time=h5read(file,'/Time');
515
MThistory=h5read(file,'/MT_History');
616
Z=h5read(file,'/Metallicity@ZAMS(1)');
@@ -29,8 +39,6 @@
2939
omegab1=h5read(file, '/Omega_Break(1)');
3040
omegab2=h5read(file, '/Omega_Break(2)');
3141
MTtimescale=h5read(file, '/MassTransferTimescale');
32-
inf=h5info(file);
33-
%inf.Datasets.Name
3442

3543

3644
disp('Time (Myr), Event, M1 (M_o), type1, M2 (M_o), type2, a (R_o), e');
@@ -65,8 +73,7 @@
6573
disp([num2str(time(i)+Tdelay), ' GW merger in ', num2str(Tdelay,'%.0f'), ' Myr ', num2str(mass1(i)), ' ', num2str(type1(i)),...
6674
' ', num2str(mass2(i)), ' ', num2str(type2(i))]);
6775
end;
68-
toc
6976

70-
figure(81), plot(time, mass1, 'LineWidth', 3), set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Total mass 1, M_o')
71-
%figure(81), scatter(time, radius1, 30, type1, 'filled'), set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Radius 1, R_o')
72-
figure(82), plot(time, radius2, 'b', time, RL2, 'r'); set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Radius, R_o'), legend('R_2', 'RL_2')
77+
figure(1), plot(time, mass1, 'LineWidth', 3), set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Total mass 1, M_o')
78+
%figure(2), scatter(time, radius1, 30, type1, 'filled'), set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Radius 1, R_o')
79+
figure(2), plot(time, radius2, 'b', time, RL2, 'r'); set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Radius, R_o'), legend('R_2', 'RL_2')

0 commit comments

Comments
 (0)