-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Some background: I am making some routines to plot 3D cutouts from the different "Slices" data and finally am seeing how Meridional_Slices, Equatorial_Slices, and Shell_Slices connect. Sorry @feathern if I am reinventing the wheel!
I think there is a problem with the range in which longitude is measured (either (0, 2pi) or (-pi, pi)) and different classes assume different ranges.
Anyway it seems the current situation is this:
GridInfo says "phi" = [0, .... 2pi) (ascending order)
Meridional_Slices say "phi" =(2pi, .... 0] (descending order) and "phi_inds" is ALSO in descending order
Meridional_Slices is thus consistent with GridInfo, but it would imply that the actual phi array is indexed in ASCENDING order, which is opposite to radius and theta. That's fine, but it should maybe be mentioned somewhere (or maybe I missed it). It's convenient, because then phi is positive left to right (x axis) and theta is positive south to north (y axis).
Then there are Shell_Slices/Equatorial_Slices. They seem to be consistent with each other (i.e. flows at the same phi index are continuous), but not with the Meridional_Slices. I.e., a Meridional_Slice at phi_ind = 185, will not be continuous with an Equatorial_Slice at index 185 in the phi part of the array.
I think what happened is that Shell_Slices/Equatorial_Slices implicitly assume the phi array that describes the slice is in the order
[-pi ,.... , pi)
If you assume that, then all the flows seem continuous, at least in my spherical cutout projections!
Obviously, the zero-point of longitude is arbitrary, but it should be the same for all data outputs.
Note that the Equatorial_Slices class has a phi attribute, in the range 0 to 2pi and this seems wrong.
To make everything consistent (and to definitely not change anything about how the code outputs or how the user inputs anything), what I'd propose is to edit the Equatorial_Slices and Shell_Slices classes to roll all the arrays in the phi direction by nphi/2. And add a "phi" attribute (in the range 0 to 2pi, same as the other classes) to the Shell_Slices class, which it currently lacks. This would bring everything into consistency with Meridional_Slices. Meridional_Slices and Point_Probes (I think) are the only place where the user can choose specific longitudes to output. I haven't worked at all with Point_Probes, but I assume they are consistent with Meridional_Slices. Anyway, I think this fix would effectively make the Meridional_Slices set the zero-point of longitude for everyone.
Probably more confusing than it needed to be! Lmk if I am just going crazy, since that's possible too :)