Commit 4670c41c authored by Clément Haëck's avatar Clément Haëck
Browse files

Add nomask option

parent 5ec550ea
......@@ -63,9 +63,13 @@ def main(args):
m_next("Applying static masks")
# Apply masks: land (enlarged), total zone, min front proba
ds['HI'] = ds.HI.where(~ds.land_large * ds.total * ds.p_frt)
static = ~ds.land_large * ds.total
if not args['nomask']:
static = static * ds.p_frt
ds['HI'] = ds.HI.where(static)
ds = ds.drop_vars(['land_large', 'total', 'p_frt'])
m_next("Computing HI masks")
# Masks
ds['mask_frt'] = ds.HI > args['threshold']
......@@ -86,6 +90,7 @@ def main(args):
up[mask] = up[mask] * op(ds.sst, ds.threshold)
zones['GS3_'+zone] = up
m_end()
print("Setting up histogram computations", end='', flush=True)
hists_var = []
for var in VARS:
......@@ -157,7 +162,7 @@ def get_data(args):
data.append(lib.zones.get_land(args).land_large)
data.append(lib.data.p_frt_mask.get_data(
args, fixes=dict(
threshold=lib.data.p_frt.mask.default_threshold
threshold=lib.data.p_frt_mask.default_threshold
)).rename(mask='p_frt'))
ds = xr.merge(data, join='inner')
......@@ -197,7 +202,7 @@ if __name__ == '__main__':
parser.add_argument('-zones', type=str, default='INS')
args = lib.get_args(['region', 'year', 'days', 'scale', 'number',
'coef', 'fixes', 'threshold'], add_args)
'coef', 'fixes', 'threshold', 'nomask'], add_args)
args['fixes']['Y'] = args['year']
args['Y'] = args['year']
......
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