Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d9e13af
Interactive grid selection + optimised search
Jun 11, 2024
85233c8
Updated optimisation
Jun 12, 2024
e86b7da
Fixed uncertainty budget calculations and added plot
Jun 12, 2024
be9cb68
Merge branch 'extend_projections' into uncertainty_budget
gregrmunday Jun 12, 2024
269d906
Update with old catch
Jun 12, 2024
4a1fb2d
Updated search weights
Jun 13, 2024
fc21604
Merge branch 'extend_projections' into uncertainty_budget
Jun 13, 2024
ba4061f
Tide gauge as lines
Jun 13, 2024
20b2b2a
Merge branch 'extend_projections' into uncertainty_budget
Jun 13, 2024
e7ed1be
Updated file saving
Jun 13, 2024
4c435a9
Fixed manual coordinates not updating
Jun 14, 2024
b39b2a7
Raises error for tricky regions
Jun 27, 2024
dd788e5
Tide gauge plotting
Jun 28, 2024
c25747e
Merge branch 'extend_projections' into optimise_gridsearch
Jun 28, 2024
0fb599b
Add user option for plotting tide gauges
Jun 28, 2024
f038041
Merge with pypackage
Jul 8, 2024
7b7a178
Merge with pypackage
Jul 8, 2024
113b8cb
Merge with main
Jul 19, 2024
9e0ef27
Merge branch 'main' into optimise_gridsearch
Jul 19, 2024
7b1b41d
Update user-settings.yml
Jul 19, 2024
017f20e
trivial change to README
mokhodge Jan 29, 2025
4a15bde
create an env .lock file from the env .yml file on this branch
mokhodge Feb 10, 2025
0833772
Merge pull request #6 from MetOffice/optimise_gridsearch
mo-MattPalmer Apr 2, 2025
42d0286
Merge branch 'v2.0.0_DEV' into uncertainty_budget
gregrmunday Aug 14, 2025
b7ea05f
Merge pull request #9 from MetOffice/uncertainty_budget
acchamber Aug 14, 2025
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Folders
*__pycache__*
profsea.egg-info

15 changes: 7 additions & 8 deletions ProFSea-environment.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file may be used to create an environment using:
# $ conda create --name ProFSea-env --file ProFSea-environment.lock
# $ conda create --name <env> --file <this file>
# platform: linux-64
@EXPLICIT
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
Expand All @@ -17,6 +17,7 @@ https://conda.anaconda.org/conda-forge/linux-64/icu-67.1-he1b5a44_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.1-h166bdaf_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/lerc-4.0.0-h27087fc_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.19-hd590300_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda
https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.5.0-hcb278e6_1.conda
https://conda.anaconda.org/conda-forge/linux-64/libffi-3.3-h58526e2_2.tar.bz2
Expand All @@ -30,7 +31,7 @@ https://conda.anaconda.org/conda-forge/linux-64/xxhash-0.8.2-hd590300_0.conda
https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h7f98852_2.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/hdf4-4.2.15-h2a13503_7.conda
https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20191231-he28a2e2_2.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/krb5-1.20.1-hf9c8cef_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-13.2.0-h69a702a_3.conda
https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.51.0-hdcd2b5c_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.39-h753d276_0.conda
Expand All @@ -43,25 +44,25 @@ https://conda.anaconda.org/conda-forge/linux-64/zlib-1.2.13-hd590300_5.conda
https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.5-hfc55251_0.conda
https://conda.anaconda.org/conda-forge/linux-64/freetype-2.12.1-h267a509_2.conda
https://conda.anaconda.org/conda-forge/linux-64/hdf5-1.10.2-hc401514_3.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/krb5-1.20.1-hf9c8cef_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libcurl-7.87.0-h6312ad2_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.26-pthreads_h413a1c8_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.6.0-ha9c0a0a_2.conda
https://conda.anaconda.org/conda-forge/linux-64/sqlite-3.44.2-h2c6b66d_0.conda
https://conda.anaconda.org/conda-forge/linux-64/udunits2-2.2.28-h40f5838_3.conda
https://conda.anaconda.org/conda-forge/linux-64/curl-7.87.0-h6312ad2_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-21_linux64_openblas.conda
https://conda.anaconda.org/conda-forge/linux-64/libcurl-7.87.0-h6312ad2_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libwebp-1.3.2-h658648e_1.conda
https://repo.anaconda.com/pkgs/main/linux-64/proj-8.0.1-h1217e81_0.conda
https://repo.anaconda.com/pkgs/main/linux-64/python-3.7.7-hcff3b4d_5.conda
https://conda.anaconda.org/conda-forge/noarch/certifi-2023.11.17-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/noarch/cloudpickle-2.2.1-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/linux-64/curl-7.87.0-h6312ad2_0.conda
https://conda.anaconda.org/conda-forge/noarch/cycler-0.11.0-pyhd8ed1ab_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/fsspec-2023.1.0-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-21_linux64_openblas.conda
https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-21_linux64_openblas.conda
https://conda.anaconda.org/conda-forge/linux-64/libnetcdf-4.6.1-h5e45101_3.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/locket-1.0.0-pyhd8ed1ab_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/packaging-23.2-pyhd8ed1ab_0.conda
https://repo.anaconda.com/pkgs/main/linux-64/proj-8.0.1-h1217e81_0.conda
https://conda.anaconda.org/conda-forge/noarch/pyparsing-3.1.1-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/noarch/pyshp-2.3.1-pyhd8ed1ab_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/python_abi-3.7-2_cp37m.tar.bz2
Expand All @@ -71,7 +72,6 @@ https://conda.anaconda.org/conda-forge/noarch/toolz-0.12.1-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.7.1-pyha770c72_0.conda
https://conda.anaconda.org/conda-forge/noarch/wheel-0.42.0-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/linux-64/antlr-python-runtime-4.7.2-py37h89c1867_1003.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libnetcdf-4.6.1-h5e45101_3.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/markupsafe-2.1.1-py37h540881e_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/numpy-1.21.6-py37h976b520_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/partd-1.4.1-pyhd8ed1ab_0.conda
Expand All @@ -96,4 +96,3 @@ https://conda.anaconda.org/conda-forge/linux-64/netcdf4-1.4.1-py37ha292673_200.t
https://conda.anaconda.org/conda-forge/linux-64/cartopy-0.20.0-py37hbe109c4_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/matplotlib-3.2.2-1.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/iris-3.1.0-pyhd8ed1ab_3.tar.bz2

