-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from ProjectTorreyPines/2DVis
Updated plotting examples to reflect new changes
- Loading branch information
Showing
3 changed files
with
24 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,7 @@ | |
"using Pkg\n", | ||
"Pkg.activate(\"./\")\n", | ||
"Pkg.add(url=\"[email protected]:ProjectTorreyPines/OMAS.jl.git\")\n", | ||
"Pkg.add(url=\"[email protected]:ProjectTorreyPines/SOLPS2IMAS.jl.git\", rev=\"dev\")\n", | ||
"Pkg.add(path=\"../\")\n", | ||
"Pkg.add(PackageSpec(name=\"GR\", version=\"0.72.9\"))\n", | ||
"Pkg.pin(\"GR\")\n", | ||
"Pkg.develop(path=\"../\")\n", | ||
"Pkg.add(\"Plots\")\n", | ||
"Pkg.add(\"LaTeXStrings\")" | ||
] | ||
|
@@ -39,7 +36,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"using SOLPS2IMAS\n", | ||
"using OMAS\n", | ||
"using GGDUtils\n", | ||
"using Plots\n", | ||
"using LaTeXStrings" | ||
|
@@ -51,14 +48,9 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"b2gmtry = \"../samples/b2fgmtry\"\n", | ||
"b2output = \"../samples/b2time_red.nc\"\n", | ||
"gsdesc = \"../samples/gridspacedesc.yml\"\n", | ||
"b2mn = \"../samples/b2mn.dat\"\n", | ||
"dd = solps2imas(b2gmtry, b2output, gsdesc, b2mn)\n", | ||
"dd = OMAS.json2imas(\"../samples/time_dep_edge_profiles_last_step_only.json\")\n", | ||
"grid_ggd = dd.edge_profiles.grid_ggd[1]\n", | ||
"space = grid_ggd.space[1]\n", | ||
"dd.edge_profiles.ggd[1].electrons.density[5].grid_subset_index = 5 # This is a bug in SOLPS2IMAS to be fixed" | ||
"space = grid_ggd.space[1]" | ||
] | ||
}, | ||
{ | ||
|
@@ -82,21 +74,21 @@ | |
"\n", | ||
"# You can overlay any subset by giving a second argument\n", | ||
"# Labels \n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 6), markercolor=:chocolate1)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 7), linecolor=:red, linewidth=2)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 8), linecolor=:darkred, linewidth=2)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 9), linecolor=:limegreen, linewidth=2)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 10), linecolor=:darkgreen, linewidth=2)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 11), linecolor=:cyan, linewidth=2)\n", | ||
"# plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 12), linecolor=:teal, linewidth=1)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 13), linecolor=:royalblue1, linewidth=2)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 14), linecolor=:navyblue, linewidth=2)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 15), linecolor=:fuchsia, linewidth=2, linestyle=:dash)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 16), linecolor=:purple4, linewidth=2, linestyle=:dash)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 101), markershape=:rect, markercolor=:royalblue1)\n", | ||
"# plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 102), markershape=:rect, markercolor=:maroon)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 103), markershape=:diamond, markercolor=:fuchsia)\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 104), markershape=:diamond, markercolor=:purple4)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 6), markercolor=:chocolate1)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 7), linecolor=:red, linewidth=2)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 8), linecolor=:darkred, linewidth=2)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 9), linecolor=:limegreen, linewidth=2)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 10), linecolor=:darkgreen, linewidth=2)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 11), linecolor=:cyan, linewidth=2)\n", | ||
"# plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 12), linecolor=:teal, linewidth=1)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 13), linecolor=:royalblue1, linewidth=2)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 14), linecolor=:navyblue, linewidth=2)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 15), linecolor=:fuchsia, linewidth=2, linestyle=:dash)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 16), linecolor=:purple4, linewidth=2, linestyle=:dash)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 101), markershape=:rect, markercolor=:royalblue1)\n", | ||
"# plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 102), markershape=:rect, markercolor=:maroon)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 103), markershape=:diamond, markercolor=:fuchsia)\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 104), markershape=:diamond, markercolor=:purple4)\n", | ||
"\n", | ||
"# Legend is supressed unless asked for specifically\n", | ||
"plot!(legend=true)\n", | ||
|
@@ -120,7 +112,8 @@ | |
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(dd.edge_profiles.grid_ggd, dd.edge_profiles.ggd[1].electrons.density[5], colorbar_title=\"Electrons density / \" * L\"m^{-3}\")" | ||
"n_e = GGDUtils.get_prop_with_grid_subset_index(dd.edge_profiles.ggd[1].electrons.density, 5)\n", | ||
"plot(dd.edge_profiles.grid_ggd, n_e, colorbar_title=\"Electrons density / \" * L\"m^{-3}\")" | ||
] | ||
}, | ||
{ | ||
|
@@ -140,16 +133,9 @@ | |
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(dd.edge_profiles.grid_ggd, dd.edge_profiles.ggd[1].electrons.density[5]) # Note default label in colorbar\n", | ||
"plot!(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 16), linecolor=:red, linewidth=2, linestyle=:solid, label=\"Separatix\", legend=true)" | ||
"plot(dd.edge_profiles.grid_ggd, n_e) # Note default label in colorbar\n", | ||
"plot!(space, GGDUtils.get_grid_subset_with_index(grid_ggd, 16), linecolor=:red, linewidth=2, linestyle=:solid, label=\"Separatix\", legend=true)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
|