Skip to content

Commit

Permalink
Updating fits radio cubes notebook.
Browse files Browse the repository at this point in the history
  • Loading branch information
chummels committed May 20, 2021
1 parent e888bd1 commit 0ed9121
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions doc/source/cookbook/fits_radio_cubes.ipynb
Expand Up @@ -61,7 +61,7 @@
},
"outputs": [],
"source": [
"slc = yt.SlicePlot(ds, \"z\", [\"intensity\"], origin=\"native\")\n",
"slc = yt.SlicePlot(ds, \"z\", [(\"gas\", \"intensity\")], origin=\"native\")\n",
"slc.show()"
]
},
Expand Down Expand Up @@ -137,7 +137,7 @@
},
"outputs": [],
"source": [
"slc = yt.SlicePlot(ds, \"z\", [\"intensity\"], center=new_center, origin=\"native\")\n",
"slc = yt.SlicePlot(ds, \"z\", [(\"gas\", \"intensity\")], center=new_center, origin=\"native\")\n",
"slc.show()"
]
},
Expand All @@ -157,7 +157,7 @@
"outputs": [],
"source": [
"new_center[2] = ds.spec2pixel(-100000.*u.m/u.s)\n",
"slc = yt.SlicePlot(ds, \"z\", [\"intensity\"], center=new_center, origin=\"native\")\n",
"slc = yt.SlicePlot(ds, \"z\", [(\"gas\", \"intensity\")], center=new_center, origin=\"native\")\n",
"slc.show()"
]
},
Expand All @@ -170,7 +170,7 @@
"outputs": [],
"source": [
"new_center[2] = ds.spec2pixel(-150000.*u.m/u.s)\n",
"slc = yt.SlicePlot(ds, \"z\", [\"intensity\"], center=new_center, origin=\"native\")\n",
"slc = yt.SlicePlot(ds, \"z\", [(\"gas\", \"intensity\")], center=new_center, origin=\"native\")\n",
"slc.show()"
]
},
Expand All @@ -196,7 +196,7 @@
},
"outputs": [],
"source": [
"prj = yt.ProjectionPlot(ds, \"z\", [\"intensity\"], origin=\"native\")\n",
"prj = yt.ProjectionPlot(ds, \"z\", [(\"gas\", \"intensity\")], origin=\"native\")\n",
"prj.show()"
]
},
Expand All @@ -215,7 +215,7 @@
},
"outputs": [],
"source": [
"slc = yt.SlicePlot(ds, \"x\", [\"intensity\"], origin=\"native\", window_size=(8,8))\n",
"slc = yt.SlicePlot(ds, \"x\", [(\"gas\", \"intensity\")], origin=\"native\", window_size=(8,8))\n",
"slc.show()"
]
},
Expand Down Expand Up @@ -279,7 +279,7 @@
"outputs": [],
"source": [
"dd = ds.all_data() # A region containing the entire dataset\n",
"extrema = dd.quantities.extrema(\"temperature\")\n",
"extrema = dd.quantities.extrema((\"gas\", \"temperature\"))\n",
"print (extrema)"
]
},
Expand All @@ -298,9 +298,9 @@
},
"outputs": [],
"source": [
"prj = yt.ProjectionPlot(ds, \"z\", [\"temperature\"], origin=\"native\", \n",
" weight_field=\"ones\") # \"ones\" weights each cell by 1\n",
"prj.set_log(\"temperature\", True)\n",
"prj = yt.ProjectionPlot(ds, \"z\", (\"gas\", \"temperature\"), origin=\"native\", \n",
" weight_field=(\"index\", \"ones\")) # \"ones\" weights each cell by 1\n",
"prj.set_log((\"gas\", \"temperature\"), True)\n",
"prj.show()"
]
},
Expand All @@ -319,7 +319,7 @@
},
"outputs": [],
"source": [
"pplot = yt.ProfilePlot(dd, \"temperature\", [\"ones\"], weight_field=None, n_bins=128)\n",
"pplot = yt.ProfilePlot(dd, (\"gas\", \"temperature\"), [(\"index\", \"ones\")], weight_field=None, n_bins=128)\n",
"pplot.show()"
]
},
Expand All @@ -338,7 +338,7 @@
},
"outputs": [],
"source": [
"fc = dd.cut_region([\"obj['temperature'] > 0\"])"
"fc = dd.cut_region([\"obj[('gas', 'temperature')] > 0\"])"
]
},
{
Expand All @@ -356,7 +356,7 @@
},
"outputs": [],
"source": [
"print (fc.quantities.extrema(\"temperature\"))"
"print (fc.quantities.extrema((\"gas\", \"temperature\")))"
]
},
{
Expand All @@ -374,7 +374,7 @@
},
"outputs": [],
"source": [
"fc.quantities.weighted_average_quantity(\"temperature\", \"ones\")"
"fc.quantities.weighted_average_quantity((\"gas\", \"temperature\"), (\"index\", \"ones\"))"
]
},
{
Expand All @@ -392,9 +392,9 @@
},
"outputs": [],
"source": [
"prj = yt.ProjectionPlot(ds, \"z\", [\"temperature\"], data_source=fc, origin=\"native\", \n",
" weight_field=\"ones\") # \"ones\" weights each cell by 1\n",
"prj.set_log(\"temperature\", True)\n",
"prj = yt.ProjectionPlot(ds, \"z\", [(\"gas\", \"temperature\")], data_source=fc, origin=\"native\", \n",
" weight_field=(\"index\", \"ones\")) # \"ones\" weights each cell by 1\n",
"prj.set_log((\"gas\", \"temperature\"), True)\n",
"prj.show()"
]
},
Expand Down Expand Up @@ -450,7 +450,7 @@
},
"outputs": [],
"source": [
"print (box_reg.quantities.extrema(\"temperature\"))"
"print (box_reg.quantities.extrema(\"gas\", (\"temperature\")))"
]
},
{
Expand All @@ -468,10 +468,10 @@
},
"outputs": [],
"source": [
"prj = yt.ProjectionPlot(ds, \"z\", [\"temperature\"], origin=\"native\", \n",
" data_source=box_reg, weight_field=\"ones\") # \"ones\" weights each cell by 1\n",
"prj.set_zlim(\"temperature\", 1.0e-2, 1.5)\n",
"prj.set_log(\"temperature\", True)\n",
"prj = yt.ProjectionPlot(ds, \"z\", (\"gas\", \"temperature\"), origin=\"native\", \n",
" data_source=box_reg, weight_field=(\"index\", \"ones\")) # \"ones\" weights each cell by 1\n",
"prj.set_zlim((\"gas\", \"temperature\"), 1.0e-2, 1.5)\n",
"prj.set_log((\"gas\", \"temperature\"), True)\n",
"prj.show()"
]
}
Expand Down

0 comments on commit 0ed9121

Please sign in to comment.