Hi!

I'm not exactly sure I completely understand the question.  There are a few
things that might help:

 - You should be able to save a plot using ".save()" with no argument to
get a filename generated that should be mostly-unique and will take into
account the name of the dataset
 - Your approach using covering grids might be simplified using the ds.r
object.  You can supply complex values for step sizes to give array
lengths.  For instance, ds.r[0.5, 0.0:1.0:128j, 0.0:1.0:128j] would give a
slice at 0.5 in x, with 128 cells for each of the other two axes.  (With
flash you will have different units, but you can also use the 'full
dimension' slice with :: or specify units like 'unitary'.)

Hope that helps,

Matt

On Fri, Jun 27, 2025 at 3:46 PM <[email protected]> wrote:

> First, forgive me if this is an obvious question; I'm still pretty new to
> FLASH (the source of my hdf5 AMR data) and even newer to yt. I'm trying to
> find a good way to plot a 2-dimensional color-mapped plot of some of the
> data in the file (["flash","tele"],["flash","dens"],etc), and I've
> encountered a few methods but, as much as it annoys me to say it, none of
> them has been better (when weighted for end-user convenience) than VisIt so
> far. The yt-native SlicePlot command is... fine, but hindered by the need
> to re-run the script with an edited filename for each plot count increment.
> So I've been trying to get my data into an array form that MatPlotLib will
> accept (not that that fixes my file issue, but I know MatPlotLib better).
> Unfortunately, this means fighting with the imshow command if I want a
> colorbar at all. The meat of my question, then, is: what's the best way to
> rip all of a given data field from an hdf5 file in a way that will produce
> an nxn array of equal spacing? Currentl
>  y, I've found I can brute-force a solution by defining a covering grid
> over my data (level 0) using data_dimensions, finding the shape of my
> desired field, finding the minimum array length of that field, and defining
> a new covering grid (also level 0) limited to that minimum length in both
> of my relevant dimensions (my FLASH sims are only 2D), and using np.squeeze
> to pull out the size-1 z-index, but the most I've ever seen that output is
> 32 data points, and commonly only 16, which yields terrible plot
> resolution. I assume there's a better way of doing this; does anyone more
> experienced than me have a good way of getting this to work? I'm in
> azimuthally-symmetric cylindrical geometry, to specify. Hence why I
> actively don't want the third data axis.
> _______________________________________________
> yt-users mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3//lists/yt-users.python.org
> Member address: [email protected]
>
_______________________________________________
yt-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/yt-users.python.org
Member address: [email protected]

Reply via email to