Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERA5 catalogs -- filename accommodation #80

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions catalogbuilder/intakebuilder/gfdlcrawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,28 @@ def crawlLocal(projectdir, dictFilter,dictFilterIgnore,logger,configyaml,slow):
if not filename.endswith(".nc"):
logger.debug("FILE does not end with .nc. Skipping "+ filepath)
continue
dictInfo = {}
if "/uda" in filepath:
if len(filename.split('.')) != len(set_ftemplate):
logger.debug("Skipping "+filename)
continue
dictInfo["activity_id"] = "UDA"
#if our filename expectations are not met compared to the output_file_path_template in config, skip the loop. TODO revisit for statics
if ("static" not in filename):
if ((len(filename.split('.'))-1) != len(set_ftemplate)):
logger.debug("Skipping "+filename)
continue
else:
if ("static" not in filename):
if ((len(filename.split('.'))-1) != len(set_ftemplate)):
logger.debug("Skipping "+filename)
continue

logger.debug(dirpath+"/"+filename)
dictInfo = {}
dictInfo = getinfo.getProject(projectdir, dictInfo)
# get info from filename
#filepath = os.path.join(dirpath,filename) # 1 AR: Bugfix: this needs to join dirpath and filename to get the full path to the file
dictInfo["path"]=filepath
if (op.countOf(filename,".") == 1):
dictInfo = getinfo.getInfoFromFilename(filename,dictInfo, logger)
else:
dictInfo = getinfo.getInfoFromGFDLFilename(filename,dictInfo, logger,configyaml)
#if (op.countOf(filename,".") == 1):
# dictInfo = getinfo.getInfoFromFilename(filename,dictInfo, logger)
#else:
# dictInfo = getinfo.getInfoFromGFDLFilename(filename,dictInfo, logger,configyaml)
dictInfo = getinfo.getInfoFromGFDLDRS(dirpath, projectdir, dictInfo,configyaml)
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']
Expand Down