.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_gallery/plot_tcpv.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_gallery_plot_tcpv.py: Potential Intensity for Typhoon ========================================================================================================= Before proceeding with all the steps, first import some necessary libraries and packages .. GENERATED FROM PYTHON SOURCE LINES 8-12 .. code-block:: Python import xarray as xr import cartopy.crs as ccrs import easyclimate as ecl .. GENERATED FROM PYTHON SOURCE LINES 13-21 Now open the sample dataset .. tip:: You can download following datasets here: - :download:`Download tcpi_sample_data.nc (243 kB) ` .. GENERATED FROM PYTHON SOURCE LINES 21-24 .. code-block:: Python ds = xr.open_dataset('tcpi_sample_data.nc') ds .. raw:: html
<xarray.Dataset> Size: 337kB
    Dimensions:  (level: 31, lat: 25, lon: 24)
    Coordinates:
      * level    (level) float64 248B 1e+03 975.0 950.0 925.0 ... 30.0 20.0 10.0
      * lat      (lat) float64 200B -30.0 -27.5 -25.0 -22.5 ... 22.5 25.0 27.5 30.0
      * lon      (lon) float64 192B 120.0 122.5 125.0 127.5 ... 172.5 175.0 177.5
        month    float64 8B ...
    Data variables:
        lsm      (lat, lon) float64 5kB ...
        sst      (lat, lon) float64 5kB ...
        msl      (lat, lon) float64 5kB ...
        t        (level, lat, lon) float64 149kB ...
        q        (level, lat, lon) float64 149kB ...
        Vmax     (lat, lon) float64 5kB ...
        To       (lat, lon) float64 5kB ...
        Pmin     (lat, lon) float64 5kB ...
        LNB      (lat, lon) float64 5kB ...
        PI_flag  (lat, lon) float64 5kB ...


.. GENERATED FROM PYTHON SOURCE LINES 25-26 And then we use :py:func:`easyclimate.field.typhoon.calc_potential_intensity_Bister_Emanuel_2002 ` to calculate relative variables about potential intensity for typhoon .. GENERATED FROM PYTHON SOURCE LINES 26-40 .. code-block:: Python pi_result = ecl.field.typhoon.calc_potential_intensity_Bister_Emanuel_2002( sst_data = ds.sst, sst_data_units = 'degC', surface_pressure_data = ds.msl, surface_pressure_data_units = 'hPa', temperature_data = ds.t, temperature_data_units = 'degC', specific_humidity_data = ds.q, specific_humidity_data_units = 'g/kg', vertical_dim = 'level', vertical_dim_units = 'hPa' ) pi_result .. raw:: html
<xarray.Dataset> Size: 53kB
    Dimensions:  (lat: 25, lon: 24)
    Coordinates:
      * lat      (lat) float64 200B -30.0 -27.5 -25.0 -22.5 ... 22.5 25.0 27.5 30.0
      * lon      (lon) float64 192B 120.0 122.5 125.0 127.5 ... 172.5 175.0 177.5
        month    float64 8B 7.0
    Data variables:
        vmax     (lat, lon) float64 5kB nan nan nan nan ... 65.87 68.51 65.77 63.86
        pmin     (lat, lon) float64 5kB nan nan nan nan ... 957.8 953.6 958.9 962.5
        ifl      (lat, lon) int64 5kB 0 0 0 0 0 0 0 0 0 0 0 ... 1 1 1 1 1 1 1 1 1 1
        t0       (lat, lon) float64 5kB nan nan nan nan ... 205.4 205.5 205.8 205.9
        otl      (lat, lon) float64 5kB nan nan nan nan ... 131.6 130.0 133.5 136.0
        eff      (lat, lon) float64 5kB nan nan nan nan ... 0.4601 0.4566 0.4543
        diseq    (lat, lon) float64 5kB nan nan nan ... 1.053e+04 9.973e+03
        lnpi     (lat, lon) float64 5kB nan nan nan nan ... 8.375 8.454 8.372 8.313
        lneff    (lat, lon) float64 5kB nan nan nan nan ... -0.7763 -0.7841 -0.789
        lndiseq  (lat, lon) float64 5kB nan nan nan nan ... 9.257 9.336 9.262 9.208
        lnCKCD   (lat, lon) float64 5kB -0.1054 -0.1054 -0.1054 ... -0.1054 -0.1054


