Skip to content

Commit

Permalink
\ Include subset of NN classifications
Browse files Browse the repository at this point in the history
  • Loading branch information
observingClouds committed Feb 6, 2022
1 parent 1e7f162 commit 9cb251b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
33 changes: 33 additions & 0 deletions scripts/extract_eurec4a_timeperiod_NNclassifications.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Extract EUREC4A timeperiod from infrared neural network classification dataset
"""
import xarray as xr
import numcodecs

import dask
from dask_jobqueue import SLURMCluster
from dask.distributed import Client, LocalCluster, comm
print(dask.__version__)
dask.config.config.get('distributed').get('dashboard').update({'link':'{JUPYTERHUB_SERVICE_PREFIX}/proxy/{port}/status'})
cluster = SLURMCluster(project="mh0010")
client = Client(cluster)


ds=xr.open_zarr("/mnt/lustre02/work/mh0010/m300408/CharacterizationOfMesoscalePatterns/Data/Level_1/GOES16_CH13_classifications_2018-2020_NDJFM_30min.zarr/")

# Select EUREC4A time period
ds=ds.sel(time=slice('2020-01-01','2020-03-01'))

del ds.time.attrs['description']

encoding={
'mask':{'dtype':bool,'compressor':numcodecs.Blosc("zstd",shuffle=numcodecs.Blosc.BITSHUFFLE)},
'time':{'dtype':'float64'}
}

ds['mask'] = (ds.mask.astype(float)>0).astype(bool)
ds['pattern'] = ds.pattern.astype('str')

cluster.scale(10)
ds2.to_zarr("../auxiliary_data/GOES16_CH13_classifications_EUREC4A_30min.zarr", encoding=encoding, consolidated=True)
cluster.scale(0)
7 changes: 6 additions & 1 deletion scripts/reprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ python create_level3.py -e ${classification} -m daily

# Calculate agreement between different classifications
python calculate_agreement.py -t 0.1
python calculate_agreement.py -t 0.25
python calculate_agreement.py -t 0.5

# Get subset of neural network classifications
# (does not need to be executed since subset is included)
# python extract_eurec4a_timeperiod_NNclassifications.py

# Run notebooks for analysis

# Prepare data for zenodo upload
bash create_zenodo_datazip.sh ${classification}

0 comments on commit 9cb251b

Please sign in to comment.