From c692c705e157ed4a15b48c9f47ea07b92b56dca2 Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:04:36 -0400 Subject: [PATCH 1/9] Update global_data_process.py --- python/global_data_process.py | 87 +++++++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 19 deletions(-) diff --git a/python/global_data_process.py b/python/global_data_process.py index 2168b929..41c68d7d 100755 --- a/python/global_data_process.py +++ b/python/global_data_process.py @@ -1,5 +1,6 @@ """ -Created on Sun Jun 4 15:45:29 2023 +Created on Sun Jun 4 2023 +Updated on Mon Oct 16 2023: Use daily gfs.canopy files Author: Wei-Ting Hung """ @@ -65,7 +66,9 @@ f_met = ( path + "/gfs.t" + HHI + "z." + YY + MM + DD + ".sfcf0" + HH + ".nc" ) # gfs met file -f_can = path + "/gfs.canopy.t" + HHI + "z." + YY + MM + "01.sfcf000.nc" # canopy file +f_can = ( + path + "/gfs.canopy.t" + HHI + "z." + YY + MM + DD + ".sfcf000.nc" +) # canopy file f_output = ( path + "/gfs.canopy.t" + HHI + "z." + YY + MM + DD + ".global.f0" + HH + ".nc" ) # output file @@ -88,7 +91,7 @@ + ".nc " ) elif frp_src == 2: # climatological frp - f_frp = path + "/gfs.canopy.t" + HHI + "z." + YY + MM + "01.sfcf000.nc" + f_frp = path + "/gfs.canopy.t" + HHI + "z." + YY + MM + DD + ".sfcf000.nc" # required variables @@ -109,7 +112,7 @@ "hpbl", "prate_ave", ] -canlist = ["lai", "clu", "ffrac", "fh", "mol", "csz", "frp", "href"] +canlist = ["lai", "clu", "ffrac", "fh", "pavd", "mol", "csz", "frp", "href"] # constants @@ -149,12 +152,25 @@ def mapping(xgrid, ygrid, data, xdata, ydata, map_method, fvalue): def read_gfs_climatology(filename, lat, lon, varname): readin = Dataset(filename) - # map to met grids - yt = readin["lat"][:] - xt = readin["lon"][:] - data = np.squeeze(readin[varname][0, :, :]) + if varname == 'pavd': + ## map to met grids + yt = readin['lat'][:] + xt = readin['lon'][:] + data = np.squeeze(readin[varname][:]) + + DATA = np.empty([data.shape[0], lat.shape[0], lat.shape[1]]) + + for ll in np.arange(data.shape[0]): + DATA[ll, :, :] = mapping(lat, lon, data[ll, :, :].flatten(), yt.flatten(), xt.flatten(), 'linear', np.nan) + + else: + # map to met grids + yt = readin["lat"][:] + xt = readin["lon"][:] + data = np.squeeze(readin[varname][0, :, :]) - DATA = mapping(lat, lon, data.flatten(), yt.flatten(), xt.flatten(), "linear", np.nan) + DATA = mapping(lat, lon, data.flatten(), yt.flatten(), xt.flatten(), "linear", np.nan) + DATA[np.isnan(DATA)] = 0 DATA[DATA < 0] = 0 return DATA @@ -226,7 +242,8 @@ def read_frp_local(filename, lat, lon, fill_value): + "z." + YY + MM - + "01.sfcf000.nc", + + DD + + ".sfcf000.nc", ] ) if os.path.isfile(f_can) is True: @@ -262,7 +279,7 @@ def read_frp_local(filename, lat, lon, fill_value): else: print("---- No available FRP file. Switch to Climatology FRP...") frp_src = 2 - f_frp = path + "/gfs.canopy.t" + HHI + "z." + YY + MM + "01.sfcf000.nc" + f_frp = path + "/gfs.canopy.t" + HHI + "z." + YY + MM + DD + ".sfcf000.nc" if frp_src == 2: # 12 month climatology frp if os.path.isfile(f_frp) is True: @@ -281,7 +298,8 @@ def read_frp_local(filename, lat, lon, fill_value): + "z." + YY + MM - + "01.sfcf000.nc", + + DD + + ".sfcf000.nc", ] ) if os.path.isfile(f_met) is True: @@ -354,6 +372,11 @@ def read_frp_local(filename, lat, lon, fill_value): ATT = ["Canopy height above the surface", "m", fill_value] DATA = read_gfs_climatology(f_can, lat, lon, "fh") + elif varname == 'pavd': + ATTNAME = ['long_name', 'units', 'missing_value'] + ATT = ['Plant area volume density profile', 'm2/m3', fill_value] + DATA = read_gfs_climatology(f_can, lat, lon, 'pavd') + elif varname == "mol": # Reference: # Essa 1999, ESTIMATION OF MONIN-OBUKHOV LENGTH USING RICHARDSON AND BULK RICHARDSON NUMBER @@ -409,15 +432,41 @@ def read_frp_local(filename, lat, lon, fill_value): print(ATT) # adding to output file - output = Dataset(f_output, "a") + if varname == 'pavd': + output = Dataset(f_output, 'a') + output.createDimension('level', DATA.shape[0]) - var = output.createVariable( - varname, "float", ("time", "grid_yt", "grid_xt"), fill_value=fill_value - ) - write_varatt(var, ATTNAME, ATT) - var[:] = DATA + var_bot = output.createVariable( + 'layer_bottom', 'i4', ('level', ) + ) + var_top = output.createVariable( + 'layer_top', 'i4', ('level', ) + ) + var = output.createVariable( + varname, 'float', ('time', 'level', 'grid_yt', 'grid_xt'), fill_value=fill_value + ) + + write_varatt(var, ATTNAME, ATT) + write_varatt(var_bot, ['long_name', 'units'], ['height of the layer bottom above the ground', 'm']) + write_varatt(var_top, ['long_name', 'units'], ['height of the layer top above the ground', 'm']) + + var_bot[:] = np.arange(0, 65+1, 5) + var_top[:] = np.arange(5, 70+1, 5) + var[:] = DATA + + output.close() + del [var_bot, var_top] + + else: + output = Dataset(f_output, "a") + + var = output.createVariable( + varname, "float", ("time", "grid_yt", "grid_xt"), fill_value=fill_value + ) + write_varatt(var, ATTNAME, ATT) + var[:] = DATA - output.close() + output.close() print("---- " + varname + " complete!") From 4f3a8ac3959b7f44be563c3a9c917ff7437c455a Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:31:29 -0400 Subject: [PATCH 2/9] Update Table 2 Add pavd and data time frequency --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 27671b42..c5b5a478 100644 --- a/README.md +++ b/README.md @@ -150,10 +150,11 @@ The Canopy-App input data in [Table 2](#table-2-canopy-app-required-input-variab | `hpbl` | Height of the planetary boundary layer (m) | UFS NOAA/GFSv16 | | `prate_ave` | Average mass precipitation rate (kg m-2 s-1) | UFS NOAA/GFSv16 | | **External Canopy Variables** | **Variable Description and Units** | **Data Source/Reference (if necessary)** | -| `fh` | Forest canopy height (m) | Fused GEDI/Landsat data. Data Period=2020. ([Potapov et al., 2020](https://doi.org/10.1016/j.rse.2020.112165)) | -| `clu` | Forest clumping index (dimensionless) | GriddingMachine/MODIS. Data Period=2001-2017 Climatology. ([Wei et al., 2019](https://doi.org/10.1016/j.rse.2019.111296)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | -| `lai` | Leaf area index (m2/m2) | VIIRS-NPP. Data Period=2018-2020 Climatology. ([Myneni 2018](https://doi.org/10.5067/VIIRS/VNP15A2H.001)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | -| `ffrac` | Forest fraction (dimensionless) | Based on [VIIRS GVF-NPP](https://www.star.nesdis.noaa.gov/jpss/gvf.php) and GriddingMachine/MODIS FFRAC/FVC from Terra. Data Period=2020. ([DiMiceli et al., 2022](https://doi.org/10.5067/MODIS/MOD44B.061)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | +| `fh` | Forest canopy height (m) | Fused GEDI/Landsat data. Data Period=2020. Data frequency=Static. ([Potapov et al., 2020](https://doi.org/10.1016/j.rse.2020.112165)) | +| `clu` | Forest clumping index (dimensionless) | GriddingMachine/MODIS. Data Period=2001-2017 Climatology. Data frequency=Monthly. ([Wei et al., 2019](https://doi.org/10.1016/j.rse.2019.111296)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | +| `lai` | Leaf area index (m2/m2) | VIIRS-NPP. Data Period=2020. Data frquency=Daily, interpolated from original 8-day product. ([Myneni 2018](https://doi.org/10.5067/VIIRS/VNP15A2H.001)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | +| `ffrac` | Forest fraction (dimensionless) | Based on [VIIRS GVF-NPP](https://www.star.nesdis.noaa.gov/jpss/gvf.php) and GriddingMachine/MODIS FFRAC/FVC from Terra. Data Period=2020. Data frequency=Static. ([DiMiceli et al., 2022](https://doi.org/10.5067/MODIS/MOD44B.061)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | +| `pavd` | Plant area volume density (m2/m3) | [GEDI product from North Arizona University](https://goetzlab.rc.nau.edu/index.php/gedi/). Data Period=201904-202212 Climatology. Data frequency=Static. | | **Other External Variables** | **Variable Description and Units** | **Data Source/Reference (if necessary)** | | `frp` | Total Fire Radiative Power (MW/grid cell area) | [NOAA/NESDIS GBBEPx](https://www.ospo.noaa.gov/Products/land/gbbepx/) | | `csz` | Cosine of the solar zenith angle (dimensionless) | [Based on Python Pysolar](https://pysolar.readthedocs.io/en/latest/) | From 6a7a33a1d79f2e93ac487ab6b485485f5bd6922e Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:39:26 -0400 Subject: [PATCH 3/9] Update Table 2 Add pavd and data time frequency --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c5b5a478..2a613df5 100644 --- a/README.md +++ b/README.md @@ -150,11 +150,11 @@ The Canopy-App input data in [Table 2](#table-2-canopy-app-required-input-variab | `hpbl` | Height of the planetary boundary layer (m) | UFS NOAA/GFSv16 | | `prate_ave` | Average mass precipitation rate (kg m-2 s-1) | UFS NOAA/GFSv16 | | **External Canopy Variables** | **Variable Description and Units** | **Data Source/Reference (if necessary)** | -| `fh` | Forest canopy height (m) | Fused GEDI/Landsat data. Data Period=2020. Data frequency=Static. ([Potapov et al., 2020](https://doi.org/10.1016/j.rse.2020.112165)) | +| `fh` | Forest canopy height (m) | Fused GEDI/Landsat data. Data Period=2020. Data frequency=Annual. ([Potapov et al., 2020](https://doi.org/10.1016/j.rse.2020.112165)) | | `clu` | Forest clumping index (dimensionless) | GriddingMachine/MODIS. Data Period=2001-2017 Climatology. Data frequency=Monthly. ([Wei et al., 2019](https://doi.org/10.1016/j.rse.2019.111296)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | | `lai` | Leaf area index (m2/m2) | VIIRS-NPP. Data Period=2020. Data frquency=Daily, interpolated from original 8-day product. ([Myneni 2018](https://doi.org/10.5067/VIIRS/VNP15A2H.001)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | -| `ffrac` | Forest fraction (dimensionless) | Based on [VIIRS GVF-NPP](https://www.star.nesdis.noaa.gov/jpss/gvf.php) and GriddingMachine/MODIS FFRAC/FVC from Terra. Data Period=2020. Data frequency=Static. ([DiMiceli et al., 2022](https://doi.org/10.5067/MODIS/MOD44B.061)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | -| `pavd` | Plant area volume density (m2/m3) | [GEDI product from North Arizona University](https://goetzlab.rc.nau.edu/index.php/gedi/). Data Period=201904-202212 Climatology. Data frequency=Static. | +| `ffrac` | Forest fraction (dimensionless) | Based on [VIIRS GVF-NPP](https://www.star.nesdis.noaa.gov/jpss/gvf.php) and GriddingMachine/MODIS FFRAC/FVC from Terra. Data Period=2020. Data frequency=Annual. ([DiMiceli et al., 2022](https://doi.org/10.5067/MODIS/MOD44B.061)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | +| `pavd` | Plant area volume density (m2/m3) | [GEDI product from North Arizona University](https://goetzlab.rc.nau.edu/index.php/gedi/). Data Period=201904-202212 Climatology. Data frequency=Annual. Three dimensional structure of plant area volume density with 14 vertical layers from the surface (0 m) to 70 m above ground level. Data at each layer represents the average pavd within certain height range (e.g. 0 - 5 m for first layer). | | **Other External Variables** | **Variable Description and Units** | **Data Source/Reference (if necessary)** | | `frp` | Total Fire Radiative Power (MW/grid cell area) | [NOAA/NESDIS GBBEPx](https://www.ospo.noaa.gov/Products/land/gbbepx/) | | `csz` | Cosine of the solar zenith angle (dimensionless) | [Based on Python Pysolar](https://pysolar.readthedocs.io/en/latest/) | From 501aab6f1c829010e0e33b8c0adcf3ac381fb880 Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:55:20 -0400 Subject: [PATCH 4/9] Update global_data_process.py --- python/global_data_process.py | 71 +++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/python/global_data_process.py b/python/global_data_process.py index 41c68d7d..627dcd49 100755 --- a/python/global_data_process.py +++ b/python/global_data_process.py @@ -66,9 +66,7 @@ f_met = ( path + "/gfs.t" + HHI + "z." + YY + MM + DD + ".sfcf0" + HH + ".nc" ) # gfs met file -f_can = ( - path + "/gfs.canopy.t" + HHI + "z." + YY + MM + DD + ".sfcf000.nc" -) # canopy file +f_can = path + "/gfs.canopy.t" + HHI + "z." + YY + MM + DD + ".sfcf000.nc" # canopy file f_output = ( path + "/gfs.canopy.t" + HHI + "z." + YY + MM + DD + ".global.f0" + HH + ".nc" ) # output file @@ -152,16 +150,24 @@ def mapping(xgrid, ygrid, data, xdata, ydata, map_method, fvalue): def read_gfs_climatology(filename, lat, lon, varname): readin = Dataset(filename) - if varname == 'pavd': + if varname == "pavd": ## map to met grids - yt = readin['lat'][:] - xt = readin['lon'][:] + yt = readin['lat'][:] + xt = readin['lon'][:] data = np.squeeze(readin[varname][:]) DATA = np.empty([data.shape[0], lat.shape[0], lat.shape[1]]) for ll in np.arange(data.shape[0]): - DATA[ll, :, :] = mapping(lat, lon, data[ll, :, :].flatten(), yt.flatten(), xt.flatten(), 'linear', np.nan) + DATA[ll, :, :] = mapping( + lat, + lon, + data[ll, :, :].flatten(), + yt.flatten(), + xt.flatten(), + 'linear', + np.nan + ) else: # map to met grids @@ -169,7 +175,9 @@ def read_gfs_climatology(filename, lat, lon, varname): xt = readin["lon"][:] data = np.squeeze(readin[varname][0, :, :]) - DATA = mapping(lat, lon, data.flatten(), yt.flatten(), xt.flatten(), "linear", np.nan) + DATA = mapping( + lat, lon, data.flatten(), yt.flatten(), xt.flatten(), "linear", np.nan + ) DATA[np.isnan(DATA)] = 0 DATA[DATA < 0] = 0 @@ -372,10 +380,10 @@ def read_frp_local(filename, lat, lon, fill_value): ATT = ["Canopy height above the surface", "m", fill_value] DATA = read_gfs_climatology(f_can, lat, lon, "fh") - elif varname == 'pavd': - ATTNAME = ['long_name', 'units', 'missing_value'] - ATT = ['Plant area volume density profile', 'm2/m3', fill_value] - DATA = read_gfs_climatology(f_can, lat, lon, 'pavd') + elif varname == "pavd": + ATTNAME = ["long_name", "units", "missing_value"] + ATT = ["Plant area volume density profile", "m2/m3", fill_value] + DATA = read_gfs_climatology(f_can, lat, lon, "pavd") elif varname == "mol": # Reference: @@ -432,27 +440,34 @@ def read_frp_local(filename, lat, lon, fill_value): print(ATT) # adding to output file - if varname == 'pavd': - output = Dataset(f_output, 'a') - output.createDimension('level', DATA.shape[0]) + if varname == "pavd": + output = Dataset(f_output, "a") + output.createDimension("level", DATA.shape[0]) - var_bot = output.createVariable( - 'layer_bottom', 'i4', ('level', ) - ) - var_top = output.createVariable( - 'layer_top', 'i4', ('level', ) - ) - var = output.createVariable( - varname, 'float', ('time', 'level', 'grid_yt', 'grid_xt'), fill_value=fill_value + var_bot = output.createVariable("layer_bottom", "i4", ("level", )) + var_top = output.createVariable("layer_top", "i4", ("level", )) + var = output.createVariable( + varname, + "float", + ("time", "level", "grid_yt", "grid_xt"), + fill_value=fill_value ) write_varatt(var, ATTNAME, ATT) - write_varatt(var_bot, ['long_name', 'units'], ['height of the layer bottom above the ground', 'm']) - write_varatt(var_top, ['long_name', 'units'], ['height of the layer top above the ground', 'm']) + write_varatt( + var_bot, + ["long_name", "units"], + ["height of the layer bottom above the ground", "m"] + ) + write_varatt( + var_top, + ["long_name", "units"], + ["height of the layer top above the ground", "m"] + ) - var_bot[:] = np.arange(0, 65+1, 5) - var_top[:] = np.arange(5, 70+1, 5) - var[:] = DATA + var_bot[:] = np.arange(0, 65 + 1, 5) + var_top[:] = np.arange(5, 70 + 1, 5) + var[:] = DATA output.close() del [var_bot, var_top] From 9f409a02c3bc7f95fabc2c229252ed35eb8ee943 Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:59:33 -0400 Subject: [PATCH 5/9] Update global_data_process.py --- python/global_data_process.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/python/global_data_process.py b/python/global_data_process.py index 627dcd49..a224b32e 100755 --- a/python/global_data_process.py +++ b/python/global_data_process.py @@ -152,8 +152,8 @@ def read_gfs_climatology(filename, lat, lon, varname): if varname == "pavd": ## map to met grids - yt = readin['lat'][:] - xt = readin['lon'][:] + yt = readin["lat"][:] + xt = readin["lon"][:] data = np.squeeze(readin[varname][:]) DATA = np.empty([data.shape[0], lat.shape[0], lat.shape[1]]) @@ -165,7 +165,7 @@ def read_gfs_climatology(filename, lat, lon, varname): data[ll, :, :].flatten(), yt.flatten(), xt.flatten(), - 'linear', + "linear", np.nan ) @@ -382,8 +382,8 @@ def read_frp_local(filename, lat, lon, fill_value): elif varname == "pavd": ATTNAME = ["long_name", "units", "missing_value"] - ATT = ["Plant area volume density profile", "m2/m3", fill_value] - DATA = read_gfs_climatology(f_can, lat, lon, "pavd") + ATT = ["Plant area volume density profile", "m2/m3", fill_value] + DATA = read_gfs_climatology(f_can, lat, lon, "pavd") elif varname == "mol": # Reference: @@ -444,25 +444,25 @@ def read_frp_local(filename, lat, lon, fill_value): output = Dataset(f_output, "a") output.createDimension("level", DATA.shape[0]) - var_bot = output.createVariable("layer_bottom", "i4", ("level", )) - var_top = output.createVariable("layer_top", "i4", ("level", )) + var_bot = output.createVariable("layer_bottom", "i4", ("level",)) + var_top = output.createVariable("layer_top", "i4", ("level",)) var = output.createVariable( varname, "float", ("time", "level", "grid_yt", "grid_xt"), - fill_value=fill_value + fill_value=fill_value, ) write_varatt(var, ATTNAME, ATT) write_varatt( var_bot, ["long_name", "units"], - ["height of the layer bottom above the ground", "m"] + ["height of the layer bottom above the ground", "m"], ) write_varatt( var_top, ["long_name", "units"], - ["height of the layer top above the ground", "m"] + ["height of the layer top above the ground", "m"], ) var_bot[:] = np.arange(0, 65 + 1, 5) From d4ac4c4020eebdcce10795c38927e6113202329a Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:03:49 -0400 Subject: [PATCH 6/9] Update global_data_process.py --- python/global_data_process.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/python/global_data_process.py b/python/global_data_process.py index a224b32e..7737333b 100755 --- a/python/global_data_process.py +++ b/python/global_data_process.py @@ -1,6 +1,6 @@ """ Created on Sun Jun 4 2023 -Updated on Mon Oct 16 2023: Use daily gfs.canopy files +Updated on Mon Oct 16 2023: Use daily gfs.canopy files Author: Wei-Ting Hung """ @@ -160,13 +160,13 @@ def read_gfs_climatology(filename, lat, lon, varname): for ll in np.arange(data.shape[0]): DATA[ll, :, :] = mapping( - lat, - lon, - data[ll, :, :].flatten(), - yt.flatten(), - xt.flatten(), - "linear", - np.nan + lat, + lon, + data[ll, :, :].flatten(), + yt.flatten(), + xt.flatten(), + "linear", + np.nan, ) else: @@ -447,21 +447,21 @@ def read_frp_local(filename, lat, lon, fill_value): var_bot = output.createVariable("layer_bottom", "i4", ("level",)) var_top = output.createVariable("layer_top", "i4", ("level",)) var = output.createVariable( - varname, - "float", - ("time", "level", "grid_yt", "grid_xt"), + varname, + "float", + ("time", "level", "grid_yt", "grid_xt"), fill_value=fill_value, ) write_varatt(var, ATTNAME, ATT) write_varatt( - var_bot, - ["long_name", "units"], + var_bot, + ["long_name", "units"], ["height of the layer bottom above the ground", "m"], ) write_varatt( - var_top, - ["long_name", "units"], + var_top, + ["long_name", "units"], ["height of the layer top above the ground", "m"], ) From b4eb77e5243eeb0d6baae08e6cb84103e24a8a21 Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:05:31 -0400 Subject: [PATCH 7/9] Update global_data_process.py --- python/global_data_process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/global_data_process.py b/python/global_data_process.py index 7737333b..f4bedd62 100755 --- a/python/global_data_process.py +++ b/python/global_data_process.py @@ -151,7 +151,7 @@ def read_gfs_climatology(filename, lat, lon, varname): readin = Dataset(filename) if varname == "pavd": - ## map to met grids + # map to met grids yt = readin["lat"][:] xt = readin["lon"][:] data = np.squeeze(readin[varname][:]) From 44ae791c1dfdfe43bb57922506f3a9a6908a17f4 Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:10:53 -0400 Subject: [PATCH 8/9] Update global_data_process.py --- python/global_data_process.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/global_data_process.py b/python/global_data_process.py index f4bedd62..e656b2f4 100755 --- a/python/global_data_process.py +++ b/python/global_data_process.py @@ -168,7 +168,7 @@ def read_gfs_climatology(filename, lat, lon, varname): "linear", np.nan, ) - + else: # map to met grids yt = readin["lat"][:] @@ -178,7 +178,7 @@ def read_gfs_climatology(filename, lat, lon, varname): DATA = mapping( lat, lon, data.flatten(), yt.flatten(), xt.flatten(), "linear", np.nan ) - + DATA[np.isnan(DATA)] = 0 DATA[DATA < 0] = 0 return DATA @@ -384,7 +384,7 @@ def read_frp_local(filename, lat, lon, fill_value): ATTNAME = ["long_name", "units", "missing_value"] ATT = ["Plant area volume density profile", "m2/m3", fill_value] DATA = read_gfs_climatology(f_can, lat, lon, "pavd") - + elif varname == "mol": # Reference: # Essa 1999, ESTIMATION OF MONIN-OBUKHOV LENGTH USING RICHARDSON AND BULK RICHARDSON NUMBER From f7856c8279852afb5d896e90adc2d6bfae7a6296 Mon Sep 17 00:00:00 2001 From: Patrick Campbell Date: Mon, 16 Oct 2023 20:37:02 -0400 Subject: [PATCH 9/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a613df5..1d854e00 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ The Canopy-App input data in [Table 2](#table-2-canopy-app-required-input-variab | **External Canopy Variables** | **Variable Description and Units** | **Data Source/Reference (if necessary)** | | `fh` | Forest canopy height (m) | Fused GEDI/Landsat data. Data Period=2020. Data frequency=Annual. ([Potapov et al., 2020](https://doi.org/10.1016/j.rse.2020.112165)) | | `clu` | Forest clumping index (dimensionless) | GriddingMachine/MODIS. Data Period=2001-2017 Climatology. Data frequency=Monthly. ([Wei et al., 2019](https://doi.org/10.1016/j.rse.2019.111296)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | -| `lai` | Leaf area index (m2/m2) | VIIRS-NPP. Data Period=2020. Data frquency=Daily, interpolated from original 8-day product. ([Myneni 2018](https://doi.org/10.5067/VIIRS/VNP15A2H.001)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | +| `lai` | Leaf area index (m2/m2) | VIIRS-NPP. Data Period=2020. Data frequency=Daily, interpolated from original 8-day product. ([Myneni 2018](https://doi.org/10.5067/VIIRS/VNP15A2H.001)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | | `ffrac` | Forest fraction (dimensionless) | Based on [VIIRS GVF-NPP](https://www.star.nesdis.noaa.gov/jpss/gvf.php) and GriddingMachine/MODIS FFRAC/FVC from Terra. Data Period=2020. Data frequency=Annual. ([DiMiceli et al., 2022](https://doi.org/10.5067/MODIS/MOD44B.061)). Extended globally for high latitudes using methods described [here](https://gmuedu-my.sharepoint.com/:w:/g/personal/whung_gmu_edu/EdglXmW2kzBDtDj1xV0alGcB1Yo2I8hzdyWGVGB2YOTfgw). | | `pavd` | Plant area volume density (m2/m3) | [GEDI product from North Arizona University](https://goetzlab.rc.nau.edu/index.php/gedi/). Data Period=201904-202212 Climatology. Data frequency=Annual. Three dimensional structure of plant area volume density with 14 vertical layers from the surface (0 m) to 70 m above ground level. Data at each layer represents the average pavd within certain height range (e.g. 0 - 5 m for first layer). | | **Other External Variables** | **Variable Description and Units** | **Data Source/Reference (if necessary)** |