Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional options to project 2D map quantities #28

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/_sources/introduction.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ where
-clabel Text for the colorbar ('' by default, i.e., set by plopm).
-labels Legend in the summary plot, separated by commas if more than one ('' by default, i.e., set by plopm).
-axgrid Set axis.grid to True for the summary plots ('1' by default).
-dpi Dots per inch for the figure ('1200' by default).
-dpi Dots per inch for the figure ('500' by default).
-xformat Format for the x numbers, e.g., .2e for exponential notation ('' by default, i.e., set by plopm).
-yformat Format for the y numbers, e.g., .1f for one decimal ('' by default, i.e., set by plopm).
-cformat Specify the format for the numbers in the colormap, e.g., .2f for two decimals ('' by default, i.e., set by plopm).
Expand All @@ -72,7 +72,7 @@ where
-rotate Grades to rotate the grid in the 2D maps ('0' by default).
-translate Translate the grid in the 2D maps x,y directions ('[0,0]' by default).
-global Min and max in the colorbars from the current 2D slide values (0) or whole 3D model '1' ('0' by default).
-how Show the cells for the wells/faults when at least one cell contains them ('min') or when all cells are part of the given slides range ('max') ('min' by default).
-how Select how to project the given variable (-v) in a slide range (-s). By default the variables are pore volume weighted averaged along the range except for mass quantities, porv, trans, and cell dims (e.g., dz) which are summed; cell indices (e.g., index_i) which show the discrete value; harmonic average and arithmetic average for permeabilities depending on the slide range direction using the cell dim along the slide (e.g., -s ,,1:2 -v permz [harmonic averaged]); for wells/faults, 'min' show the cells when at least one cell contains them or 'max' when all cells are part of the given slide/slides range. The supported options are 'min', 'max', 'sum', 'mean', 'pvmean', 'harmonic', 'arithmetic'. ('' by default, i.e., the defaults as described above).
-ncolor Color for the inactive cells in the 2D maps ('w' by default, i.e., white).
-lw Line width separated by commas if more than one ('1' by default).
-subfigs Generate separated or a single Figure (e.g., '2,2' for four subfigures) ('' by default, i.e., separate figures).
Expand Down
10 changes: 7 additions & 3 deletions docs/_static/js/versions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
const themeFlyoutDisplay = "hidden";
const themeVersionSelector = "True";
const themeLanguageSelector = "True";
const themeVersionSelector = true;
const themeLanguageSelector = true;

