[Load] load a generic data in 3D spherical coordinate
Dear all, I have been in trouble for reading a generic data in 3D spherical coordinate, in which the radial grid is logarithmic (i.e. nonuniform). I first tried with the function: load_uniform_grid with the option "spherical" ##### data = dict(density = (ds.rho, "g/cm**3")) bbox = np.array([[1., 20.], [0., np.pi], [0., 2*np.pi]]) ds2 = yt.load_uniform_grid(data, ds.rho.shape, bbox=bbox, geometry="spherical") ##### this could read the data, but the grid information was not correct, because the rcoordinate in my data was in logarithmic. Then I also was thinking that transform the coordinates of each cell to Cartesian coordinates and use the function: load_hexahedral_mesh(). However, it also not worked as the coordinate in my data was irregular for every direction. I though that I might need to use the function: load_unstructured_mesh() for this case. I have been trying to figure out how to use it, but it was difficult for me to understand how to set up the coordinates and connectivity. It would be wonderful if you help me to clear this out. Thanks very much, Best wishes, Doosoo
Hi Doosoo, Ah, this is very useful information! I am not sure that load_hexahedral_mesh is wrong for your use case, since it can take multiple different dimensions (there's an example of bounds being set by the cantor set in the tests, I think) but it needs to be specified using the hexahedral_connectivity function, which takes an xgrid, ygrid, zgrid set of options (or in your case, rgrid, thetagrid, phigrid). Having log bounds  or any functional form of bounds  would be a better and more maintainable solution. I think that John ZuHone may have worked on this a bit for Athena, but I believe it ended up not quite working out because of some assumptions of log/lin centering that were baked into yt. It might be time to try to revive that! Matt On Thu, Mar 7, 2019 at 10:04 AM <astrodoo@gmail.com> wrote:
Dear all,
I have been in trouble for reading a generic data in 3D spherical coordinate, in which the radial grid is logarithmic (i.e. nonuniform). I first tried with the function: load_uniform_grid with the option "spherical"
##### data = dict(density = (ds.rho, "g/cm**3")) bbox = np.array([[1., 20.], [0., np.pi], [0., 2*np.pi]]) ds2 = yt.load_uniform_grid(data, ds.rho.shape, bbox=bbox, geometry="spherical") #####
this could read the data, but the grid information was not correct, because the rcoordinate in my data was in logarithmic. Then I also was thinking that transform the coordinates of each cell to Cartesian coordinates and use the function: load_hexahedral_mesh(). However, it also not worked as the coordinate in my data was irregular for every direction.
I though that I might need to use the function: load_unstructured_mesh() for this case. I have been trying to figure out how to use it, but it was difficult for me to understand how to set up the coordinates and connectivity.
It would be wonderful if you help me to clear this out.
Thanks very much, Best wishes, Doosoo _______________________________________________ ytusers mailing list  ytusers@python.org To unsubscribe send an email to ytusersleave@python.org
Hi Matt, Thanks for the quick reply and it was really great to see you here. (I was excited to have your introduction of yt many years ago at WisconsinMadison). The data structure of mine is more or less similar to that from Athena++, so I am looking forward to John ZnHone progressing it. Thanks, Best wishes, Doosoo
Hi Doosoo, On Fri, Mar 8, 2019 at 7:20 AM Doosoo Yoon <astrodoo@gmail.com> wrote:
Hi Matt,
Thanks for the quick reply and it was really great to see you here. (I was excited to have your introduction of yt many years ago at WisconsinMadison).
The data structure of mine is more or less similar to that from Athena++, so I am looking forward to John ZnHone progressing it.
Ah, my apologies, I should have indicated that John might not be working on it, but that it's a project that could be revived! Would you mind opening an issue on github about logspaced bins, and we can iterate there?
Thanks, Best wishes, Doosoo _______________________________________________ ytusers mailing list  ytusers@python.org To unsubscribe send an email to ytusersleave@python.org
participants (3)

astrodoo＠gmail.com

Doosoo Yoon

Matthew Turk