Paste #404

Welcome To LodgeIt

Welcome to the LodgeIt pastebin. In order to use the notification feature a 31 day cookie with an unique ID was created for you. The lodgeit database does not store any information about you, it's just used for an advanced pastebin experience :-). Read more on the about lodgeit page. Have fun :-)

hide this notification

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import yt

min_coord = [0.0, 0.0, 0.0] # Coordinates for the corners of the box - taking the whole simulation domaine
max_coord = [1.0, 1.0, 1.0]

# Preload an output and allocate the array
ds = yt.load('./output_00002/info_00002.txt')
box = ds.box(min_coord, max_coord)
vz = box[('gas', 'velocity_z')]

# Simulate reading a 1000 outputs in a row
for i in range(1000):
    # Load the dataset and read in z velocity field
    ds = yt.load('./output_00002/info_00002.txt')
    box = ds.box(min_coord, max_coord)
    vz = box[('gas', 'velocity_z')]
    
    #del box, vz
    #ds.clear_data()

print('Done processing!')