-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
executable file
·68 lines (49 loc) · 2.58 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
README
Usage notes for REGRID_ROMS_VEGETATION_FUSION.py. This script reads and existing vegetation file (dowloaded from https://drive.google.com/drive/u/0/folders/1auf2adLJvvG7ZI57UwmfaSn5EGuJMYIy), then regrids the land use classification data to a supplied ROMS grid. The clasifcation is then mapped to the plant_density, plant_height, plant_diameter
1) Download and uzip the relevant land use data from the google drive. There is currently no automated way to do this, as the data exists on a google drive.
2) Edit the file REGRID_ROMS_VEGETATION_FUSION.py as needed. Specifically edit the variables in the following code block:
########################################################################
#EDIT BETWEEN HERE
########################################################################
# INPUT GRID FILE
file=r'/home/hunter/roms/NOPP/grids/michael_grd3.nc'
# INPUT Vegetation Classification FILE
infile=r'/home/hunter/roms/NOPP/data/FPH_NOPP_Fusion/FPH_NOPP_Fusion.tif'
# INPUT Initialization FILE
inifile=r'/home/hunter/roms/NOPP/grids/michael_grd3_ini2.nc'
# Output Initialization FILE
newinifile=r'/home/hunter/roms/NOPP/grids/michael_grd3_ini3.nc'
# Temporary subset geotiff file
tmptiff = r'/home/hunter/roms/NOPP/data/FPH_NOPP_Fusion/tmp.tif'
#Padding for geotiff subset.
dx=0.01
dy=0.01
########################################################################
#AND HERE
########################################################################
file: input grid file. This must be a local file.
infile: INPUT Vegetation Classification FILE. Geotiff format
inifile: ROMS initialization file containg original plant_* variables
newinifile: New ROMS initialization file with updated plant_* variables
dx and dy are padding scales used to define the subset footprint.
3) Activate relevant conda environment. Note this must be run on either linux or maxOS as it uses xesmf, which is not available on Windows.
% activate conda VEGATATION_ENVIRON
necessary conda packages:
xarray
numpy
cartopy
time
rioxarray
matplotlib
cartopy
xesmf
osgeo
shutil
netCDF4
4) run REGRID_ROMS_VEGETATION_FUSION.py
% python REGRID_ROMS_VEGETATION_FUSION.py
or
% nohup python REGRID_ROMS_VEGETATION_FUSION.py > log.dat &
5) Thius will generate a new initilization file, newinifile
author: Elias Hunter, hunter @ marine.rutgers.edu 1/23/2023.
Chris Sherwood ([email protected]) and John Warner ([email protected]) provided code for mapping the land use classifications to plant parameters.