SyCLoPS User Manual¶
The paper on SyCLoPS: The System for Classification of Low-Pressure Systems (SyCLoPS): An All-in-One Objective Framework for Large-scale Datasets (Han & Ullrich)
Note: This manual focuses on the use/applications of a SyCLoPS classification catalog and other technical tips on how to use TempestExtremes (TE) more efficiently. Details of TE commands and their brief instructions are documented in the SyCLoPS manuscript's supporting information (SI) text S6 and in TE_commands.sh
.
The two main steps for implementing SyCLoPS:
Run the
TE_commands.sh
either line by line (for testing/debugging) or by the whole script (if everyting is ready to go).Do
python SyCLoPS_classifier.py
to run the main classifier program. This program preprocesses the data output by TE, computes the LPSAREA parameter and track information for labeling quasi-stationary (QS) tracks, performs the main classification process, and outputs the classified catalog. Please change the filenames and constants to your desired settings in the first section of the script before running it.
There are several optional steps for SyCLoPS applications which are discussed in section 3.2 of this manual.
If this manual does not answer your questions about SyCLoPS, please contact the author Yushan Han at yshhan@ucdavis.edu
1. More Tips on implementing TE commands¶
1.1 Installing TE¶
Please refer to the TE GitHub page for instructions on installing TE: https://github.com/ClimateGlobalChange/tempestextremes
Please refer to the TE documentation for detailed explanations of each function, argument and operation: https://climate.ucdavis.edu/tempestextremes.php
If you still have question about the TE software, please contact Paul Ullrich at paullrich@ucdavis.edu
1.2 To optimize TE's capabilities in parallel computing (MPI), the following practices are recommended:¶
Use MPI/Open MPI in TE commands. For example, add
srun -n 128
ormpirun -np 128
to the beginning of some TE commands to enable parallel computing. Please refer to the Open MPI documentation provided online or by your supercomputer host. DetectNodes, DetectBlobs and VariableProcessor support MPI computation in TE version 2.2.3. The parallelization is achieved by writing the *inputfile as a list of files, each containing variables of a time slice. See 1.3 for details.For other TE commands that cannot be parallelized but are potentially time consuming (e.g. BlobStats, StitchBlobs), one may opt to use the GNU parallel tool to run multiple commands simultaneously on a single thread. To achieve this, users should first create a txt file containing a list of TE commands to be parallelized. Here is a sample shell script code to generate a list of BlobStats commands (with IKE calculation for each blob) to be parallelized in years:
'''
for year in {1979..2022}
do
echo "${TEMPESTEXTREMESDIR}/BlobStats --in_list "StitchBlob_size_input_{year}.txt" \
--findblobs --out_file Size_blob_stats_{year}.txt --var 'block_tag' \
--out 'centlon,centlat,minlat,maxlat,minlon,maxlon,area' \
--sumvar '_PROD(_SUM(_POW(U(925hPa),2),_POW(V(925hPa),2)),0.5)' \
--out_fulltime --latname latitude --lonname longitude"
done
'''
In order for BlobStats to calculate the operation within the argument
sumvar
shown above, one should provide the ouput NetCDF file from the DetectBlobs as well as 925 hPa U and V files in all theStitchBlob_size_input_{year}.txt
file.StitchNodes is very fast with single thread, so it typically doesn't require parallel computing.
1.3. Each inputfile for each TE command needs to contain all the necessary variables and time slices used in TE's operations:¶
To cope with the parallel computation, it's suggested to list the input files on each line in the following format (each line represents one line in the input txt list file):
Variable1_time_slice1;Variable2_time_slice1;Variable3_time_slice1;...
Variable1_time_slice2;Variable2_time_slice2;Variable3_time_slice2;...
Variable1_time_slice3;Variable2_time_slice3;Variable3_time_slice3;...
...The outputfile should contain the same number of lines (files) as the inputfile. So it should have a filename for each time slice on each line.
Note that TE will select the time series from the first file listed in the first row (Variable 1) for future time slice matching. If your files are in different time slice frequencies: e.g. Variable 1 files are listed in single days (e.g. Variable1_20210101, Variable1_20210102, Variable1_20210103, ...), but Variable 2 files are listed in single months (e.g, Variable2_202101, Variable2_202102, Variable2_202103, ...), just make sure that Variable 2 contains all the time steps found in Variable 1 on each line.
An example shell script to list 4 different variables (Z, MSL, U10 and ZS, the constant surface geopotential) with different time slices for the inputfile (the outputfile is generated together):
'''
ERA5DIR=/global/cfs/projectdirs/m3522/cmip6/ERA5
mkdir -p LPS
rm -rf ERA5_example_in.txt # the input file
rm -rf ERA5_example_out.txt # the output file
for f in $ERA5DIR/e5.oper.an.pl/*; do
# In this example ERA5 directory, variables are stored in folders named by years and months (e.g., 202001,202002)
yearmonth=$(basename $f)
year=${yearmonth:0:4}
echo "..${yearmonth}"
if [[ $year -gt '1978' ]] && [[ $year -lt '2023' ]]
then
for zfile in $f/*128_129_z*; do
zfilebase=$(basename $zfile)
yearmonthday=${zfilebase:32:8}
mslfile=`ls $ERA5DIR/e5.oper.an.sfc/${yearmonth}/*128_151_msl*`
u10file=`ls $ERA5DIR/e5.oper.an.sfc/${yearmonth}/*128_165_10u*`
topofile=./e5.oper.invariant.Zs.ll025sc.nc
echo "$zfile;$mslfile;$u10file;$topofile" >> ERA5_example_in.txt
echo "LPS/era5.LPS.node.${yearmonthday}.txt" >> ERA5_example_out.txt
done
fi
done
'''
An example of an inputfile for performing DetectNodes is uploaded to the Zenodo dataset.
Finally, if you need to use a daily-mean variable for a higher-frequency detection (e.g., 6 hourly), you will need to first oversample the daily-mean variable files before putting them into TE. For instance, if you have a file that conatains only one data point per day (usally at T12:00 or T00:00 of each day) for a daily-mean variable, you would need to resample it to 4 data points (repeat the same value for each day) per day (at 00,06,12,18 UTC for 6-hourly data) to match your detection frequency (and the data frequency of your Variable 1). TE may update a feature to overcome this inconvenience in the future.
1.4. If the vorticity field required by DetectNodes is not avaialble in your dataset:¶
Vorticity field (VO) input is required by the VO500AVG parameter operation (
VO(500hPa),avg,2.5
) in DetectNodes.If VO fields are not available, one option is to use standalone codes/packages in Python (or other languages) to first calculate the relative vorticity based on U and V at 500 hPa, and then output them to VO files.
The other option is more native to TE: Use the operation
_CURL{16,2.5}{8,3}(U(5000hPa),V(500hPa))
or_CURL{8,2.5}{8,3}(U(500hPa),V(500hPa))
(the curl of a field within 2.5 GCD from a grid point) instead ofVO(500hPa),avg,2.5
to directly evaluate VO500AVG.
1.5. When to use the new feature prioritize MSLP
in StitchNodes:¶
If you choose a merging distance in
mergedist
of DetectNodes that is smaller than the distance inrange
of StitchNodes, you should consider using the--prioritize MSLP
feature in the StitchNodes. Just add this argument to the end of the StitchNodes command.This is a new feature added in TE 2.2.3. It is introduced to prevent the end of a track from inadvertently connecting to another nearby non-revelant track in such circumstances. See SI text S6 for further details.
2. Look-up Tables and the Classification Flowchart¶
This section reproduces several tables and the SyCLoPS workflow diagram displayed in the SyCLoPS manuscript with some more details.
2.1 LPS Initialism Table¶
Initialism |
Full Term |
Definition |
---|---|---|
HAL | High-altitude Low | LPSs found at high altitudes without a warm core |
THL | Thermal low | Shallow systems featuring a dry and warm lower core |
HATHL | High-altitude Thermal Low | LPSs found at high altitudes with a warm core |
DOTHL | Deep (Orographic) Thermal Low | Non-shallow LPSs featuring a dry and warm lower core driven by topography |
TC | Tropical Cyclone | LPSs that would be named in IBTrACS |
TD | Tropical Depression | Tropical systems that have developed a weak upper-level warm core and are strong enough to be recorded as TDs in IBTrACS |
TLO | Tropical Low | Non-shallow tropical systems that fall short of TD requirements |
MD | Monsoon Depression | TDs developing in monsoonal environment. A monsoon environment is considered to be dominated by westerly winds (resulting in asymmetric wind fields in monsoon LPS) and very humid Labeled as "TD(MD)" in the classified catalog. TDs that fall short of the monsoonal system condition are labeled "TD" |
ML | Monsoon Low | TLOs developing in monsoonal environment. Labeled as "TLO(ML)" in the classified catalog. TLOs that fall short of the monsoonal system condition are labeled "TLO" |
MS | Monsoonal System | Monsoon LPSs (MDs plus MLs) |
TLC | Tropical-Like Cyclone | Non-tropical LPSs that resemble TCs (typically smaller than TCs). For example, they can have gale-force sustained surface wind, well-organized convection (sometimes with an eyewall) and a deep warm core |
SS (STLC) | Subtropical Storm (Subtropical Tropical-Like Cyclone) | A type of TLC in the subtropics, represented by Mediterranean hurricanes |
PL (PTLC) | Polar Low (Polar Tropical-Like Cyclone) | A type of TLC typically found north of the polar front |
SC | Subtropical Cyclone | A type of LPS that is typically associated with a upper-level cut-off low south of the polar jet and has a shallow warm core |
EX | Extratropical Cyclone | Most typical non-tropical cyclones |
DS | Disturbance | Shallow LPSs or waves with weak surface circulations. DSD, DST and DSE are dry, tropical and extratropical DSs |
QS | Quasi-stationary | LPSs that stay relatively localized as labeled by the QS track condition |
2.2 SyCLoPS Classification Workflow and Assigned Labels and Full Names¶
Section numbers in the figure refers to the section numbers in the SyCLoPS manuscript.
2.3 The Input LPS Catalog Column Table (for SyCLoPS_input.parquet)¶
Column | Unit |
Description |
---|---|---|
TID | - | LPS track ID (0-based) in both the input and classified catalog |
ISOTIME | - | UTC timestamp (ISO time) of the LPS node in both catalogs |
LON | ° | Longitude of the LPS node in both catalogs |
LAT | ° | Latitude of the LPS node in both catalogs |
MSLP | Pa | Mean sea level pressure at the LPS node in both catalogs |
MSLPCC20 | Pa | Greatest positive closed contour delta of MSLP over a 2.0° GCD (the core of an LPS) |
MSLPCC55 | Pa | Greatest positive closed contour delta of MSLP over a 5.5° GCD |
DEEPSHEAR | $\mathrm{m\:s^{-1}}$ | Average deep-layer wind speed shear between 200 hPa and 850 hPa over a 10.0° GCD |
UPPTKCC | $\mathrm{m^{2}\:s^{-2}}$ | Greatest negative closed contour delta of the upper-level thickness between 300 hPa and 500 hPa over a 6.5° GCD, referenced to the maximum value within 1.0° GCD |
MIDTKCC | $\mathrm{m^{2}\:s^{-2}}$ | Greatest negative closed contour delta of the middle-level thickness between 500 hPa and 700 hPa over a 3.5° GCD, referenced to the maximum value within 1.0° GCD |
LOWTKCC$^{a}$ | $\mathrm{m^{2}\:s^{-2}}$ | Greatest negative closed contour delta of the lower-level thickness between 700 hPa and 925 hPa over a 3.5° GCD, referenced to the maximum value within 1.0° GCD |
Z500CC | $\mathrm{m^2\:s^{-2}}$ | Greatest positive closed contour delta of geopotential at 500 hPa over a 3.5° GCD referenced to the minimum value within 1.0° GCD |
VO500AVG | $\mathrm{s^{-1}}$ | Average relative vorticity over a 2.5° GCD |
RH100MAX | % | Maximum relative humidity at 100 hPa within 2.5° GCD |
RH850AVG | % | Average relative humidity over a 2.5° GCD at 850 hPa |
T850 | K | Air temperature at 850 hPa at the LPS node |
Z850 | $\mathrm{m^2\:s^{-2}}$ | Geopotential at 850 hPa at the LPS node |
ZS | $\mathrm{m^2\:s^{-2}}$ | Geopotential at the surface at the LPS node |
U850DIFF | $\mathrm{m\:s^{-1}\:sr}$ | Difference between the weighted area mean of positive and negative values of 850 hPa U-component wind over a 5.5° GCD |
WS200PMX | $\mathrm{m\:s^{-1}}$ | Maximum poleward value of 200 hPa wind speed within 1.0° GCD longitude |
RAWAREA* | $\mathrm{km^2}$ | The raw defined size (see appendix E) of the LPS |
LPSAREA | $\mathrm{km^2}$ | The adjusted defined size of the LPS in both catalogs (see appendix E) |
* This parameter in the column is for user reference only. It does not affect any results in the SyCLoPS LPS node or track classification.
2.4 The Classified LPS Catalog Column Table (for SyCLoPS_classified.parquet)¶
Column | Unit |
Description |
---|---|---|
TID | - | LPS track ID (0-based) in both the input and classified catalog |
ISOTIME | - | UTC timestamp (ISO time) of the LPS node in both catalogs |
LON | ° | Longitude of the LPS node in both catalogs |
LAT | ° | Latitude of the LPS node in both catalogs |
MSLP | Pa | Mean sea level pressure at the LPS node in both catalogs |
WS* | $\mathrm{m\:s^{-1}}$ | Maximum wind speed at the 10-m level within 2.0° GCD |
Full_Name | - | The full LPS name based on the classification |
Short_Label | - | The assigned LPS label (the abbreviation of the full name) |
Tropical_Flag | - | 1 if the LPS is designated as a tropical system, otherwise 0 |
Transition_Zone | - | 1 if the LPS is in the defined transition zone, otherwise 0 |
Track_Info | - | "TC", "MS", "SS(STLC)", "PL(PTLC)", "QS" denoted for TC, MS, SS, PL and QS tracks; "EXT", "TT" denoted for extratropical and tropical transition completion nodes |
IKE* | $\mathrm{TJ}$ | The integrated kinetic energy computed based on the LPS size blobs that are used to define RAWAREA |
* These two columns are for user reference only. They do not affect any results in the SyCLoPS LPS node or track classification. Please also note that the IKE column in the latest SyCLoPS classified catalog fixed a bug (missing "× 1/2") that produced incorrect IKE results in the initial version (version 1) of this catalog. This bug did not affect any other procedures and results in SyCLoPS.
3. SyCLoPS Catalogs Usages and Applications¶
3.1 How to select different types of LPS nodes and tracks in the classified catalog:¶
To open the classified catalog:
import numpy as np
import pandas as pd
ClassifiedCata='SyCLoPS_classified.parquet' # your path to the classified catalog
dfc=pd.read_parquet(ClassifiedCata) # open the parquet format file. PyArrow package requireed.
dfc
TID | LON | LAT | ISOTIME | MSLP | WS | Full_Name | Short_Label | Tropical_Flag | Transition_Zone | Track_Info | LPSAREA | IKE | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 56.75 | 70.00 | 1979-01-01 00:00:00 | 97686.00 | 12.66622 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 1182834 | 160.5 |
1 | 0 | 56.75 | 69.75 | 1979-01-01 03:00:00 | 97869.81 | 12.43663 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 1039577 | 139.0 |
2 | 0 | 57.50 | 69.50 | 1979-01-01 06:00:00 | 98085.94 | 12.29883 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 952895 | 126.0 |
3 | 0 | 57.75 | 69.25 | 1979-01-01 09:00:00 | 98294.25 | 11.26188 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 877000 | 117.0 |
4 | 0 | 59.25 | 69.25 | 1979-01-01 12:00:00 | 98454.31 | 10.92470 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 863035 | 118.5 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
7781101 | 379301 | 336.00 | -60.50 | 2022-12-31 09:00:00 | 97146.94 | 12.96320 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 1131118 | 186.5 |
7781102 | 379301 | 337.25 | -60.75 | 2022-12-31 12:00:00 | 97272.25 | 13.02440 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 1037363 | 167.5 |
7781103 | 379301 | 339.00 | -61.00 | 2022-12-31 15:00:00 | 97358.38 | 13.75519 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 1065815 | 160.0 |
7781104 | 379301 | 340.00 | -60.75 | 2022-12-31 18:00:00 | 97431.12 | 13.85164 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 950077 | 131.0 |
7781105 | 379301 | 341.25 | -60.75 | 2022-12-31 21:00:00 | 97573.38 | 14.35034 | Extratropical Cyclone | EX | 0.0 | 0.0 | Track | 551042 | 81.0 |
7781106 rows × 13 columns
If desired, the input and ouput (classified) catalogs can also be combined to produce a larger catalog:
# InputCata='SyCLoPS_input.parquet'
# dfin=pd.read_parquet(InputCata)
# dfc=pd.concat([dfc,dfin],axis=1)
Task 1. Select a single type of LPS node (e.g., TC):
dftc=dfc[dfc.Short_Label=='TC']
Task 2. Select two types of LPS node (e.g., EX and SC):
dfexsc=dfc[(dfc.Short_Label=='EX') | (dfc.Short_Label=='SC')]
Task 3. Select two types of TLC node (including SS(STLC) and PL(PTLC)):
dftlc=dfc[dfc.Short_Label.str.contains('TLC')]
dftlc
TID | LON | LAT | ISOTIME | MSLP | WS | Full_Name | Short_Label | Tropical_Flag | Transition_Zone | Track_Info | LPSAREA | IKE | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24 | 1 | 347.00 | 68.00 | 1979-01-02 00:00:00 | 100267.10 | 20.49998 | Subtropical Tropical-like Cyclone (Subtropical... | SS(STLC) | 0.0 | 0.0 | Track | 369392 | 62.5 |
53 | 2 | 359.50 | 58.00 | 1979-01-01 21:00:00 | 101263.30 | 13.46975 | Subtropical Tropical-like Cyclone (Subtropical... | SS(STLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 102890 | 3.0 |
55 | 2 | 1.50 | 56.00 | 1979-01-02 03:00:00 | 101188.20 | 15.56540 | Subtropical Tropical-like Cyclone (Subtropical... | SS(STLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 124718 | 14.0 |
57 | 2 | 3.25 | 54.00 | 1979-01-02 09:00:00 | 100931.10 | 17.09763 | Subtropical Tropical-like Cyclone (Subtropical... | SS(STLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 171076 | 11.5 |
58 | 2 | 3.75 | 53.00 | 1979-01-02 12:00:00 | 100894.20 | 18.27007 | Polar Low (Extratropical Tropical-like Cyclone) | PL(PTLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 196833 | 7.5 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
7780923 | 379281 | 229.00 | 51.00 | 2022-12-30 21:00:00 | 98289.44 | 14.45700 | Polar Low (Extratropical Tropical-like Cyclone) | PL(PTLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 340496 | 51.0 |
7780924 | 379281 | 230.00 | 51.00 | 2022-12-31 00:00:00 | 98490.81 | 14.61593 | Polar Low (Extratropical Tropical-like Cyclone) | PL(PTLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 266978 | 30.5 |
7780925 | 379281 | 230.50 | 51.25 | 2022-12-31 03:00:00 | 98671.88 | 14.43227 | Polar Low (Extratropical Tropical-like Cyclone) | PL(PTLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 223329 | 25.5 |
7780926 | 379281 | 231.00 | 51.50 | 2022-12-31 06:00:00 | 98916.38 | 13.51526 | Polar Low (Extratropical Tropical-like Cyclone) | PL(PTLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 362436 | 20.5 |
7780927 | 379281 | 231.25 | 51.50 | 2022-12-31 09:00:00 | 99244.94 | 12.39370 | Polar Low (Extratropical Tropical-like Cyclone) | PL(PTLC) | 0.0 | 0.0 | Track_SS(STLC)_PL(PTLC) | 280448 | 17.0 |
208514 rows × 13 columns
Task 4. Select all nodes in TC trcaks and get the track IDs (TID) of all TC tracks:
dftc2=dfc[dfc.Track_Info.str.contains('TC')]
tctid=pd.unique(dftc2.TID)
print(tctid)
[ 17 21 59 ... 378821 378875 379061]
Task 5. Select all TC nodes in MS tracks:
dftcms=dfc[(dfc.Short_Label=='TC') & (dfc.Track_Info.str.contains('MS'))]
Task 6. Select all DST and all TLO (including TLO and TLO(ML)) nodes in TC tracks:
dftc3=dfc[((dfc.Short_Label=='DST')|(dfc.Short_Label.str.contains('TLO'))) & (dfc.Track_Info.str.contains('TC'))]
Task 7. Select LPS track IDs (TIDs) that have at least 5 non-tropical LPS nodes that are not DSE:
dfex=dfc[(dfc.Tropical_Flag==0)&(dfc.Short_Label!='DSE')]
extrackid=pd.unique(dfex.TID)[dfex.groupby('TID')['TID'].count()>=5]
Task 8. Select Tracks that are both a TC track, SS track and PL(PTLC) track:
tcsspl_trackid=pd.unique(dfc[(dfc.Track_Info.str.contains('TC')) & (dfc.Track_Info.str.contains('SS')) & (dfc.Track_Info.str.contains('PL'))].TID)
dftcsspl=dfc[dfc.TID.isin(tcsspl_trackid)]
Task 9. Select all non-tropical (extratropical) LPS nodes:
dfexnode=dfc[(dfc.Tropical_Flag==0)]
Task 10. Select all tropical TCs nodes in TC tracks that are not undergoing extratropical transition:
dftc3=dfc[(dfc.Track_Info.str.contains('TC')) & (dfc.Tropical_Flag==1) & (dfc.Transition_Zone==0)]
Task 11. Select all tropical transition completion nodes:
dftt=dfc[dfc.Track_Info.str.contains('TT')]
Task 12. Select TC tracks that do not undergo extratropical transition
tcnoext_trackid=pd.unique(dfc[(dfc.Track_Info.str.contains('TC')) & ~(dfc.Track_Info.str.contains('EXT'))].TID)
Task 13. Select potential easterly wave (EW) nodes:
dfew=dfc[~(dfc.Track_Info.str.contains('M')) & ~(dfc.Track_Info.str.contains('Q')) & ~(dfc.Short_Label.str.contains('M')) & (dfc.Tropical_Flag==1)]
Task 14. Select all LPS nodes within a bounded region in January:
dflps=dfc[(dfc.LAT>=30) & (dfc.LAT<=50) & (dfc.LON>=280) & (dfc.LON<=350) & (dfc.ISOTIME.dt.month==1)]
Task 15. Select all PL nodes in PL(PTLC) tracks in the Nordic Seas from 1979 to 1999
dfpl=dfc[(dfc.LAT>=45) & (dfc.LAT<=85) & (((dfc.LON>=320) & (dfc.LON<360)) | ((dfc.LON>=0) & (dfc.LON<=70))) & \
(dfc.Track_Info.str.contains('PL')) & (dfc.Short_Label=='PL(PTLC)') & (dfc.ISOTIME.dt.year>=1979) & (dfc.ISOTIME.dt.year<=1999)]
dfpl.LON.hist()
<Axes: >
3.2 Other applications based on the classified catalog:¶
Here we introduce two additional usages of SyCLoPS: calculating intergataed kinetic energy (IKE) accumulation or precipitation contribution percentage for a specific type of LPS.
To perform this task, users need to run Blob_idtag.py
and TE_optional.sh
. Users can opt to run the additional TE commands within `Blob_idtag_app.py' (lines 13-15). The procedure can be divided into five steps:
- The additional TE commands in
TE_optional.sh
detect precipitation blobs and calculate blob statistics (properties) using BlobStats in addition to the size blobs already detected inTE_commands.sh
. - Both size and precipitation blobs are masked with a unique ID (1-based, e.g., 1,,2,3,4,5,...) through StitchBlobs.
- The blob-tagging Python script (
Blob_idtag.py
) pairs precipitation blobs to LPS nodes in the same way as we did for size blobs. - The Python script assigns tags (labels) to different blobs according to their paired labeled LPS nodes and the blobs IDs given by BlobStats. The assigned tags are then used to remask blobs with the tag numbers (e.g., 1=TC, 2=MS, 3=SS, 4=PL, 5=others) in the StitchBlobs's output nc files.
- Finally, run TE commands demonstrated in the "additional steps" in
TE_optional.sh
to extract 3-hourly precipitation and 925 hPa IKE at each grid point conatined within each size/precipitation blobs that are associated with a tag number (i.e., a type of LPS).
In step four, the Python script uses a tagging arrangement like we described in the last section of the SyCLoPS manuscript. However, there are many ways one can assign those tags. In the manuscript, we define TC blobs (with tag=1) as those blobs that are paired with TC nodes in TC tracks, which corresponds to these nodes in the classified catalog:
tcid=dfc[(dfc.Short_Label=='TC') & (dfc.Track_Info.str.contains('TC'))].index.values
blobtag=np.ones(len(dfc))*5 #5 = Other systems
blobtag[tcid]=1
# Subsequent codes in the Python script: ...
However, one can also define that blobs paried with all TC nodes (not only those in TC tracks) are considered TC blobs with tag=1:
tcid=dfc[dfc.Short_Label=='TC'].index.values
blobtag=np.ones(len(dfc))*5 #5 = Other systems
blobtag[tcid]=1
# Subsequent codes in the Python script: ...
One may also define that blobs paried with all tropical LPS nodes in TC tracks are considered TC blobs with tag=1:
tcid=dfc[(dfc.Tropical_Flag==1) & (dfc.Track_Info.str.contains('TC'))].index.values
blobtag=np.ones(len(dfc))*5 #5 = Other systems
blobtag[tcid]=1
# Subsequent codes in the Python script: ...
If you are using a multiple tag system (e.g. having tag = 1,2,3,4,and more), please be careful not to have overlapping paired LPS nodes among different tags (i.e., making them all mutually exclusive). The below example shows a bad practice:
tcid=dfc[(dfc.Tropical_Flag==1) & (dfc.Track_Info.str.contains('TC'))].index.values
msid=dfc[(dfc.Tropical_Flag==1) & (dfc.Track_Info.str.contains('MS'))].index.values
blobtag=np.ones(len(dfc))*5 #5 = Other systems
blobtag[tcid]=1 #1=TCs
blobtag[msid]=2 #2=MSs
# Subsequent codes in the Python script: ...
The above codes will produce overlapped LPS nodes within tcid
and msid
. This will cause some TC node IDs to be overwritten by the subsequent MS IDs.
You may also just ouput one kind of tag (e.g., just tag=1) for a group of LPSs:
msid=dfc[(dfc.Short_Label.str.contains('M')) & (dfc.Short_Label=='TC') & (dfc.Track_Info.str.contains('MS'))].index.values
blobtag=np.ones(len(dfc))*0 # Other systems are all labeled 0
blobtag[msid]=1 #1=MSs
Another example:
ssid=dfc[(dfc.Short_Label=='SS(STLC)') & (dfc.Track_Info.str.contains('SS')) & ~(dfc.Track_Info.str.contains('TC'))].index.values
blobtag=np.ones(len(dfc))*0 # Other systems are all labeled 0
blobtag[ssid]=1 #1=SSs
In the above two examples, blobs that are not tagged (masked) "1" will be tagged (masked) "0." In binary masking, "0" means that blobs are not detected. Hence, the final output NetCDF blob files will only contain blobs with tag (mask)=1 associated with the desired LPS group.
After tags are assigned to blobs as described in the Python script, they will be used to alter the original blobs masks in the NetCDF files output by StitchNodes. If one groups the blob ids in terms of the tag assigned, it will look something like this:
Tag number | Blob IDs |
---|---|
1 | 50, 139, 236, 337, 438, 553, 554, 663, ... |
2 | 46, 137, 235, 335, 434, 436, 550, 660, ... |
3 | 121, 244, 709, 719, 849, 861, 935, 1153, ... |
4 | 1261, 1324, 1431, 1535, 1637, 1748, 1753, 185, ... |
5 | 1, 2, 3, 4, 5, 6, 7, 8, ... |
The output nc files with these alternations will contain blobs with their assigned tag numbers. For example, if tags 1-5 are used, grid points in each blob will be either masked 1, 2, 3, 4 or 5.
Finally, after implementing the last step (step 5) in TE, one can easily calculate the final accumulated IKE of each type of LPS over a period of time by summing each time frame of the output NetCDF files. To calculate the precipitation contribution percentage of a type of LPS, one should first calculate the total precipitation over a period by summing each time frame of the 3-hourly (or other frequency) precipitation file without any blob masks. Then do the same procedure, but with the precipitation blob masks output by TE. Lastly, the (annual/seasonal) contribution percentage of a type of LPS can be easily performed.