From 5c803e7a7ece4de0e58f30d3cca0e592e7cb8e6b Mon Sep 17 00:00:00 2001 From: chrishavlin Date: Fri, 23 Oct 2026 14:38:32 -0500 Subject: [PATCH] update text in stretched grid to uni grid nb --- ...ample_011_stretched_grids_as_uniform.ipynb | 295 +++++++++++------- 1 file changed, 179 insertions(+), 116 deletions(-) diff --git a/docs/examples/example_011_stretched_grids_as_uniform.ipynb b/docs/examples/example_011_stretched_grids_as_uniform.ipynb index cb652c4..80788e8 100644 --- a/docs/examples/example_011_stretched_grids_as_uniform.ipynb +++ b/docs/examples/example_011_stretched_grids_as_uniform.ipynb @@ -572,12 +572,12 @@ "Data variables:\n", " temperature (x, y, z) float64 51kB 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0\n", "Attributes:\n", - " geospatial_vertical_units: m
  • geospatial_vertical_units :
    m
  • " ], "text/plain": [ " Size: 52kB\n", @@ -721,28 +721,28 @@ "name": "stderr", "output_type": "stream", "text": [ - "yt_xarray : [INFO ] 2026-10-22 15:45:45,899: Inferred geometry type is cartesian. To override, use ds.yt.set_geometry\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:45,899: Attempting to detect if yt_xarray will require field interpolation:\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:45,899: stretched grid detected: yt_xarray will interpolate.\n", - "yt : [INFO ] 2026-10-22 15:45:45,924 Parameters: current_time = 0.0\n", - "yt : [INFO ] 2026-10-22 15:45:45,924 Parameters: domain_dimensions = [30 22 8]\n", - "yt : [INFO ] 2026-10-22 15:45:45,925 Parameters: domain_left_edge = [0. 0. 0.]\n", - "yt : [INFO ] 2026-10-22 15:45:45,925 Parameters: domain_right_edge = [4. 2. 1.]\n", - "yt : [INFO ] 2026-10-22 15:45:45,926 Parameters: cosmological_simulation = 0\n", - "yt : [INFO ] 2026-10-22 15:45:46,162 xlim = 0.000000 4.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,163 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,163 xlim = 0.000000 4.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,163 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,164 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" + "yt_xarray : [INFO ] 2026-10-23 14:38:09,536: Inferred geometry type is cartesian. To override, use ds.yt.set_geometry\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:09,537: Attempting to detect if yt_xarray will require field interpolation:\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:09,537: stretched grid detected: yt_xarray will interpolate.\n", + "yt : [INFO ] 2026-10-23 14:38:09,576 Parameters: current_time = 0.0\n", + "yt : [INFO ] 2026-10-23 14:38:09,577 Parameters: domain_dimensions = [30 22 8]\n", + "yt : [INFO ] 2026-10-23 14:38:09,577 Parameters: domain_left_edge = [0. 0. 0.]\n", + "yt : [INFO ] 2026-10-23 14:38:09,577 Parameters: domain_right_edge = [4. 2. 1.]\n", + "yt : [INFO ] 2026-10-23 14:38:09,578 Parameters: cosmological_simulation = 0\n", + "yt : [INFO ] 2026-10-23 14:38:09,765 xlim = 0.000000 4.000000\n", + "yt : [INFO ] 2026-10-23 14:38:09,766 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:09,766 xlim = 0.000000 4.000000\n", + "yt : [INFO ] 2026-10-23 14:38:09,767 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:09,769 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" ] }, { "data": { "text/html": [ - "
    " + "
    " ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -779,34 +779,46 @@ "name": "stderr", "output_type": "stream", "text": [ - "yt_xarray : [INFO ] 2026-10-22 15:45:46,549: Using a cell_spacing of [0.03125 0.03125 0.125 ].\n", - "yt : [INFO ] 2026-10-22 15:45:46,564 Parameters: current_time = 0.0\n", - "yt : [INFO ] 2026-10-22 15:45:46,565 Parameters: domain_dimensions = [128 64 8]\n", - "yt : [INFO ] 2026-10-22 15:45:46,565 Parameters: domain_left_edge = [0. 0. 0.]\n", - "yt : [INFO ] 2026-10-22 15:45:46,565 Parameters: domain_right_edge = [4. 2. 1.]\n", - "yt : [INFO ] 2026-10-22 15:45:46,565 Parameters: cosmological_simulation = 0\n", - "yt : [INFO ] 2026-10-22 15:45:46,597 xlim = 0.000000 4.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,597 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,597 xlim = 0.000000 4.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,597 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,598 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" + "yt_xarray : [INFO ] 2026-10-23 14:38:10,402: Using a cell_spacing of [0.03125 0.03125 0.125 ].\n", + "yt : [INFO ] 2026-10-23 14:38:10,430 Parameters: current_time = 0.0\n", + "yt : [INFO ] 2026-10-23 14:38:10,431 Parameters: domain_dimensions = [128 64 8]\n", + "yt : [INFO ] 2026-10-23 14:38:10,431 Parameters: domain_left_edge = [0. 0. 0.]\n", + "yt : [INFO ] 2026-10-23 14:38:10,432 Parameters: domain_right_edge = [4. 2. 1.]\n", + "yt : [INFO ] 2026-10-23 14:38:10,432 Parameters: cosmological_simulation = 0\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "domain dimensions: [128 64 8]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "yt : [INFO ] 2026-10-23 14:38:10,502 xlim = 0.000000 4.000000\n", + "yt : [INFO ] 2026-10-23 14:38:10,502 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:10,503 xlim = 0.000000 4.000000\n", + "yt : [INFO ] 2026-10-23 14:38:10,503 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:10,505 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "domain dimensions: [128 64 8]\n", "cell spacing: [0.03125 0.03125 0.125 ]\n" ] }, { "data": { "text/html": [ - "
    " + "
    " ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -829,7 +841,9 @@ "id": "2ccba4da", "metadata": {}, "source": [ - "The bounding box and cell spacing can be set explicitly, by coordinate name. The bounding box may extend beyond the data, in which case cells outside the data are filled with `fill_value` (`np.nan` by default). If a bounding box width is not an integer multiple of the spacing, the maximum edge is extended so that it is:" + "The bounding box and cell spacing can be set explicitly, by coordinate name. The bounding box may extend beyond the data, in which case cells outside the data are filled with `fill_value` (`np.nan` by default). If a bounding box width is not an integer multiple of the spacing, the maximum edge is extended so that it is. \n", + "\n", + "The following chooses a coarse cell spacing and a subset of the full bounding box, resulting in a downsampled uniform grid:" ] }, { @@ -842,16 +856,16 @@ "name": "stderr", "output_type": "stream", "text": [ - "yt : [INFO ] 2026-10-22 15:45:46,846 Parameters: current_time = 0.0\n", - "yt : [INFO ] 2026-10-22 15:45:46,847 Parameters: domain_dimensions = [15 10 4]\n", - "yt : [INFO ] 2026-10-22 15:45:46,847 Parameters: domain_left_edge = [0.5 0. 0. ]\n", - "yt : [INFO ] 2026-10-22 15:45:46,847 Parameters: domain_right_edge = [3.5 2. 1. ]\n", - "yt : [INFO ] 2026-10-22 15:45:46,848 Parameters: cosmological_simulation = 0\n", - "yt : [INFO ] 2026-10-22 15:45:46,883 xlim = 0.500000 3.500000\n", - "yt : [INFO ] 2026-10-22 15:45:46,883 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,883 xlim = 0.500000 3.500000\n", - "yt : [INFO ] 2026-10-22 15:45:46,884 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:46,884 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" + "yt : [INFO ] 2026-10-23 14:38:10,971 Parameters: current_time = 0.0\n", + "yt : [INFO ] 2026-10-23 14:38:10,972 Parameters: domain_dimensions = [15 10 4]\n", + "yt : [INFO ] 2026-10-23 14:38:10,972 Parameters: domain_left_edge = [0.5 0. 0. ]\n", + "yt : [INFO ] 2026-10-23 14:38:10,974 Parameters: domain_right_edge = [3.5 2. 1. ]\n", + "yt : [INFO ] 2026-10-23 14:38:10,974 Parameters: cosmological_simulation = 0\n", + "yt : [INFO ] 2026-10-23 14:38:11,042 xlim = 0.500000 3.500000\n", + "yt : [INFO ] 2026-10-23 14:38:11,043 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:11,043 xlim = 0.500000 3.500000\n", + "yt : [INFO ] 2026-10-23 14:38:11,044 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:11,045 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" ] }, { @@ -864,10 +878,10 @@ { "data": { "text/html": [ - "
    " + "
    " ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -905,22 +919,18 @@ "name": "stderr", "output_type": "stream", "text": [ - "yt_xarray : [INFO ] 2026-10-22 15:45:47,139: Using a cell_spacing of [0.03125 0.03125 0.125 ].\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,139: Constructing a yt chunked grid with 8 chunks.\n", - "yt : [INFO ] 2026-10-22 15:45:47,157 Parameters: current_time = 0.0\n", - "yt : [INFO ] 2026-10-22 15:45:47,157 Parameters: domain_dimensions = [128 64 8]\n", - "yt : [INFO ] 2026-10-22 15:45:47,158 Parameters: domain_left_edge = [0. 0. 0.]\n", - "yt : [INFO ] 2026-10-22 15:45:47,158 Parameters: domain_right_edge = [4. 2. 1.]\n", - "yt : [INFO ] 2026-10-22 15:45:47,158 Parameters: cosmological_simulation = 0\n", - "yt : [INFO ] 2026-10-22 15:45:47,202 xlim = 0.000000 4.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,203 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,203 xlim = 0.000000 4.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,203 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,204 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n", - "/Users/chavlin/src/yt_/yt_xarray_/yt_xarray/.venv/lib/python3.12/site-packages/unyt/array.py:2030: RuntimeWarning: invalid value encountered in divide\n", - " out_arr = func(\n", - "/Users/chavlin/src/yt_/yt_xarray_/yt_xarray/.venv/lib/python3.12/site-packages/yt/visualization/image_writer.py:269: RuntimeWarning: invalid value encountered in cast\n", - " mapped = np.dstack([(np.interp(buff, x, v) * 255).astype(\"uint8\") for v in lut])\n" + "yt_xarray : [INFO ] 2026-10-23 14:38:11,524: Using a cell_spacing of [0.03125 0.03125 0.125 ].\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:11,525: Constructing a yt chunked grid with 8 chunks.\n", + "yt : [INFO ] 2026-10-23 14:38:11,549 Parameters: current_time = 0.0\n", + "yt : [INFO ] 2026-10-23 14:38:11,549 Parameters: domain_dimensions = [128 64 8]\n", + "yt : [INFO ] 2026-10-23 14:38:11,550 Parameters: domain_left_edge = [0. 0. 0.]\n", + "yt : [INFO ] 2026-10-23 14:38:11,550 Parameters: domain_right_edge = [4. 2. 1.]\n", + "yt : [INFO ] 2026-10-23 14:38:11,551 Parameters: cosmological_simulation = 0\n", + "yt : [INFO ] 2026-10-23 14:38:11,638 xlim = 0.000000 4.000000\n", + "yt : [INFO ] 2026-10-23 14:38:11,638 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:11,639 xlim = 0.000000 4.000000\n", + "yt : [INFO ] 2026-10-23 14:38:11,639 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:11,640 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" ] }, { @@ -930,13 +940,23 @@ "number of grids: 8\n" ] }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/chavlin/src/yt_general/geodata/yt_xarray/.venv/lib/python3.12/site-packages/unyt/array.py:2030: RuntimeWarning: invalid value encountered in divide\n", + " out_arr = func(\n", + "/home/chavlin/src/yt_general/geodata/yt_xarray/.venv/lib/python3.12/site-packages/yt/visualization/image_writer.py:269: RuntimeWarning: invalid value encountered in cast\n", + " mapped = np.dstack([(np.interp(buff, x, v) * 255).astype(\"uint8\") for v in lut])\n" + ] + }, { "data": { "text/html": [ - "
    " + "
    " ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -975,51 +995,39 @@ "name": "stderr", "output_type": "stream", "text": [ - "yt_xarray : [INFO ] 2026-10-22 15:45:47,364: Using a cell_spacing of [0.25 0.25 0.125].\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,366: level 0: 1 grids, 1024 cells\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,366: level 1: 3 grids, 2816 cells\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,370: level 2: 5 grids, 22528 cells\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,370: level 3: 5 grids, 180224 cells\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,371: Refined grid plan has 206592 cells in 14 grids. A uniform grid at the finest source spacing would have 65536 cells.\n", - "yt : [INFO ] 2026-10-22 15:45:47,384 Parameters: current_time = 0.0\n", - "yt : [INFO ] 2026-10-22 15:45:47,384 Parameters: domain_dimensions = [16 8 8]\n", - "yt : [INFO ] 2026-10-22 15:45:47,385 Parameters: domain_left_edge = [0. 0. 0.]\n", - "yt : [INFO ] 2026-10-22 15:45:47,385 Parameters: domain_right_edge = [4. 2. 1.]\n", - "yt : [INFO ] 2026-10-22 15:45:47,385 Parameters: cosmological_simulation = 0\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "level 0 dimensions: [16 8 8]\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "yt : [INFO ] 2026-10-22 15:45:47,440 xlim = 0.000000 4.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,441 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,441 xlim = 0.000000 4.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,441 ylim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,442 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" + "yt_xarray : [INFO ] 2026-10-23 14:38:11,982: Using a cell_spacing of [0.25 0.25 0.125].\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:11,991: level 0: 1 grids, 1024 cells\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:11,991: level 1: 3 grids, 2816 cells\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:11,992: level 2: 5 grids, 22528 cells\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:11,992: level 3: 5 grids, 180224 cells\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:11,992: Refined grid plan has 206592 cells in 14 grids. A uniform grid at the finest source spacing would have 65536 cells.\n", + "yt : [INFO ] 2026-10-23 14:38:12,018 Parameters: current_time = 0.0\n", + "yt : [INFO ] 2026-10-23 14:38:12,019 Parameters: domain_dimensions = [16 8 8]\n", + "yt : [INFO ] 2026-10-23 14:38:12,019 Parameters: domain_left_edge = [0. 0. 0.]\n", + "yt : [INFO ] 2026-10-23 14:38:12,020 Parameters: domain_right_edge = [4. 2. 1.]\n", + "yt : [INFO ] 2026-10-23 14:38:12,020 Parameters: cosmological_simulation = 0\n", + "yt : [INFO ] 2026-10-23 14:38:12,139 xlim = 0.000000 4.000000\n", + "yt : [INFO ] 2026-10-23 14:38:12,140 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:12,140 xlim = 0.000000 4.000000\n", + "yt : [INFO ] 2026-10-23 14:38:12,140 ylim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:12,142 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "level 0 dimensions: [16 8 8]\n", "max level: 3\n" ] }, { "data": { "text/html": [ - "
    " + "
    " ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1085,7 +1093,9 @@ "id": "8d770849", "metadata": {}, "source": [ - "For a grid that is only stretched in some dimensions, `refine_by` can be given per dimension as a dictionary keyed by coordinate name (so you don't need to know the internal dimension order). A refinement factor of 1 means that dimension is never refined, and the level 0 spacing in that dimension defaults to the smallest spacing of the stretched grid. Slicing along `x` through the center of the domain shows the `y`-`z` plane: cells are refined in `y` but keep the coarse spacing in `z`:" + "For a grid that is only stretched in some dimensions, `refine_by` can be given per dimension as a dictionary keyed by coordinate name (so you don't need to know the internal dimension order). A refinement factor of 1 means that dimension is never refined, and the level 0 spacing in that dimension defaults to the smallest spacing of the stretched grid. Slicing along `x` through the center of the domain shows the `y`-`z` plane: cells are refined in `y` but keep the coarse spacing in `z`. \n", + "\n", + "In the following, we plot a slice normal to `x` (as opposed to the `z`-normal plots above) to show that the spacing is not refined. " ] }, { @@ -1098,22 +1108,22 @@ "name": "stderr", "output_type": "stream", "text": [ - "yt_xarray : [INFO ] 2026-10-22 15:45:47,642: Using a cell_spacing of [0.25 0.25 0.125].\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,647: level 0: 1 grids, 1024 cells\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,647: level 1: 3 grids, 1408 cells\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,648: level 2: 5 grids, 5632 cells\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,648: level 3: 5 grids, 22528 cells\n", - "yt_xarray : [INFO ] 2026-10-22 15:45:47,700: Refined grid plan has 30592 cells in 14 grids. A uniform grid at the finest source spacing would have 65536 cells.\n", - "yt : [INFO ] 2026-10-22 15:45:47,713 Parameters: current_time = 0.0\n", - "yt : [INFO ] 2026-10-22 15:45:47,714 Parameters: domain_dimensions = [16 8 8]\n", - "yt : [INFO ] 2026-10-22 15:45:47,714 Parameters: domain_left_edge = [0. 0. 0.]\n", - "yt : [INFO ] 2026-10-22 15:45:47,714 Parameters: domain_right_edge = [4. 2. 1.]\n", - "yt : [INFO ] 2026-10-22 15:45:47,714 Parameters: cosmological_simulation = 0\n", - "yt : [INFO ] 2026-10-22 15:45:47,763 xlim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,763 ylim = 0.000000 1.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,764 xlim = 0.000000 2.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,764 ylim = 0.000000 1.000000\n", - "yt : [INFO ] 2026-10-22 15:45:47,765 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" + "yt_xarray : [INFO ] 2026-10-23 14:38:12,645: Using a cell_spacing of [0.25 0.25 0.125].\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:12,647: level 0: 1 grids, 1024 cells\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:12,648: level 1: 3 grids, 1408 cells\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:12,648: level 2: 5 grids, 5632 cells\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:12,648: level 3: 5 grids, 22528 cells\n", + "yt_xarray : [INFO ] 2026-10-23 14:38:12,648: Refined grid plan has 30592 cells in 14 grids. A uniform grid at the finest source spacing would have 65536 cells.\n", + "yt : [INFO ] 2026-10-23 14:38:12,672 Parameters: current_time = 0.0\n", + "yt : [INFO ] 2026-10-23 14:38:12,672 Parameters: domain_dimensions = [16 8 8]\n", + "yt : [INFO ] 2026-10-23 14:38:12,673 Parameters: domain_left_edge = [0. 0. 0.]\n", + "yt : [INFO ] 2026-10-23 14:38:12,673 Parameters: domain_right_edge = [4. 2. 1.]\n", + "yt : [INFO ] 2026-10-23 14:38:12,673 Parameters: cosmological_simulation = 0\n", + "yt : [INFO ] 2026-10-23 14:38:12,769 xlim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:12,769 ylim = 0.000000 1.000000\n", + "yt : [INFO ] 2026-10-23 14:38:12,769 xlim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:12,770 ylim = 0.000000 1.000000\n", + "yt : [INFO ] 2026-10-23 14:38:12,771 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" ] }, { @@ -1130,10 +1140,10 @@ { "data": { "text/html": [ - "
    " + "
    " ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1151,6 +1161,59 @@ "slc.show()" ] }, + { + "cell_type": "markdown", + "id": "62b79d9f-619f-4379-ab20-62dc2b23fba1", + "metadata": {}, + "source": [ + "For reference, here is the raw stretched grid normal to `x`: " + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "0d8066f4-19ca-4ed5-9ef4-ec9dbcb314cf", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "yt : [INFO ] 2026-10-23 14:38:13,155 xlim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:13,155 ylim = 0.000000 1.000000\n", + "yt : [INFO ] 2026-10-23 14:38:13,156 xlim = 0.000000 2.000000\n", + "yt : [INFO ] 2026-10-23 14:38:13,157 ylim = 0.000000 1.000000\n", + "yt : [INFO ] 2026-10-23 14:38:13,157 Making a fixed resolution buffer of (('stream', 'temperature')) 800 by 800\n" + ] + }, + { + "data": { + "text/html": [ + "
    " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "slc = yt.SlicePlot(ds_yt, \"x\", (\"stream\", \"temperature\"), origin=\"native\")\n", + "slc.set_log((\"stream\", \"temperature\"), False)\n", + "slc.annotate_cell_edges()\n", + "slc.show()" + ] + }, + { + "cell_type": "markdown", + "id": "0797cb1a-218f-47ec-bcaf-b24b1d904353", + "metadata": {}, + "source": [ + "And you can see the z-cell spacing matches. " + ] + }, { "cell_type": "markdown", "id": "b435f13d", @@ -1163,7 +1226,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "id": "61de2d2f", "metadata": {}, "outputs": [ @@ -1173,7 +1236,7 @@ "(128, 64, 8)" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" }