Onset and Retreat of Monsoon

Onset and Retreat of Monsoon#

Before proceeding with all the steps, first import some necessary libraries and packages

import xarray as xr
import cartopy.crs as ccrs
import easyclimate as ecl

Open precipitable water example data (must be daily frequency data)

pw_data = ecl.open_tutorial_dataset("pr_wtr_eatm_2022").pr_wtr
pw_data
pr_wtr_eatm_2022.nc ━━━━━━━━━━━━━━━━━━ 100.0% • 8.4/8.4 MB • 82.8 MB/s • 0:00:00
<xarray.DataArray 'pr_wtr' (time: 365, lat: 73, lon: 144)> Size: 15MB
[3836880 values with dtype=float32]
Coordinates:
  * time     (time) datetime64[ns] 3kB 2022-01-01 2022-01-02 ... 2022-12-31
  * lat      (lat) float32 292B 90.0 87.5 85.0 82.5 ... -82.5 -85.0 -87.5 -90.0
  * lon      (lon) float32 576B 0.0 2.5 5.0 7.5 10.0 ... 350.0 352.5 355.0 357.5
Attributes:
    long_name:     mean Daily Precipitable Water for entire atmosphere
    units:         kg/m^2
    precision:     2
    GRIB_id:       54
    GRIB_name:     PWAT
    var_desc:      Precipitable Water Content
    dataset:       NCEP Reanalysis Daily Averages
    level_desc:    Entire Atmosphere Considered As a Single Layer
    statistic:     Mean
    parent_stat:   Individual Obs
    valid_range:   [-50. 150.]
    actual_range:  [-4.8      81.075005]


Calculate the NPWI index using easyclimate.field.monsoon.calc_index_NPWI

See also

<xarray.DataArray 'pr_wtr' (time: 365, lat: 73, lon: 144)> Size: 15MB
array([[[0.11188813, 0.11188813, 0.11188813, ..., 0.11188813,
         0.11188813, 0.11188813],
        [0.09598216, 0.0935412 , 0.09242763, ..., 0.10045148,
         0.09988777, 0.09955256],
        [0.09099708, 0.0909971 , 0.09108527, ..., 0.08562992,
         0.08699901, 0.08949416],
        ...,
        [0.484375  , 0.4631579 , 0.45161286, ..., 0.52763814,
         0.5177665 , 0.49230772],
        [0.5232558 , 0.51445085, 0.5058139 , ..., 0.5257143 ,
         0.52298856, 0.52298856],
        [0.57812494, 0.57812494, 0.57812494, ..., 0.57812494,
         0.57812494, 0.57812494]],

       [[0.13519815, 0.13519815, 0.13519815, ..., 0.13519815,
         0.13519815, 0.13519815],
        [0.10491072, 0.10022272, 0.09799556, ..., 0.10948082,
         0.10886644, 0.10738254],
        [0.10648596, 0.10745402, 0.10852714, ..., 0.09744094,
         0.10068426, 0.1040856 ],
...
        [0.42708334, 0.42105263, 0.4139785 , ..., 0.45226127,
         0.44162434, 0.43589744],
        [0.4127907 , 0.40462428, 0.40697673, ..., 0.3885714 ,
         0.39080462, 0.40229887],
        [0.40624997, 0.40624997, 0.40624997, ..., 0.40624997,
         0.40624997, 0.40624997]],

       [[0.1864802 , 0.1864802 , 0.1864802 , ..., 0.1864802 ,
         0.1864802 , 0.1864802 ],
        [0.1964286 , 0.19265033, 0.18708242, ..., 0.20541763,
         0.20314254, 0.19910516],
        [0.1577928 , 0.1568248 , 0.15600777, ..., 0.16043305,
         0.15933527, 0.15758753],
        ...,
        [0.41666666, 0.41578948, 0.40860215, ..., 0.40703517,
         0.41116747, 0.4051282 ],
        [0.37209302, 0.3699422 , 0.3837209 , ..., 0.34285712,
         0.3448276 , 0.36206898],
        [0.3359375 , 0.3359375 , 0.3359375 , ..., 0.3359375 ,
         0.3359375 , 0.3359375 ]]], shape=(365, 73, 144), dtype=float32)
Coordinates:
  * time     (time) datetime64[ns] 3kB 2022-01-01 2022-01-02 ... 2022-12-31
  * lat      (lat) float32 292B 90.0 87.5 85.0 82.5 ... -82.5 -85.0 -87.5 -90.0
  * lon      (lon) float32 576B 0.0 2.5 5.0 7.5 10.0 ... 350.0 352.5 355.0 357.5
Attributes:
    long_name:     mean Daily Precipitable Water for entire atmosphere
    units:         kg/m^2
    precision:     2
    GRIB_id:       54
    GRIB_name:     PWAT
    var_desc:      Precipitable Water Content
    dataset:       NCEP Reanalysis Daily Averages
    level_desc:    Entire Atmosphere Considered As a Single Layer
    statistic:     Mean
    parent_stat:   Individual Obs
    valid_range:   [-50. 150.]
    actual_range:  [-4.8      81.075005]


