Skip to content

Commit

Permalink
Update global_data_process.py
Browse files Browse the repository at this point in the history
  • Loading branch information
angehung5 authored Nov 7, 2023
1 parent 8ecd4a7 commit 8bb9a19
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions python/global_data_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def read_frp_local(filename, lat, lon, fill_value):
print("------------------------------------")

# met file
if os.path.isfile(f_met) == True:
if os.path.isfile(f_met) is True:
print("---- Met file found!")
else:
print("---- Cannot find met file. Downloading from AWS...")
Expand All @@ -246,15 +246,15 @@ def read_frp_local(filename, lat, lon, fill_value):
+ ".nc",
]
)
if os.path.isfile(f_met) == True:
if os.path.isfile(f_met) is True:
os.chmod(f_met, 0o0755)
print("---- Download complete!")
else:
print("---- No available met data. Terminated!")
exit()

# can file
if os.path.isfile(f_can) == True:
if os.path.isfile(f_can) is True:
print("---- Canopy file found!")
else:
print("---- Cannot find canopy file. Downloading from AWS...")
Expand All @@ -274,7 +274,7 @@ def read_frp_local(filename, lat, lon, fill_value):
+ ".sfcf000.nc",
]
)
if os.path.isfile(f_can) == True:
if os.path.isfile(f_can) is True:
os.chmod(f_can, 0o0755)
print("---- Download complete!")
else:
Expand All @@ -283,7 +283,7 @@ def read_frp_local(filename, lat, lon, fill_value):

# frp file
if frp_src == 0: # local source
if os.path.isfile(f_frp) == True:
if os.path.isfile(f_frp) is True:
os.system("cp " + f_frp + " " + path)
if int(YY + MM + DD) <= 20230510:
f_frp = path + "/GBBEPx_all01GRID.emissions_v003_" + YY + MM + DD + ".nc"
Expand All @@ -296,7 +296,7 @@ def read_frp_local(filename, lat, lon, fill_value):
exit()

if frp_src == 1: # local source
if os.path.isfile(f_frp) == True:
if os.path.isfile(f_frp) is True:
os.system("cp " + f_frp + " " + path)
if int(YY + MM + DD) <= 20230510:
f_frp = path + "/GBBEPx_all01GRID.emissions_v003_" + YY + MM + DD + ".nc"
Expand All @@ -310,7 +310,7 @@ def read_frp_local(filename, lat, lon, fill_value):
f_frp = path + "/gfs.canopy.t" + HH + "z." + YY + MM + DD + ".sfcf000.nc"

if frp_src == 2: # 12 month climatology frp
if os.path.isfile(f_frp) == True:
if os.path.isfile(f_frp) is True:
print("---- FRP file found!")
else:
print("---- Canot find FRP file. Downloading from AWS...")
Expand All @@ -330,7 +330,7 @@ def read_frp_local(filename, lat, lon, fill_value):
+ ".sfcf000.nc",
]
)
if os.path.isfile(f_frp) == True:
if os.path.isfile(f_frp) is True:
os.chmod(f_frp, 0o0755)
print("---- Download complete!")
else:
Expand Down Expand Up @@ -414,7 +414,7 @@ def read_frp_local(filename, lat, lon, fill_value):

DATA = (-1 * den * Cp * t2m * (fricv**3)) / (K * g * shtfl)
DATA[DATA > 500] = 500
DATA[DATA <- 500] = -500
DATA[DATA < -500] = -500

del [readin, t2m, fricv, shtfl]

Expand Down

0 comments on commit 8bb9a19

Please sign in to comment.