Extracting 3D data and position values
Hi all, I'm using yt to extract 3D data from a Ramses simulation cube. Specifically, I want to extract ("gas", "velocity_x") values from a smaller region within the cube. After this, I need to generate a set of (x,y,z) coordinates that correspond to the positions of those data values. So far I have tried doing this with ds.r and meshgrid (my code is given below). However, I'm uncertain if the ordering of my x,y,z coordinates matches the ordering of the data values? Is this the best method to do this? I question whether I should be using covering_grid instead, but am struggling to figure out how to use covering_grid to select out data for only a specific region within the simulation (the sim seems to extend between -300 to 300kpc in all dimensions, but I only want data between -15 to 15 kpc in all dimensions) Thanks for any help! Here is my code: sl = ds.r[(285, 'kpc'):(315, 'kpc'):400j, (285, 'kpc'):(315, 'kpc'):400j, (285, 'kpc'):(315, 'kpc'):400j)] x_ = np.linspace(-15,15,400) y_ = np.linspace(-15,15,400) z_ = np.linspace(-15,15,400) x,y,z = np.meshgrid(x_,y_,z_, indexing= 'ij')
participants (2)
-
hdav7324@uni.sydney.edu.au
-
Matthew Turk