Commit 27b1fb1a authored by Clément Haëck's avatar Clément Haëck
Browse files

Add front presence probability mask data

parent d87c295c
"""Create mask where presence of front is probable."""
import lib
import lib.zones
def main(args):
args['period'] = 'total'
ds =
mask = ds.p_frt > args['threshold'] = 'mask'
land = lib.zones.get_land(args,
mask *= ~land['land_large']
mask = mask.where(~land['land'])
ofile =
lib.check_output_dir(ofile, file=True)
mask.to_dataset().to_netcdf(ofile, encoding={'mask': {'zlib': True}})
return mask
if __name__ == '__main__':
def add_args(parser):
parser.add_argument('-threshold', type=float,
args = lib.get_args(, add_args)
ds = main(args)
"""High frontal presence probability mask.
ie pixels where probability of front presence (all data considered) is above a
from os import path
import lib
ARGS_DIR = {'region'}
pregex = 'mask_thr_%(threshold:fmt=.1e).nc'
grid = '4km_EPSG4326'
default_threshold = 1e-2
def get_root(args=None, **kwargs):
args =, args, **kwargs)
root = path.join(lib.root_data, args['region'], 'p_frt_mask')
return root
__name__, pregex, get_root, ARGS_DIR
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