-
Notifications
You must be signed in to change notification settings - Fork 1
Grid Output Format
For convenience, some data on coordinate locations and local metric is kept in a "grid file", named grid.h5
, in the same directory as any dump files.
This is entirely optional, as all parameters are saved in the header, for both the grid construction (startx{1,2,3}, dx{1,2,3}, N{1,2,3}) and for the transformations (a, hslope, poly_alpha, poly_xt, mks_smooth). The grid is then uniform and logically Cartesian in native coordinates. For example, zone centers in X1:
X1[i] = startx1 + (i+0.5)*dx1
From which the transformations x1->r, x2->th are documented on the coordinates page.
However, some applications (plotting, basic integrals) only need the locations of grid centers in KS coordinates, and/or the local metric in native coordinates, for each grid zone. The grid file provides a cache of these values as follows:
-
X1, X2, X3: Native coordinates. These are always in a uniformly spaced Cartesian grid as described above
-
r, th, phi: Spherical Kerr-Schild coordinates of each zone above
-
X, Y, Z: Cartesian KS coordinates of each zone (just r*sin(th)*cos(phi), etc, for above r, th, phi)
-
gcon: Contravariant metric in native coordinates, evaluated at each zone center. Metric indices are last, i.e. shape is N1xN2xN3x4x4
-
gcov: Contravariant metric
-
gdet: Metric determinant sqrt(-g)
-
lapse: Lapse function alpha=(1/sqrt(-g^00))
Note that some grid files (those for dumps converted from KORAL format) additionally have versions of the metric gcon_vector, gcov_vector, gdet_vector, lapse_vector for the coordinate system used for vectors. These are only provided in the case that the coordinate systems used for zone locations and vectors differ.
A Python tool for generating gridfiles on the fly, based on pyHARM, is available in the pyHARM repository as scripts/write_grid.py