-
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 #33 from ProjectTorreyPines/dev
Releasing v.0.2.1
- Loading branch information
Showing
19 changed files
with
696 additions
and
381 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 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": { | ||
|
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 |
---|---|---|
@@ -0,0 +1,222 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Plotting interferometer using GGDUtils\n", | ||
" \n", | ||
" For running this notebook, you need to install package IJulia in your home environment (that is messy, but that is the only way I know right now). So in your terminal:\n", | ||
" ```\n", | ||
" % julia\n", | ||
" julia > ]\n", | ||
" (@v1.9 pkg) pkg> add IJulia\n", | ||
" ```\n", | ||
"\n", | ||
" After this, Julia kernel would appear in your jupyter notebooks as an option. This also works for julia notebooks directly opened on VSCode. Select the Julia kernel to run this notebook." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"using Pkg\n", | ||
"Pkg.activate(\"./\")\n", | ||
"Pkg.add(url=\"[email protected]:ProjectTorreyPines/OMAS.jl.git\")\n", | ||
"Pkg.develop(path=\"../\")\n", | ||
"Pkg.add(\"Plots\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"using OMAS\n", | ||
"using GGDUtils\n", | ||
"using Plots" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Load the interferometer" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ids = OMAS.json2imas(\"$(@__DIR__)/../samples/time_dep_edge_profiles_with_interferometer.json\")\n", | ||
"grid_ggd = ids.edge_profiles.grid_ggd[1]\n", | ||
"space = grid_ggd.space[1]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Plotting the interferometer geometry on top of SOLPS mesh" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Choose backend\n", | ||
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(space)\n", | ||
"plot!(ids.interferometer) # Default plot_type is :los \n", | ||
"plot!(legend=true)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"You can provide custom lengthand thickness of mirror to be plotted and linewidth of the laser beams" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Choose backend\n", | ||
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(space)\n", | ||
"plot!(ids.interferometer, mirror_length=0.7, linewidth=4, mirror_thickness=0.2)\n", | ||
"plot!(legend=true)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Or you can choose to omit the mirror" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Choose backend\n", | ||
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(space)\n", | ||
"plot!(ids.interferometer, mirror=false)\n", | ||
"plot!(legend=true)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"You can plot a single channel as well. You can override the in-built channel name for the label." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Choose backend\n", | ||
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(space)\n", | ||
"plot!(ids.interferometer.channel[1], label=\"Channel 1\")\n", | ||
"plot!(legend=true)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Plotting interferometer data vs time\n", | ||
"\n", | ||
" * Use plot_type=:n_e for integrated electron density data\n", | ||
" * Use plot_type=:n_e_average for averaged electron density data\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Choose backend\n", | ||
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(ids.interferometer, plot_type=:n_e)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Choose backend\n", | ||
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(ids.interferometer, plot_type=:n_e_average)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Again, to plot an individual channel, just provide the channel with correct plot_type" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Choose backend\n", | ||
"gr() # Fast and can save pdf\n", | ||
"# plotlyjs() # Use for interactive plot, can only save png\n", | ||
"\n", | ||
"plot(ids.interferometer.channel[1], plot_type=:n_e_average)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Julia 1.9.2", | ||
"language": "julia", | ||
"name": "julia-1.9" | ||
}, | ||
"language_info": { | ||
"file_extension": ".jl", | ||
"mimetype": "application/julia", | ||
"name": "julia", | ||
"version": "1.9.2" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
/edge_profiles.h5 | ||
/b2time.nc | ||
/b2mn.dat | ||
/b2fgmtry | ||
/time_dep_edge_profiles_last_step_only.json | ||
/time_dep_edge_profiles_with_interferometer.json |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.