if (themeFlyoutDisplay === "attached") {
function renderLanguages(config) {
if (!config.projects.translations.length) {
return "";
}

// Insert the current language to the options on the selector
let languages = config.projects.translations.concat(config.projects.current);
languages = languages.sort((a, b) => a.language.name.localeCompare(b.language.name));

const languagesHTML = `
<dl>
<dt>Languages</dt>
${config.projects.translations
${languages
.map(
(translation) => `
<dd ${translation.slug == config.projects.current.slug ? 'class="rtd-current-item"' : ""}>
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h2>Python package<a class="headerlink" href="#python-package" title="Link to th
<span class="go">git clone https://github.com/cssr-tools/plopm.git</span>
<span class="gp"># </span>Get<span class="w"> </span>inside<span class="w"> </span>the<span class="w"> </span>folder
<span class="go">cd plopm</span>
<span class="gp"># </span>For<span class="w"> </span>a<span class="w"> </span>specific<span class="w"> </span>version<span class="w"> </span><span class="o">(</span>e.g.,<span class="w"> </span>v2024.10<span class="o">)</span><span class="p">;</span><span class="w"> </span>otherwhise<span class="w"> </span><span class="o">(</span>i.e.,<span class="w"> </span>latest<span class="w"> </span>version<span class="o">)</span>,<span class="w"> </span>skip<span class="w"> </span>this<span class="w"> </span>step
<span class="gp"># </span>For<span class="w"> </span>a<span class="w"> </span>specific<span class="w"> </span>version<span class="w"> </span><span class="o">(</span>e.g.,<span class="w"> </span>v2024.10<span class="o">)</span>,<span class="w"> </span>or<span class="w"> </span><span class="k">else</span><span class="w"> </span>skip<span class="w"> </span>this<span class="w"> </span>step<span class="w"> </span><span class="o">(</span>i.e.,<span class="w"> </span>edge<span class="w"> </span>version<span class="o">)</span>
<span class="go">git checkout v2024.10</span>
<span class="gp"># </span>Create<span class="w"> </span>virtual<span class="w"> </span>environment
<span class="go">python3 -m venv vplopm</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h2>Concept<a class="headerlink" href="#concept" title="Link to this heading">
<dd><p>Set axis.grid to True for the summary plots (‘1’ by default).</p>
</dd>
<dt><kbd><span class="option">-d<var>pi</var></span></kbd></dt>
<dd><p>Dots per inch for the figure (‘1200’ by default).</p>
<dd><p>Dots per inch for the figure (‘500’ by default).</p>
</dd>
<dt><kbd><span class="option">-x<var>format</var></span></kbd></dt>
<dd><p>Format for the x numbers, e.g., .2e for exponential notation (’’ by default, i.e., set by plopm).</p>
Expand Down Expand Up @@ -232,7 +232,7 @@ <h2>Concept<a class="headerlink" href="#concept" title="Link to this heading">
<dd><p>Min and max in the colorbars from the current 2D slide values (0) or whole 3D model ‘1’ (‘0’ by default).</p>
</dd>
<dt><kbd><span class="option">-h<var>ow</var></span></kbd></dt>
<dd><p>Show the cells for the wells/faults when at least one cell contains them (‘min’) or when all cells are part of the given slides range (‘max’) (‘min’ by default).</p>
<dd><p>Select how to project the given variable (-v) in a slide range (-s). By default the variables are pore volume weighted averaged along the range except for mass quantities, porv, trans, and cell dims (e.g., dz) which are summed; cell indices (e.g., index_i) which show the discrete value; harmonic average and arithmetic average for permeabilities depending on the slide range direction using the cell dim along the slide (e.g., -s ,,1:2 -v permz [harmonic averaged]); for wells/faults, ‘min’ show the cells when at least one cell contains them or ‘max’ when all cells are part of the given slide/slides range. The supported options are ‘min’, ‘max’, ‘sum’, ‘mean’, ‘pvmean’, ‘harmonic’, ‘arithmetic’. (’’ by default, i.e., the defaults as described above).</p>
</dd>
<dt><kbd><span class="option">-n<var>color</var></span></kbd></dt>
<dd><p>Color for the inactive cells in the 2D maps (‘w’ by default, i.e., white).</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/text/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ where
-clabel Text for the colorbar ('' by default, i.e., set by plopm).
-labels Legend in the summary plot, separated by commas if more than one ('' by default, i.e., set by plopm).
-axgrid Set axis.grid to True for the summary plots ('1' by default).
-dpi Dots per inch for the figure ('1200' by default).
-dpi Dots per inch for the figure ('500' by default).
-xformat Format for the x numbers, e.g., .2e for exponential notation ('' by default, i.e., set by plopm).
-yformat Format for the y numbers, e.g., .1f for one decimal ('' by default, i.e., set by plopm).
-cformat Specify the format for the numbers in the colormap, e.g., .2f for two decimals ('' by default, i.e., set by plopm).
Expand All @@ -72,7 +72,7 @@ where
-rotate Grades to rotate the grid in the 2D maps ('0' by default).
-translate Translate the grid in the 2D maps x,y directions ('[0,0]' by default).
-global Min and max in the colorbars from the current 2D slide values (0) or whole 3D model '1' ('0' by default).
-how Show the cells for the wells/faults when at least one cell contains them ('min') or when all cells are part of the given slides range ('max') ('min' by default).
-how Select how to project the given variable (-v) in a slide range (-s). By default the variables are pore volume weighted averaged along the range except for mass quantities, porv, trans, and cell dims (e.g., dz) which are summed; cell indices (e.g., index_i) which show the discrete value; harmonic average and arithmetic average for permeabilities depending on the slide range direction using the cell dim along the slide (e.g., -s ,,1:2 -v permz [harmonic averaged]); for wells/faults, 'min' show the cells when at least one cell contains them or 'max' when all cells are part of the given slide/slides range. The supported options are 'min', 'max', 'sum', 'mean', 'pvmean', 'harmonic', 'arithmetic'. ('' by default, i.e., the defaults as described above).
-ncolor Color for the inactive cells in the 2D maps ('w' by default, i.e., white).
-lw Line width separated by commas if more than one ('1' by default).
-subfigs Generate separated or a single Figure (e.g., '2,2' for four subfigures) ('' by default, i.e., separate figures).
Expand Down
19 changes: 13 additions & 6 deletions src/plopm/core/plopm.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ def load_parser():
parser.add_argument(
"-dpi",
"--dpi",
default="1200",
help="Dots per inch for the figure ('1200' by default).",
default="500",
help="Dots per inch for the figure ('500' by default).",
)
parser.add_argument(
"-xformat",
Expand Down Expand Up @@ -329,10 +329,17 @@ def load_parser():
parser.add_argument(
"-how",
"--how",
default="min",
help="Show the cells for the wells/faults when at least one cell contains them "
"('min') or when all cells are part of the given slide/slides range ('max') "
"('min' by default).",
default="",
help="Select how to project the given variable (-v) in a slide range (-s). "
"By default the variables are pore volume weighted averaged along the range "
"except for mass quantities, porv, trans, and cell dims (e.g., dz) which are summed; "
"cell indices (e.g., index_i) which show the discrete value; harmonic average and "
"arithmetic average for permeabilities depending on the slide range direction using "
"the cell dim along the slide (e.g., -s ,,1:2 -v permz [harmonic averaged]); "
"for wells/faults, 'min' show the cells when at least one cell contains them "
"or 'max' when all cells are part of the given slide/slides range. The supported "
"options are 'min', 'max', 'sum', 'mean', 'pvmean', 'harmonic', 'arithmetic'. ('' by "
"default, i.e., the defaults as described above).",
)
parser.add_argument(
"-ncolor",
Expand Down
16 changes: 15 additions & 1 deletion src/plopm/utils/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ def ini_dic(cmdargs):
dic["rotate"] = (cmdargs["rotate"].strip()).split(",")
dic["global"] = int(cmdargs["global"])
dic["latex"] = int(cmdargs["latex"])
dic["how"] = cmdargs["how"].strip()
dic["save"] = (cmdargs["save"].strip()).split(" ")
dic["translate"] = (cmdargs["translate"]).split(" ")
dic["translate"] = [var.split(",") for var in dic["translate"]]
dic["restart"] = (cmdargs["restart"].strip()).split(",")
dic["cbsfax"] = [float(val) for val in (cmdargs["cbsfax"].strip()).split(",")]
dic["nwells"], dic["lwells"] = 0, []
dic["how"] = (cmdargs["how"].strip()).split(",")
for i in ["x", "y"]:
dic[f"{i}units"] = cmdargs[f"{i}units"].strip()
dic[f"{i}label"] = (cmdargs[f"{i}label"].strip()).split(" ")
Expand Down Expand Up @@ -212,6 +212,10 @@ def ini_dic(cmdargs):
dic["slide"] = [dic["slide"][0]] * 2
elif len(dic["slide"]) < max(len(dic["names"][0]), len(dic["vrs"])):
dic["slide"] = [dic["slide"][0]] * max(len(dic["names"][0]), len(dic["vrs"]))
if len(dic["how"]) < max(len(dic["names"][0]), len(dic["vrs"])):
dic["how"] = [dic["how"][0]] * max(len(dic["names"][0]), len(dic["vrs"]))
if dic["diff"]:
dic["how"] = [dic["how"][0]] * 2
for val in [
"xformat",
"yformat",
Expand Down Expand Up @@ -395,6 +399,16 @@ def ini_properties(dic):
dic["cmaps"] = ["RdYlGn"]
elif dic["mask"]:
dic["cmaps"] = ["RdGy_r"]
if dic["vrs"][0] == "wells" or dic["vrs"][0] == "faults":
if dic["how"][0]:
if dic["how"][0] not in ["min", "max"]:
print(f"Unsuported value -how '{dic['how'][0]}' for wells/faults. ")
print("Supported values are 'min' and 'max'.")
sys.exit()
else:
dic["whow"] = dic["how"][0]
else:
dic["whow"] = "min"
if dic["vrs"]:
if (dic["vrs"][0] == "wells" or dic["vrs"][0] == "faults") and not dic[
"colors"
Expand Down
Loading
Loading