CAMS-GLOB-ANT#
This Python script is used to process CAMS-GLOB-ANT data using IPTpy. Users could use Jupyter Notebook to taste the code.
# import packages
import libraries
import xarray as xr
import numpy as np
from iptpy.anthro_emission.fv import FV
# initialize
fv_instance = FV(
preregrid_path='/gws/nopw/j04/duicv/yuansun/dataset/CAMS/CAMS-GLOB-ANT_v5.3/',
regridder_filename='/gws/nopw/j04/duicv/yuansun/IPTpy/tests/regridded/test_cams_0.1x0.1_0.9x1.25_regridder.nc',
regridded_path='/gws/nopw/j04/duicv/yuansun/IPTpy/tests/regridded/',
start_year=2018,
end_year=2018,
source='CAMS-GLOB-ANT',
version='v5.3',
original_resolution='0.1x0.1',
)
Step1: Regrid from 0.1°x0.1° to 0.9°x1.25°#
fv_instance.generate_regridder()
fv_instance.apply_regridder()
Once a regridder exists, it can be reused and does not need to be generated when running
apply_regridder()
multiple times.
Step2: Rename gridded data#
fv_instance.rename(
renamed_path ='/gws/nopw/j04/duicv/yuansun/IPTpy/tests/renamed/'
)
Note that the
regridder_filename
and files in thepreregrid_path
orregridded_path
orrenamed_path
will be automatically deleted before new files are generated, so manual deletion is not required.