yt is designed for analysis and visualization of datasets that describe "natural" or "physical" phenomena; more generally, yt is designed to analyze data that can be characterized by a metric of some type.
The most common use case, by far, is that of data that is described in a Cartesian space, by the orthogonal axes of x, y and z.
However, for reasons related to naturalness of coordinate systems and relevance to physical phenomena, datasets are also frequently organized in other coordinate systems, such as cylindrical polar (
Importantly, however, yt distinguishes between the coordinate space a dataset describes and the natural or index space by which its organization is described.
This distinction is the most relevant among datasets and data formats where the organization is implicit, rather than explicit; for instance, in a grid patch dataset, data variable locations are often only specified implicitly.
For a grid volume that covers a given region, the relationship between the "index" value of a cell (for instance,
In Figure @fig:coordinate_space we demonstrate one possible mapping.
We note that the specific data layout is not optimized for IO throughput, and is unlikely to be exactly replicated in real world formats.
In this case, the data points may be laid out sequentially on disk (or in memory) and a mapping function translates these into position and extent in the coordinate system, here cylindrical coordinates.
For instance, there may be a cell that spans
yt provides a system for defining relationships between index-space and coordinate-space.
During instantiation of a Dataset
object, a helper object (coordinates
, a subclass of CoordinateHandler
) is created.
This helper object tracks the correspondence between numerical axes and spatial axes (for instance, even in some Cartesian datasets, axis 0 corresponds to
At present, coordinate spaces are defined in the spaces enumerated in Table @tbl:coord-systems. While these are representative of the most common spatial representations, additional representations (such as those that include a non-trivial mapping between coordinates and index values) are possible to implement.
Coordinate system | Axes |
---|---|
Cartesian coordinates | |
Cylindrical polar coordinates | |
Spherical coordinates | |
Geographic coordinates | latitude |
Internal geographic coordinates | latitude, longitude, depth |
Spectral cube | Image |
Table: Extant coordinate systems; in all cases, value ranges should be taken to describe extent rather than specific boundary points. {#tbl:coord-systems}
Future developments may involve code generation for arbitrary coordinate systems, using SymPy or other libraries.
Independent of the visualization methods (which can often be reused), the development of coordinate systems is largely rote, applying straightforward mathematics to construct derived field definitions.
As such, using mechanisms in SymPy for construction of relationships between coordinate systems may be a feasible method of developing code-generation for coordinate system handlers in yt
.