Hi Anthony,

I think you're on the right track.  I've never written SILO outputs before, but getting the data is exactly as you describe -- accessing each grid object off of ds.index.grids as a dictionary.  If you want the raw, unprocessed data (in the native units of the dataset) you can get this by iterating over the ds.fields.SIMULATIONCODENAME object, where SIMULATIONCODENAME is whatever the name of your code on disk is.  Alternately you can look at the contents of ds.field_list, which is just the set of on-disk fields.  Exporting these to something that is a SILO-like format may be sufficient.

Does that help?

On Fri, Feb 12, 2021 at 1:50 PM Egeln,Anthony A,Jr <anthony.egeln@ufl.edu> wrote:

Good afternoon!

 

I am a PhD student at the University of Florida and am looking to use yt for a relatively specific function. In the past I have used it to create flat grids of data to export and give to other groups. These worked well due to their ability to flatten the adaptive mesh and interpolate between points to provide a nice, smooth mesh.

 

What I would like to do now is be able to iterate through the grids that are stored in the yt object in order to output the whole data array. I need to do this in order to get the full spectrum of data and output it into a different file format (.SILO). The group requesting this information is looking to avoid flattening the data and wants access to the different levels of information in the adaptive mesh.

 

I’ve come across several ways to access information about the individual grids of the stored data. Once I have loaded the file [often as an object called ds, ds = yt.load(file)], I can view information such as the grid names, the number of grids, and the size of grids through functions such as ds.index.grids, etc. Is there another function similar to index that allows the user to call data from an individual grid? For example, with index.grids[XXXX].size I can see that grid XXXX is [16 16 1]. I would like to be able to output that individual grid to an array. If it’s simpler maybe only export the data for say, ‘temperature’. I have found some calls to a similar process in the URL below:

 

https://yt-project.org/doc/quickstart/data_inspection.html

 

Thank you for your time. Please let me know if you are able to provide assistance in this matter.

 

Have a great day!

 

Anthony Egeln Jr.
University of Florida
anthony.egeln@ufl.edu
904 652 3159

_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: matthewturk@gmail.com