Commit 4e419284 authored by Antoine Berchet's avatar Antoine Berchet
Browse files

CAMS working for interpolation

parent 8d625035
...@@ -15,8 +15,9 @@ _fullname = "CAMS netcdf files" ...@@ -15,8 +15,9 @@ _fullname = "CAMS netcdf files"
input_arguments={ input_arguments={
"aibi_name": { "aibi_name": {
"doc": "to choose ai bi vertical coordinate names" "doc": "To choose ai/bi vertical coordinate names"
" instead of hyam and hybm", " instead of hyam and hybm; this depends on the version of the CAMS "
"product to be read",
"default": False, "default": False,
"accepted": bool "accepted": bool
}, },
......
...@@ -6,6 +6,7 @@ import xarray as xr ...@@ -6,6 +6,7 @@ import xarray as xr
from .....utils.classes.setup import Setup from .....utils.classes.setup import Setup
import copy import copy
def get_domain(ref_dir, ref_file, input_dates, target_dir, tracer=None): def get_domain(ref_dir, ref_file, input_dates, target_dir, tracer=None):
# Looking for a reference file to read lon/lat in # Looking for a reference file to read lon/lat in
...@@ -67,6 +68,7 @@ def get_domain(ref_dir, ref_file, input_dates, target_dir, tracer=None): ...@@ -67,6 +68,7 @@ def get_domain(ref_dir, ref_file, input_dates, target_dir, tracer=None):
else : else :
sigma_a = nc["hyam"].values sigma_a = nc["hyam"].values
sigma_b = nc["hybm"].values sigma_b = nc["hybm"].values
nlevs = sigma_a.size nlevs = sigma_a.size
# Initializes domain # Initializes domain
......
...@@ -59,10 +59,10 @@ def read( ...@@ -59,10 +59,10 @@ def read(
lat = ds['latitude'] lat = ds['latitude']
conc = ds[var2extract].values[date_index] conc = ds[var2extract].values[date_index]
if lat[1] < lat[0] and conc.ndim==4: if lat[1] < lat[0] and conc.ndim == 4:
conc = conc[:, :, ::-1, :] conc = conc[:, :, ::-1, :]
elif lat[1] < lat[0] and conc.ndim==3: elif lat[1] < lat[0] and conc.ndim == 3:
conc = conc[ :, ::-1, :] conc = conc[:, ::-1, :]
xout.append(conc) xout.append(conc)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment