gcpy.file_regrid

Module Contents

Functions

file_regrid(fin, fout, dim_format_in, dim_format_out)

Regrids an input file to a new horizontal grid specification and saves it

rename_restart_variables(ds[, towards_gchp])

Renames restart variables according to GEOS-Chem Classic and GCHP conventions.

drop_and_rename_classic_vars(ds[, towards_gchp])

Renames and drops certain restart variables according to GEOS-Chem Classic

Attributes

parser

gcpy.file_regrid.file_regrid(fin, fout, dim_format_in, dim_format_out, cs_res_out=0, ll_res_out='0x0', sg_params_in=[1.0, 170.0, -90.0], sg_params_out=[1.0, 170.0, -90.0], vert_params_out=[[], []])

Regrids an input file to a new horizontal grid specification and saves it as a new file.

Args:
fin: str

The input filename

fout: str

The output filename (file will be overwritten if it already exists)

dim_format_in: str

Format of the input file’s dimensions (choose from: classic, checkpoint, diagnostic), where classic denotes lat/lon and checkpoint / diagnostic are cubed-sphere formats

dim_format_out: str

Format of the output file’s dimensions (choose from: classic, checkpoint, diagnostic), where classic denotes lat/lon and checkpoint / diagnostic are cubed-sphere formats

Keyword Args (optional):
cs_res_out: int

The cubed-sphere resolution of the output dataset. Not used if dim_format_out is classic Default value: 0

ll_res_out: str

The lat/lon resolution of the output dataset. Not used if dim_format_out is not classic Default value: ‘0x0’

sg_params_in: list[float, float, float]

Input grid stretching parameters [stretch-factor, target longitude, target latitude]. Not used if dim_format_in is classic Default value: [1.0, 170.0, -90.0] (No stretching)

sg_params_out: list[float, float, float]

Output grid stretching parameters [stretch-factor, target longitude, target latitude]. Not used if dim_format_out is classic Default value: [1.0, 170.0, -90.0] (No stretching)

vert_params_out: list(list, list) of list-like types

Hybrid grid parameter A in hPa and B (unitless) in [AP, BP] format. Needed for lat/lon output if not using full 72-level or 47-level grid Default value: [[], []]

gcpy.file_regrid.rename_restart_variables(ds, towards_gchp=True)

Renames restart variables according to GEOS-Chem Classic and GCHP conventions.

Args:
ds: xarray.Dataset

The input dataset

Keyword Args (optional):
towards_gchp: bool

Whether renaming to (True) or from (False) GCHP format Default value: True

Returns:
xarray.Dataset

Input dataset with variables renamed

gcpy.file_regrid.drop_and_rename_classic_vars(ds, towards_gchp=True)

Renames and drops certain restart variables according to GEOS-Chem Classic and GCHP conventions.

Args:
ds: xarray.Dataset

The input dataset

Keyword Args (optional):
towards_gchp: bool

Whether going to (True) or from (False) GCHP format Default value: True

Returns:
xarray.Dataset

Input dataset with variables renamed and dropped

gcpy.file_regrid.parser