Separation of monsoon affected areas with easyclimate.field.monsoon.find_PW_monsoon_region

<xarray.DataArray 'pr_wtr' (lat: 73, lon: 144)> Size: 11kB
array([[False, False, False, ..., False, False, False],
       [False, False, False, ..., False, False, False],
       [False, False, False, ..., False, False, False],
       ...,
       [False, False, False, ..., False, False, False],
       [False, False, False, ..., False, False, False],
       [False, False, False, ..., False, False, False]], shape=(73, 144))
Coordinates:
  * lat      (lat) float32 292B 90.0 87.5 85.0 82.5 ... -82.5 -85.0 -87.5 -90.0
  * lon      (lon) float32 576B 0.0 2.5 5.0 7.5 10.0 ... 350.0 352.5 355.0 357.5
Attributes:
    long_name:     mean Daily Precipitable Water for entire atmosphere
    units:         kg/m^2
    precision:     2
    GRIB_id:       54
    GRIB_name:     PWAT
    var_desc:      Precipitable Water Content
    dataset:       NCEP Reanalysis Daily Averages
    level_desc:    Entire Atmosphere Considered As a Single Layer
    statistic:     Mean
    parent_stat:   Individual Obs
    valid_range:   [-50. 150.]
    actual_range:  [-4.8      81.075005]


Schematization of monsoon impact areas

fig, ax = ecl.plot.quick_draw_spatial_basemap(central_longitude = 200)
PW_monsoon_region.plot(
    ax = ax,
    cbar_kwargs = {'location': 'bottom'},
    transform = ccrs.PlateCarree(),
    levels = [0, 1],
    colors = ["grey"]
)
plot monsoon npwi
<cartopy.mpl.geocollection.GeoQuadMesh object at 0x7ff4241b7f10>

Calculation of monsoon onset with easyclimate.field.monsoon.calc_NPWI_monsoon_onset

<xarray.DataArray (lat: 71, lon: 142)> Size: 81kB
array([[199., 199., 199., ..., 198., 198., 198.],
       [199., 199., 199., ..., 199., 199., 199.],
       [199., 199., 199., ..., 199., 199., 199.],
       ...,
       [ nan,  nan,  22., ...,  nan,  nan,  nan],
       [ nan,  nan,  nan, ...,  nan,  nan,  nan],
       [ nan,  nan,  nan, ...,  nan,  nan,  nan]], shape=(71, 142))
Coordinates:
  * lat      (lat) float32 284B 87.5 85.0 82.5 80.0 ... -80.0 -82.5 -85.0 -87.5
  * lon      (lon) float32 568B 2.5 5.0 7.5 10.0 ... 347.5 350.0 352.5 355.0


Analyzing and mapping the monsoon onset time in the monsoon impact area

fig, ax = ecl.plot.quick_draw_spatial_basemap(central_longitude = 180)
monsoon_onset_date.where(PW_monsoon_region).plot(
    ax = ax,
    cbar_kwargs = {'location': 'bottom'},
    transform = ccrs.PlateCarree(),
    cmap = 'Reds'
)
plot monsoon npwi
<cartopy.mpl.geocollection.GeoQuadMesh object at 0x7ff42271b090>

Calculation of monsoon retreat time with easyclimate.field.monsoon.calc_NPWI_monsoon_retreat

<xarray.DataArray (lat: 71, lon: 142)> Size: 81kB
array([[218., 218., 218., ..., 218., 218., 218.],
       [217., 222., 222., ..., 215., 215., 215.],
       [218., 222., 222., ..., 203., 216., 217.],
       ...,
       [ nan,  nan,  28., ...,  nan,  nan,  nan],
       [ nan,  nan,  nan, ...,  nan,  nan,  nan],
       [ nan,  nan,  nan, ...,  nan,  nan,  nan]], shape=(71, 142))
Coordinates:
  * lat      (lat) float32 284B 87.5 85.0 82.5 80.0 ... -80.0 -82.5 -85.0 -87.5
  * lon      (lon) float32 568B 2.5 5.0 7.5 10.0 ... 347.5 350.0 352.5 355.0


Analyzing and mapping the monsoon retreat time in the monsoon impact area

fig, ax = ecl.plot.quick_draw_spatial_basemap(central_longitude = 180)
monsoon_retreat_date.where(PW_monsoon_region).plot(
    ax = ax,
    cbar_kwargs = {'location': 'bottom'},
    transform = ccrs.PlateCarree(),
    cmap = 'Reds'
)
plot monsoon npwi
<cartopy.mpl.geocollection.GeoQuadMesh object at 0x7ff422601c90>

Total running time of the script: (0 minutes 6.154 seconds)