From 6ccd243bf317d2ba82df3f9dfd5d048d645935d9 Mon Sep 17 00:00:00 2001 From: Dongdong Kong Date: Fri, 6 Oct 2023 15:09:45 +0800 Subject: [PATCH] improve `get_model` --- src/CMIP/CMIPFiles_info.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMIP/CMIPFiles_info.jl b/src/CMIP/CMIPFiles_info.jl index 672eb2a..852a71b 100644 --- a/src/CMIP/CMIPFiles_info.jl +++ b/src/CMIP/CMIPFiles_info.jl @@ -6,9 +6,9 @@ filter_model(d::AbstractDataFrame, models::Regex) = d[grepl(d.model, models), :] """ - get_model(file; prefix = "day_", postfix = "_hist|_ssp|_piControl") + get_model(file; prefix = "day_|mon_|year_", postfix = "_hist|_ssp|_piControl") """ -function get_model(file, prefix="day_", postfix="_hist|_ssp|_piControl") +function get_model(file, prefix="day_|mon_|year_", postfix="_hist|_ssp|_piControl") str_extract(basename(file), "(?<=$prefix).*(?=$postfix)") #|> String end