Commit 697b040f authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

clear out old test cases.


Former-commit-id: fb86ebbf1947a5e7a8b366e905d35ec0718a8942
parent a44d9a54
% Remove any old data
!rm -f *.txt
% Loop over the input files
range = [ Inf , -Inf ];
avg = [ 0 , 0 , 0 ];
count = 0;
shift = [ 5e3 5e3 5e3 ];
% Get the file name
fname = 'snap_245.hdf5';
% Get the coordinates
coord = double( h5read( fname , '/PartType0/Coordinates' )' );
coord = coord - repmat( shift , size( coord , 1 ) , 1 );
% Get the smoothing lengths
h = double( h5read( fname , '/PartType0/SmoothingLength' ) );
% Remove entries with too large smoothing lengths
ind = (h < 150);
coord = coord(ind,:);
h = h(ind);
% Save the data
save Coordinates.txt -ascii -double -append coord
save SmoothingLength.txt -ascii -double -append h
% Get some statistics
count = size( coord , 1 );
avg = sum( coord , 1 ) / count;
range(1) = min( range(1) , min(min(coord)) );
range(2) = max( range(2) , max(max(coord)) );
% Display some statistics
disp( sprintf( 'read %i particles' , count ) );
disp( sprintf( 'range of coords is [ %e , %e ]' , range(1) , range(2) ) );
disp( sprintf( 'range of h is [ %e , %e ]' , min(h) , max(h) ) );
disp( sprintf( 'avg position is [ %e , %e , %e ]' , avg(1) , avg(2) , avg(3) ) );
d663048bf44926a90abbbf0205556d751d6f70e4
\ No newline at end of file
% Remove any old data
!rm -f *.txt
% Loop over the input files
range = [ Inf , -Inf ];
avg = [ 0 , 0 , 0 ];
count = 0;
shift = [ 4.331456e+01 , 4.097030e+01 , 4.383432e+01 ];
for i=0:15
% Get the file name
fname = sprintf( 'snap_C09_200_000.%i.hdf5' , i );
% Get the coordinates
coord = double( h5read( fname , '/PartType0/Coordinates' )' );
coord = coord - repmat( shift , size( coord , 1 ) , 1 );
save Coordinates.txt -ascii -double -append coord
% Adjust the range
range(1) = min( range(1) , min(min(coord)) );
range(2) = max( range(2) , max(max(coord)) );
avg = avg + sum( coord , 1 );
count = count + size( coord , 1 );
% Get the smoothing lengths
h = double( h5read( fname , '/PartType0/SmoothingLength' ) );
save SmoothingLength.txt -ascii -double -append h
end
% Display some statistics
disp( sprintf( 'read %i particles' , count ) );
disp( sprintf( 'range of coords is [ %e , %e ]' , range(1) , range(2) ) );
disp( sprintf( 'avg position is [ %e , %e , %e ]' , avg(1)/count , avg(2)/count , avg(3)/count ) );
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment