Skip to content

Commit

Permalink
a couple typos and a fix for plotting model top (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnfienen authored Dec 2, 2023
1 parent bdb1cbc commit d6c1b21
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/pestutilslib/fortran_library_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ Function *uninstall_structured_grid()* returns a value of zero unless an error c

### Description

The task performed by function *calc_kriging_factors_2d()* resembles that performed by a PLPROC function of the same name. As the name suggests, this function calculates kriging factors. More accurately, it calls modified functions of the SGLIB library (Deutsch and Journel, 1998) to calcite kriging factors. These factors will often be used to implement spatial interpolation from pilot points to a model grid. However function *calc_kriging_factors_2d()* makes no mention of either pilot points nor a model grid. The set of points to which spatial interpolation takes place are specified only by their coordinates. These can be the centres of cells of a structured or unstructured model grid. Alternatively, they may have no relationship to a model grid whatsoever.
The task performed by function *calc_kriging_factors_2d()* resembles that performed by a PLPROC function of the same name. As the name suggests, this function calculates kriging factors. More accurately, it calls modified functions of the GSLIB library (Deutsch and Journel, 1998) to calculate kriging factors. These factors will often be used to implement spatial interpolation from pilot points to a model grid. However function *calc_kriging_factors_2d()* makes no mention of either pilot points nor a model grid. The set of points to which spatial interpolation takes place are specified only by their coordinates. These can be the centres of cells of a structured or unstructured model grid. Alternatively, they may have no relationship to a model grid whatsoever.

Other features of *calc_kriging_factors_2d* include the following:

Expand Down
21 changes: 20 additions & 1 deletion examples/exploring_lowlevel_pypestutils_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,17 @@
"hdsdf"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4ae6b876-8232-4dea-92cf-91aaf6448a74",
"metadata": {},
"outputs": [],
"source": [
"mtop = m.dis.top.array\n",
"mtop[mtop<-100] = np.nan"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -272,7 +283,7 @@
" ax.set_aspect(\"equal\")\n",
" kdf = hdsdf.loc[hdsdf.layer==lay,:]\n",
" assert kdf.shape[0] > 0\n",
" ax.pcolormesh(Easting,Northing,m.dis.top.array)\n",
" ax.pcolormesh(Easting,Northing,mtop)\n",
" ax.scatter(kdf.x,kdf.y,marker=\"^\",c=\"k\",label=\"gw level loc\")\n",
" ax.legend(loc=\"upper left\")\n",
" ax.set_title(\"gw level locations in layer {0}\".format(lay),loc=\"left\")\n"
Expand Down Expand Up @@ -806,6 +817,14 @@
"ax.pcolormesh(Easting,Northing,id_mask)\n",
"ax.scatter(ppeasting,ppnorthing,marker=\".\",s=50,c=ppval)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "25bbd45c-bbcb-425b-bf84-7f518acb7a78",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion examples/exploring_pypestutils_helpers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
" iidf = idf.loc[idf.site==site,:]\n",
" iidf.loc[iidf.simulated>1e29,\"simulated\"] = np.nan\n",
" fig,ax = plt.subplots(1,1,figsize=(8,5))\n",
" ax.plot(aadf.index,aadf.values,\"0.5\",lw=0.5,label=\"all sim times\")\n",
" ax.plot(aadf.index,aadf.values,\"0.5\",lw=0.5,marker=\"o\",mfc='none',label=\"all sim times\")\n",
" ax.scatter(iidf.datetime,iidf.obsval,marker=\"^\",c=\"r\",label=\"observed\")\n",
" ax.scatter(iidf.datetime,iidf.simulated,marker=\"^\",c=\"0.5\",label=\"interp to obs\")\n",
" ax.set_title(site,loc=\"left\")\n",
Expand Down
2 changes: 1 addition & 1 deletion pypestutils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def get_2d_pp_info_structured_grid(
gridinfo_fname: str,
array_dict = {},
name_prefix="pp"
) -> pandas.DataFrame:
) -> pd.DataFrame:
"""Create a grid of pilot point locations for a
2-D structured grid
Parameters
Expand Down

0 comments on commit d6c1b21

Please sign in to comment.