Skip to content

Commit

Permalink
one step back and two steps forward
Browse files Browse the repository at this point in the history
  • Loading branch information
aradhakrishnanGFDL committed Oct 25, 2024
1 parent d5a40ab commit 460a089
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 3 additions & 4 deletions catalogbuilder/intakebuilder/getinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def getInfoFromFilename(filename,dictInfo,logger):
def getInfoFromGFDLFilename(filename,dictInfo,logger,configyaml):
# 5 AR: get the following from the netCDF filename e.g. atmos.200501-200912.t_ref.nc
if ( (filename.endswith(".nc"))): # & ("static" not in filename)) ):
print(filename)
stemdir = filename.split(".")
#lets go backwards and match given input directory to the template, add things to dictInfo
j = -2
Expand All @@ -111,11 +110,11 @@ def getInfoFromGFDLFilename(filename,dictInfo,logger,configyaml):
sys.exit("No output_path_template found. Check configuration.")
if( "static" in filename ):
## For static we handle this differently . The GFDL PP expected pattern is atmos.static.nc
#TODO figure out better ways to set this and use fixed for frequency and table_id
#TODO error checking as needed
output_file_template = ['realm']
dictInfo["variable_id"] = "fixed" #TODO verify if variable_id is a key
dictInfo["variable_id"] = "fixed"
dictInfo["frequency"] = "fx"
dictInfo["table_id"] = "fixed"
dictInfo["table_id"] = "fx"
##
nlen = len(output_file_template)
for i in range(nlen-1,-1,-1): #nlen = 3
Expand Down
4 changes: 0 additions & 4 deletions catalogbuilder/intakebuilder/gfdlcrawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ def crawlLocal(projectdir, dictFilter,dictFilterIgnore,logger,configyaml,slow):
if ((len(filename.split('.'))-1) != len(set_ftemplate)):
logger.debug("Skipping "+filename)
continue
else:
print("tmp debugging static", filename)
logger.debug(dirpath+"/"+filename)
dictInfo = {}
dictInfo = getinfo.getProject(projectdir, dictInfo)
Expand All @@ -94,14 +92,12 @@ def crawlLocal(projectdir, dictFilter,dictFilterIgnore,logger,configyaml,slow):
dictInfo = getinfo.getInfoFromFilename(filename,dictInfo, logger)
else:
dictInfo = getinfo.getInfoFromGFDLFilename(filename,dictInfo, logger,configyaml)
print("1. ", dictInfo)
if "variable_id" in dictInfo.keys():
if dictInfo["variable_id"] is not None:
variable_id = dictInfo["variable_id"]
else:
variable_id = ""
dictInfo = getinfo.getInfoFromGFDLDRS(dirpath, projectdir, dictInfo,configyaml,variable_id)
print("2.", dictInfo)
list_bad_modellabel = ["","piControl","land-hist","piClim-SO2","abrupt-4xCO2","hist-piAer","hist-piNTCF","piClim-ghg","piClim-OC","hist-GHG","piClim-BC","1pctCO2"]
list_bad_chunklabel = ['DO_NOT_USE']
if "source_id" in dictInfo:
Expand Down

0 comments on commit 460a089

Please sign in to comment.