.. GENERATED FROM PYTHON SOURCE LINES 41-43 Potential Intensity (PI, :math:`V_{max}`) ------------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 43-52 .. code-block:: Python fig, ax = ecl.plot.quick_draw_spatial_basemap(central_longitude = 200) pi_result.vmax.plot.contourf( ax = ax, cbar_kwargs = {'location': 'bottom'}, transform = ccrs.PlateCarree(), levels = 21 ) ax.set_title('PI ($V_{max}$)', size = 18) .. image-sg:: /auto_gallery/images/sphx_glr_plot_tcpv_001.png :alt: PI ($V_{max}$) :srcset: /auto_gallery/images/sphx_glr_plot_tcpv_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Text(0.5, 1.0, 'PI ($V_{max}$)') .. GENERATED FROM PYTHON SOURCE LINES 53-55 Outflow Temperature (:math:`T_0`) ------------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 55-64 .. code-block:: Python fig, ax = ecl.plot.quick_draw_spatial_basemap(central_longitude = 200) pi_result.t0.plot.contourf( ax = ax, cbar_kwargs = {'location': 'bottom'}, transform = ccrs.PlateCarree(), levels = 21 ) ax.set_title('Outflow Temperature ($T_0$)', size = 18) .. image-sg:: /auto_gallery/images/sphx_glr_plot_tcpv_002.png :alt: Outflow Temperature ($T_0$) :srcset: /auto_gallery/images/sphx_glr_plot_tcpv_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Text(0.5, 1.0, 'Outflow Temperature ($T_0$)') .. GENERATED FROM PYTHON SOURCE LINES 65-67 Outflow Temperature Level (OTL) ------------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 67-77 .. code-block:: Python fig, ax = ecl.plot.quick_draw_spatial_basemap(central_longitude = 200) pi_result.otl.plot.contourf( ax = ax, cbar_kwargs = {'location': 'bottom'}, transform = ccrs.PlateCarree(), vmax = 1050, levels =21 ) ax.set_title('Outflow Temperature Level (OTL)', size = 18) .. image-sg:: /auto_gallery/images/sphx_glr_plot_tcpv_003.png :alt: Outflow Temperature Level (OTL) :srcset: /auto_gallery/images/sphx_glr_plot_tcpv_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Text(0.5, 1.0, 'Outflow Temperature Level (OTL)') .. GENERATED FROM PYTHON SOURCE LINES 78-80 TC Efficiency (:math:`\frac{T_{s} - T_{0}}{T_{0}}`) ------------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 80-89 .. code-block:: Python fig, ax = ecl.plot.quick_draw_spatial_basemap(central_longitude = 200) pi_result.eff.plot.contourf( ax = ax, cbar_kwargs = {'location': 'bottom'}, transform = ccrs.PlateCarree(), levels = 21 ) ax.set_title('TC Efficiency $\\left(\\frac{T_{s} - T_{0}}{T_{0}}\\right)$', size = 18) .. image-sg:: /auto_gallery/images/sphx_glr_plot_tcpv_004.png :alt: TC Efficiency $\left(\frac{T_{s} - T_{0}}{T_{0}}\right)$ :srcset: /auto_gallery/images/sphx_glr_plot_tcpv_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Text(0.5, 1.0258451865594727, 'TC Efficiency $\\left(\\frac{T_{s} - T_{0}}{T_{0}}\\right)$') .. GENERATED FROM PYTHON SOURCE LINES 90-92 Disequlibrium (:math:`h_0^* - h^*`) ------------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 92-102 .. code-block:: Python fig, ax = ecl.plot.quick_draw_spatial_basemap(central_longitude = 200) pi_result.diseq.plot.contourf( ax = ax, cbar_kwargs = {'location': 'bottom'}, transform = ccrs.PlateCarree(), vmin = 0, vmax = 20000, levels = 21 ) ax.set_title('Disequlibrium ($h_0^* - h^*$)', size = 18) .. image-sg:: /auto_gallery/images/sphx_glr_plot_tcpv_005.png :alt: Disequlibrium ($h_0^* - h^*$) :srcset: /auto_gallery/images/sphx_glr_plot_tcpv_005.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Text(0.5, 1.0041228612657185, 'Disequlibrium ($h_0^* - h^*$)') .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 10.649 seconds) .. _sphx_glr_download_auto_gallery_plot_tcpv.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_tcpv.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_tcpv.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_tcpv.zip `