3 changes: 2 additions & 1 deletion ProFSea-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dependencies:
- matplotlib
- libwebp>=1.3.2
- cartopy
- iris
- iris
- tqdm
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ProFSea-tool
# ProFSea-tool v2.0.0

[![DOI](https://zenodo.org/badge/713453340.svg)](https://zenodo.org/doi/10.5281/zenodo.10255467)

Expand Down
52 changes: 50 additions & 2 deletions profsea/slr_pkg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import cartopy.crs as ccrs

from profsea.config import settings
from profsea.slr_pkg import cmip, cubeplot, cubeutils, cubedata, process
from profsea.slr_pkg import cmip, cubeplot, cubeutils, cubedata, process, whichbox
from profsea.directories import makefolder, read_dir


Expand Down Expand Up @@ -244,6 +244,7 @@ def plot_ij(cube, model, location, idx, lat, lon, save_map=True, rad=5):
if targetlon > 180:
targetlon -= 360

fig = plt.figure()
ax = cubeplot.block(cube, land=False, region=region, cmin=-1, cmax=1,
plotcbar=True, nlevels=25, cent_lon=targetlon,
title='{} (1x1 grid) - SSH above geoid'.format(model))
Expand All @@ -265,7 +266,7 @@ def plot_ij(cube, model, location, idx, lat, lon, save_map=True, rad=5):
SRC_CRS, orig_lons, orig_lats).T

# Plot symbols showing the ocean point and the tide gauge
ax.plot(new_lons[0], new_lats[0], 'ok')
pred, = ax.plot(new_lons[0], new_lats[0], 'ok')
ax.plot(new_lons[1], new_lats[1], 'xr')

if save_map:
Expand All @@ -282,7 +283,54 @@ def plot_ij(cube, model, location, idx, lat, lon, save_map=True, rad=5):
plt.savefig(figfile)
plt.close()
else:
selected_lat = cube.coord('latitude').points[j]
selected_lon = cube.coord('longitude').points[i]

def onclick(event):
nonlocal selected_lat, selected_lon, pred
nonlocal i, j
selected_lon, selected_lat = event.xdata, event.ydata

# Transform onto original projection
MAP_CRS = ccrs.PlateCarree(central_longitude=targetlon)
SRC_CRS = ccrs.PlateCarree()

selected_lon, selected_lat = SRC_CRS.transform_point(
selected_lon, selected_lat, MAP_CRS)

(i, j), = whichbox.find_gridbox_indicies(cube,[(selected_lon, selected_lat)])

selected_lon = cube.coord('longitude').points[i]
selected_lat = cube.coord('latitude').points[j]

MAP_CRS = ccrs.PlateCarree(central_longitude=targetlon)
SRC_CRS = ccrs.PlateCarree()

plot_lon, plot_lat = MAP_CRS.transform_point(
selected_lon, selected_lat, SRC_CRS)

pred.remove()
pred, = ax.plot(plot_lon, plot_lat, 'ok')
fig.canvas.draw()

cid = fig.canvas.mpl_connect('button_press_event', onclick)
plt.show()


# Create the output file directory location
out_mapdir = read_dir()[1]
makefolder(out_mapdir)

# Abbreviate the site location name suitable to use as a filename
loc_abbrev = abbreviate_location_name(location)
figfile = os.path.join(out_mapdir,
f'{loc_abbrev}_{model}_ij_figure.png')

# Save the CMIP grid box selection map to file
fig.savefig(figfile)
plt.close()

return i, j, selected_lon, selected_lat


def read_ar5_component(datadir, rcp, var, value='mid'):
Expand Down
Loading