You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Adnan-Ali-Ahmad
Passing from Cartesian to other coordinate systems, like cylindrical or spherical for example, where you can also specify your basis. These are things that can simplify a lot of people's notebooks.
@nvaytet
We would probably need the option to provide a custom origin for the coordinate system.
Any good ideas for a name for such a module/function? osyris.spatial.cartesian_to_spherical, osyris.spatial.cartesian_to_cylindrical?
@Adnan-Ali-Ahmad
I was thinking of having a single function wrap up everything, something like osyris.spatial.get_components(dataset, system="spherical", origin = [x,y,z], basis=[ux,uy,uz]). Keep in mind that by "basis" I mean how the unit vectors are oriented with respect to the base cartesian grid (eg. [0,0,1] means that the sphere's northern axis is aligned with the "z" axis, maybe you can find a better name for this).
One thing we might want to consider is what the user actually wants transformed (eg. does he want the velocity components to be expressed in spherical coordinates?, the B field? xyz? all?) and how we handle this in the call to the function. A clean way of doing this would be to make the coordinate system an intrinsic part of the dataset class, so a user can change coordinate systems by doing dataset.transform(system="spherical", origin=[0,0,0], basis=[0,0,1]) and the routine transforms all coordinate-dependent quantities in the dataset (position & vector quantities). Although this might be a bit too much work, it has the benefit of reduced memory usage.
The text was updated successfully, but these errors were encountered:
nvaytet
changed the title
Conversions between cartesian and sperical, cylindrical coordinate systems
Conversions between cartesian and spherical, cylindrical coordinate systems
Feb 9, 2022
@Adnan-Ali-Ahmad
Passing from Cartesian to other coordinate systems, like cylindrical or spherical for example, where you can also specify your basis. These are things that can simplify a lot of people's notebooks.
@nvaytet
We would probably need the option to provide a custom origin for the coordinate system.
Any good ideas for a name for such a module/function?
osyris.spatial.cartesian_to_spherical
,osyris.spatial.cartesian_to_cylindrical
?@Adnan-Ali-Ahmad
I was thinking of having a single function wrap up everything, something like
osyris.spatial.get_components(dataset, system="spherical", origin = [x,y,z], basis=[ux,uy,uz])
. Keep in mind that by "basis" I mean how the unit vectors are oriented with respect to the base cartesian grid (eg. [0,0,1] means that the sphere's northern axis is aligned with the "z" axis, maybe you can find a better name for this).One thing we might want to consider is what the user actually wants transformed (eg. does he want the velocity components to be expressed in spherical coordinates?, the B field? xyz? all?) and how we handle this in the call to the function. A clean way of doing this would be to make the coordinate system an intrinsic part of the dataset class, so a user can change coordinate systems by doing
dataset.transform(system="spherical", origin=[0,0,0], basis=[0,0,1])
and the routine transforms all coordinate-dependent quantities in the dataset (position & vector quantities). Although this might be a bit too much work, it has the benefit of reduced memory usage.The text was updated successfully, but these errors were encountered: