Skip to content

Commit

Permalink
remove plotting dependency from ROMS.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Oct 29, 2024
1 parent 9abd539 commit d97168b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
STAC = "08e62803-e111-4f53-be9b-274ff296e9da"
Expand All @@ -28,7 +27,6 @@ DIVAnd = "2.7"
DataStructures = "0.17, 0.18"
Interpolations = "0.12, 0.13, 0.14, 0.15"
NCDatasets = "0.14"
PythonPlot = "1"
Statistics = "1"
STAC = "0.1.2"

Expand Down
1 change: 0 additions & 1 deletion src/ROMS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ using Dates
using Interpolations
using NCDatasets
using Printf
using PythonPlot
using Random
using SHA
using Statistics
Expand Down
21 changes: 0 additions & 21 deletions src/generate_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ opt = (
"""
function generate_grid(grid_fname,bath_name,xr,yr,red,opt,hmin,rmax;
do_plot = false,
postprocess_mask = (x,y,mask) -> mask)

xo,yo,bo = ROMS.gebco_load(bath_name,xr,yr);
Expand Down Expand Up @@ -63,9 +62,6 @@ function generate_grid(grid_fname,bath_name,xr,yr,red,opt,hmin,rmax;
dmde[2:end-1, :] = 0.5*(1 ./ pm[3:end, :] - 1 ./ pm[1:end-2, :]);
dndx[:, 2:end-1] = 0.5*(1 ./ pn[:, 3:end] - 1 ./ pn[:, 1:end-2]);

# aspect ratio for plotting
ar = [1 cos(mean(y[:]) * pi/180) 1];

# mask
mask = b .< 0;

Expand All @@ -81,27 +77,10 @@ function generate_grid(grid_fname,bath_name,xr,yr,red,opt,hmin,rmax;
b[b .> 0] .= 0;
b = -b;

if do_plot
field = copy(b)
field[.!mask] .= NaN;
figure(),pcolor(x,y,field),
colorbar()
title("Bathymetry")
#set(gca,'DataAspectRatio',ar, 'Layer', 'top')
end

# smooth bathymetry

h = ROMS.smoothgrid(b,hmin,rmax);

if do_plot
field = copy(b)
field[.!mask] .= NaN
figure(),pcolor(x,y,field)
title("Bathymetry (smooth)")
#set(gca,'DataAspectRatio',ar, 'Layer', 'top')
end

# generate bathymetry file

z_r,z_w = ROMS.generate_config(grid_fname,x,y,h,mask,pm,pn,dndx,dmde,opt);
Expand Down

0 comments on commit d97168b

Please sign in to comment.