How to make the gradient field of the gravitaional potential or the pressure? #116
Replies: 3 comments 2 replies
-
Hi there, |
Beta Was this translation helpful? Give feedback.
-
So I will assume the gradient you want to compute is 3D in nature, such as the one you would use to compute a hydrostatic equilibrium. For making maps, I think the best would probably be to make something like a thick map of e.g. pressure, and instead of flattening it, we would just return the values in the 3D (rectangular) volume. From that grid of pressure values, we could easily compute the gradient of pressure, for example using something like https://numpy.org/doc/stable/reference/generated/numpy.gradient.html Right now there is no real way of extracting the cube of values, only the flattened values that were used to make the map (the default operation applied for a thick map is a sum along the third dimension) are returned. We would need an early return of I am currently on easter vacation, and don't really have the opportunity to try this now. But it is making me think that we should probably have a set of lower level functions to compute all the values the maps need, and make those available through the API so that people can also use them directly, instead of having to go through the One last question: did you want to make maps of the magnitude of the gradient (i.e. just an image of scalars) or do you need it as a vector and you wish to represent it as arrows or streamlines? |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply, I have tried to add some codes to your osyris program to extract the cube, but I am not familiar with the |
Beta Was this translation helpful? Give feedback.
-
By using the osyris, I can easily to make some plots, but I want to obtain the gradient field of the gravitational potential or pressure, I didn't find the right way to do this. In my opinion, First I need to tansform the gravitational field from 1d to 3d, then I choose one axis to get the gradient field. As I have known before, osyris avoid to make cube array as soon as possible, is there a convinent way using the osyris method to do this?
As well, I know the
amrcube
can give me the cube array, but I want to use python and the physical units, I only want to see the slice of gradient field, I also want to save memery when I perform the1024
data.Could you please give me some advice? Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions