Commit 780f5dc4 authored by Clément Haëck's avatar Clément Haëck
Browse files

Adapt SST processing to lib.data changes

parent 5239be7a
......@@ -6,20 +6,14 @@ Remove ice-covered pixels.
Drop all variables but sst.
Regrid from 4km EPSG4326 to EPSG32662 (Same as GlobColour Grid).
"""
from filefinder import Finder
import xarray as xr
import lib
import lib.data.ostia
import lib.data.ostia as lo
import lib.data.globcolour
from lib.xarray_utils import save_chunks_by_date
def main(args):
finder = Finder(lib.data.ostia.get_root(args), '%(Y)/SST_%(Y)%(m)%(d).nc')
finder.fix_matchers(args['fixes'])
ds = xr.open_mfdataset(finder.get_files())
ds = lo.get_data(args, processed=False)
# Rename variable
ds = ds.rename(analysed_sst='sst')
......@@ -61,8 +55,7 @@ def main(args):
scale_factor=0.01,
zlib=True))
ofile = lib.data.ostia.get_filename(args, Y='%Y', m='%m', d='%d',
relative=False)
ofile = lo.get_filename(args, Y='%Y', m='%m', d='%d', relative=False)
save_chunks_by_date(ds_out, ofile, encoding=encoding)
return ds_out
......
Markdown is supported
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