Browse Source

Update scripts

Add CAPE analysis
master
FedorSarafanov 3 years ago
parent
commit
550e90b4cc
  1. 3
      Readme.md
  2. 75
      eof_analysis.ipynb
  3. 2
      figures/eofs_and_pcs.eps
  4. 2
      figures/equatorial_variation.eps
  5. 3093
      figures/ip_pg_rmm_variation.eps
  6. BIN
      figures/ip_pg_rmm_variation.png
  7. 2
      figures/ip_pg_variation_partial.eps
  8. 2
      figures/longitudinal_structure.eps
  9. 842
      figures/map_of_contributions.eps
  10. 3866
      figures/olr_sn_cape_variation.eps
  11. BIN
      figures/olr_sn_cape_variation.png
  12. 2
      figures/rmm_diagram.eps
  13. 30
      map_of_contributions.ipynb
  14. 323
      variations_ip_pg_rmm_with_mjo_phase.ipynb

3
Readme.md

@ -18,7 +18,8 @@ If you want to run the code on a local computer, you need to download all files
* `rmm.txt`. Source of this text file you can [download directly](http://www.bom.gov.au/climate/mjo/graphics/rmm.74toRealtime.txt) from the Australian Bureau of Meteorology. The columns of the file represent the date (from 1974 onwards), components of the Real-time Multivariate MJO index (RMM), MJO phase and amplitude. * `rmm.txt`. Source of this text file you can [download directly](http://www.bom.gov.au/climate/mjo/graphics/rmm.74toRealtime.txt) from the Australian Bureau of Meteorology. The columns of the file represent the date (from 1974 onwards), components of the Real-time Multivariate MJO index (RMM), MJO phase and amplitude.
* `OLR_41year_NOAA.npy` This is a `numpy` array with the shape `(14976, 180, 360)`, containing daily averaged (14976 days) Outgoing Longwave Radiation flux values from NOAA PSL data set [olr.day.mean.nc](https://downloads.psl.noaa.gov/Datasets/olrcdr/olr.day.mean.nc) for every cell of a 1°×1° latitude-longitude grid (180×360) starting with 1980-1-1 and ending with 2021-12-31. * `OLR_41year_NOAA.npy` This is a `numpy` array with the shape `(14976, 180, 360)`, containing daily averaged (14976 days) Outgoing Longwave Radiation flux values from NOAA PSL data set [olr.day.mean.nc](https://downloads.psl.noaa.gov/Datasets/olrcdr/olr.day.mean.nc) for every cell of a 1°×1° latitude-longitude grid (180×360) starting with 1980-1-1 and ending with 2021-12-31.
* `DAILY-ENSO34.npy`. This is a `numpy` array with the shape `(4992,)`, containing daily averaged sea surface temperature in the Niño 3.4 region. Here 4992 is the number of days when every third day in 1980–2020 is taken. * `DAILY-ENSO34.npy`. This is a `numpy` array with the shape `(4992,)`, containing daily averaged sea surface temperature in the Niño 3.4 region. Here 4992 is the number of days when every third day in 1980–2020 is taken.
* `DAILY-IP-MAP-V4.3.npy`. This is a `numpy` array with the shape `(4992, 180, 360)`, containing daily averaged (4992 days) contributions to the ionospheric potential (IP) for every cell of a 1°×1° latitude-longitude grid (180×360) for every third day. The gird cell contributions are calculated with the Weather Research and Forecasting model (WRF) version 4.3. * `DAILY-IP-MAP-V4.3.npy`. This is a `numpy` array with the shape `(4992, 180, 360)`, containing daily averaged (4992 days) contributions to the ionospheric potential (IP) for every cell of a 1°×1° latitude-longitude grid (180×360) for every third day. The grid cell contributions are calculated with the Weather Research and Forecasting model (WRF) version 4.3.
* `DAILY-CAPE-MAP-V4.3.npy`. This is a `numpy` array with the shape `(4992, 180, 360)`, containing daily averaged (4992 days) maximum CAPE values along the vertical axis for every cell of a 1°×1° latitude-longitude grid (180×360) for every third day. CAPE are calculated with the Weather Research and Forecasting model (WRF) version 4.3.
* `vostok_hourly <...>.txt` text files contain two columns, one of which represents the date and time (column `Datetime`) and the other, hourly averaged potential gradient (PG) values on the basis of the measurements at the Russian Antarctic station Vostok (column `Field`, the units are V/m). * `vostok_hourly <...>.txt` text files contain two columns, one of which represents the date and time (column `Datetime`) and the other, hourly averaged potential gradient (PG) values on the basis of the measurements at the Russian Antarctic station Vostok (column `Field`, the units are V/m).
* `sunspot_number_data.csv` contains information about the total sunspot number for every day of the years 1818--2022. You can download this file [here](https://www.sidc.be/silso/datafiles). * `sunspot_number_data.csv` contains information about the total sunspot number for every day of the years 1818--2022. You can download this file [here](https://www.sidc.be/silso/datafiles).
<!-- You can also download a pure Python version of the code without using the Jupyter notebook ([click here to download a zip-archive](https://git260.ipfran.ru/eee/mjo-gec-2022/archive/pure_python.zip)). With `Git 1.7.10` or later you can also clone a specific branch: --> <!-- You can also download a pure Python version of the code without using the Jupyter notebook ([click here to download a zip-archive](https://git260.ipfran.ru/eee/mjo-gec-2022/archive/pure_python.zip)). With `Git 1.7.10` or later you can also clone a specific branch: -->

75
eof_analysis.ipynb

@ -21,7 +21,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 1,
"id": "2c35172b", "id": "2c35172b",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -47,20 +47,30 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 2,
"id": "0430e90a-ead2-4744-ad9b-d4d67d6d2784",
"metadata": {},
"outputs": [],
"source": [
"path = './data'"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "f35c74b8", "id": "f35c74b8",
"metadata": { "metadata": {
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"map_contrib = np.load('./data/DAILY-IP-MAP-V4.3.npy')\n", "map_contrib = np.load('%s/DAILY-IP-MAP-V4.3.npy'%path)\n",
"# original data with the shape (number of days, number of latitudes, number of longitudes)\n", "# original data with the shape (number of days, number of latitudes, number of longitudes)\n",
"# contains IP values (not normalised) depending on (d, lat, lon)\n", "# contains IP values (not normalised) depending on (d, lat, lon)\n",
"# d (axis 0) is the number of a day starting with 0 and ending with 4991\n", "# d (axis 0) is the number of a day starting with 0 and ending with 4991\n",
"# every third day is taken, 0 corresponds to 1 Jan 1980 and 4991 corresponds to 29 Dec 2020\n", "# every third day is taken, 0 corresponds to 1 Jan 1980 and 4991 corresponds to 29 Dec 2020\n",
"# lat (axis 1) describes the latitude (an integer in [0, 180])\n", "# lat (axis 1) describes the latitude (an integer in [0, 179])\n",
"# lon (axis 2) describes the longitude (an integer in [0, 360])\n", "# lon (axis 2) describes the longitude (an integer in [0, 359])\n",
"\n", "\n",
"map_contrib /= np.mean(np.sum(map_contrib, axis=(1, 2)))\n", "map_contrib /= np.mean(np.sum(map_contrib, axis=(1, 2)))\n",
"map_contrib *= 240e3\n", "map_contrib *= 240e3\n",
@ -68,7 +78,7 @@
"\n", "\n",
"ip = np.sum(map_contrib, axis=(1, 2)) # total IP values for different days\n", "ip = np.sum(map_contrib, axis=(1, 2)) # total IP values for different days\n",
"\n", "\n",
"rmm = np.genfromtxt('./data/rmm.txt')\n", "rmm = np.genfromtxt('%s/rmm.txt'%path)\n",
"rmm = rmm[::3, [3, 4]] # RMM1 and RMM2\n", "rmm = rmm[::3, [3, 4]] # RMM1 and RMM2\n",
"# the array should look like the IP data (with every third day taken)\n", "# the array should look like the IP data (with every third day taken)\n",
"angle_rmm = np.arctan2(rmm[:, 1], rmm[:, 0]) # phase angles of RMM values\n", "angle_rmm = np.arctan2(rmm[:, 1], rmm[:, 0]) # phase angles of RMM values\n",
@ -95,7 +105,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": 4,
"id": "a39d5c0a", "id": "a39d5c0a",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@ -115,7 +125,7 @@
" :return: the same array with ENSO variability removed\n", " :return: the same array with ENSO variability removed\n",
" \"\"\"\n", " \"\"\"\n",
"\n", "\n",
" enso34 = np.load('./data/DAILY-ENSO34.npy') # mean SST values in the Niño 3.4 region\n", " enso34 = np.load('%s/DAILY-ENSO34.npy'%path) # mean SST values in the Niño 3.4 region\n",
" assert len(enso34) == a.shape[0]\n", " assert len(enso34) == a.shape[0]\n",
" a_mean_before = np.mean(a, axis=0) # mean values over days before the procedure\n", " a_mean_before = np.mean(a, axis=0) # mean values over days before the procedure\n",
"\n", "\n",
@ -129,6 +139,7 @@
"\n", "\n",
" return a\n", " return a\n",
"\n", "\n",
"\n",
"def remove_seasonal(a):\n", "def remove_seasonal(a):\n",
" \"\"\"\n", " \"\"\"\n",
" Remove the seasonal variability.\n", " Remove the seasonal variability.\n",
@ -152,6 +163,7 @@
"\n", "\n",
" return a\n", " return a\n",
"\n", "\n",
"\n",
"latitude = 15 # the boundary latitude for tropics\n", "latitude = 15 # the boundary latitude for tropics\n",
"\n", "\n",
"assert map_contrib.shape[1] == 180 # the next formula assumes this\n", "assert map_contrib.shape[1] == 180 # the next formula assumes this\n",
@ -179,7 +191,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 5,
"id": "4f117151", "id": "4f117151",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -206,12 +218,13 @@
"\n", "\n",
" return eofs, expvars, pcs\n", " return eofs, expvars, pcs\n",
"\n", "\n",
"\n",
"eofs, expvars, pcs = eof_analysis(map_contrib)" "eofs, expvars, pcs = eof_analysis(map_contrib)"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 6,
"id": "47859ce3-8f1d-4cf2-b3aa-d57946eabb44", "id": "47859ce3-8f1d-4cf2-b3aa-d57946eabb44",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -237,7 +250,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 7,
"id": "79db66cc", "id": "79db66cc",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -291,7 +304,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": 8,
"id": "8b3c241c-d9f4-4502-af62-6ad67a8ccdb6", "id": "8b3c241c-d9f4-4502-af62-6ad67a8ccdb6",
"metadata": { "metadata": {
"tags": [] "tags": []
@ -383,13 +396,13 @@
"\n", "\n",
"ax[1, 0].plot(np.arange(0, 361), np.append(eofs[:, 0], eofs[0, 0]),\n", "ax[1, 0].plot(np.arange(0, 361), np.append(eofs[:, 0], eofs[0, 0]),\n",
" linewidth=1.5, color='orangered', clip_on=False,\n", " linewidth=1.5, color='orangered', clip_on=False,\n",
" zorder = 6, label=f'EOF1 ({expvars[0]:.2%})')\n", " zorder=6, label=f'EOF1 ({expvars[0]:.2%})')\n",
"ax[1, 0].plot(np.arange(0, 361), np.append(eofs[:, 1], eofs[0, 1]),\n", "ax[1, 0].plot(np.arange(0, 361), np.append(eofs[:, 1], eofs[0, 1]),\n",
" linewidth=1.5, color='olive', clip_on=False,\n", " linewidth=1.5, color='olive', clip_on=False,\n",
" zorder = 5, label=f'EOF2 ({expvars[1]:.2%})')\n", " zorder=5, label=f'EOF2 ({expvars[1]:.2%})')\n",
"ax[1, 0].plot(np.arange(0, 361), np.append(eofs[:, 2], eofs[0, 2]),\n", "ax[1, 0].plot(np.arange(0, 361), np.append(eofs[:, 2], eofs[0, 2]),\n",
" linewidth=1.5, color='mediumvioletred', clip_on=False,\n", " linewidth=1.5, color='mediumvioletred', clip_on=False,\n",
" zorder = 4, label=f'EOF3 ({expvars[2]:.2%})')\n", " zorder=4, label=f'EOF3 ({expvars[2]:.2%})')\n",
"\n", "\n",
"ax[2, 0].bar(np.arange(1, 9) - 0.3, phase_avg_pc[:, 0] / 1e3,\n", "ax[2, 0].bar(np.arange(1, 9) - 0.3, phase_avg_pc[:, 0] / 1e3,\n",
" width=0.3, color='orangered', label='PC1')\n", " width=0.3, color='orangered', label='PC1')\n",
@ -408,13 +421,13 @@
"\n", "\n",
"ax[1, 1].plot(np.arange(0, 361), np.append(reofs[:, 0], reofs[0, 0]),\n", "ax[1, 1].plot(np.arange(0, 361), np.append(reofs[:, 0], reofs[0, 0]),\n",
" linewidth=1.5, color='orangered', clip_on=False,\n", " linewidth=1.5, color='orangered', clip_on=False,\n",
" zorder = 6, label=f'EOF1 ({rexpvars[0]:.2%})')\n", " zorder=6, label=f'EOF1 ({rexpvars[0]:.2%})')\n",
"ax[1, 1].plot(np.arange(0, 361), np.append(reofs[:, 1], reofs[0, 1]),\n", "ax[1, 1].plot(np.arange(0, 361), np.append(reofs[:, 1], reofs[0, 1]),\n",
" linewidth=1.5, color='teal', clip_on=False,\n", " linewidth=1.5, color='teal', clip_on=False,\n",
" zorder = 5, label=f'EOF2′ ({rexpvars[1]:.2%})')\n", " zorder=5, label=f'EOF2′ ({rexpvars[1]:.2%})')\n",
"ax[1, 1].plot(np.arange(0, 361), np.append(reofs[:, 2], reofs[0, 2]),\n", "ax[1, 1].plot(np.arange(0, 361), np.append(reofs[:, 2], reofs[0, 2]),\n",
" linewidth=1.5, color='darkgoldenrod', clip_on=False,\n", " linewidth=1.5, color='darkgoldenrod', clip_on=False,\n",
" zorder = 4, label=f'EOF3′ ({rexpvars[2]:.2%})')\n", " zorder=4, label=f'EOF3′ ({rexpvars[2]:.2%})')\n",
"\n", "\n",
"ax[2, 1].bar(np.arange(1, 9) - 0.3, phase_avg_rpc[:, 0] / 1e3,\n", "ax[2, 1].bar(np.arange(1, 9) - 0.3, phase_avg_rpc[:, 0] / 1e3,\n",
" width=0.3, color='orangered', label='PC1')\n", " width=0.3, color='orangered', label='PC1')\n",
@ -448,7 +461,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 9,
"id": "8f4ae8f9", "id": "8f4ae8f9",
"metadata": { "metadata": {
"tags": [] "tags": []
@ -522,7 +535,7 @@
"for j in range(2):\n", "for j in range(2):\n",
" leg = ax[j].legend(bbox_to_anchor=(0., -0.45, 1., 0.2),\n", " leg = ax[j].legend(bbox_to_anchor=(0., -0.45, 1., 0.2),\n",
" loc='upper center', borderaxespad=0.,\n", " loc='upper center', borderaxespad=0.,\n",
" mode = 'expand', fontsize='large',\n", " mode='expand', fontsize='large',\n",
" framealpha=1, edgecolor='0.', handlelength=1.5)\n", " framealpha=1, edgecolor='0.', handlelength=1.5)\n",
" leg.get_frame().set_linewidth(0.5)\n", " leg.get_frame().set_linewidth(0.5)\n",
"\n", "\n",
@ -541,7 +554,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 10,
"id": "36cb8cd3", "id": "36cb8cd3",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@ -567,7 +580,7 @@
" for axis in ['top', 'bottom', 'left', 'right']:\n", " for axis in ['top', 'bottom', 'left', 'right']:\n",
" ax[i, j].spines[axis].set_linewidth(0.5)\n", " ax[i, j].spines[axis].set_linewidth(0.5)\n",
" ax[i, j].tick_params(length=6, width=0.5)\n", " ax[i, j].tick_params(length=6, width=0.5)\n",
" \n", "\n",
" ax[i, j].set_xlim(0, 360)\n", " ax[i, j].set_xlim(0, 360)\n",
" ax[i, j].set_xticks(np.arange(0, 361, 60))\n", " ax[i, j].set_xticks(np.arange(0, 361, 60))\n",
"\n", "\n",
@ -596,7 +609,7 @@
" fontsize='large', ha='center')\n", " fontsize='large', ha='center')\n",
" else:\n", " else:\n",
" ax[i, j].set_yticklabels([])\n", " ax[i, j].set_yticklabels([])\n",
" \n", "\n",
" ax[i, j].grid(color='0.8', linewidth=0.5)\n", " ax[i, j].grid(color='0.8', linewidth=0.5)\n",
" ax[i, j].axhline(color='0.', linewidth=0.5)\n", " ax[i, j].axhline(color='0.', linewidth=0.5)\n",
"\n", "\n",
@ -606,18 +619,18 @@
"\n", "\n",
" ys = np.sum(phase_avg_comp[i, :, :], axis=1)\n", " ys = np.sum(phase_avg_comp[i, :, :], axis=1)\n",
" ax[i, 0].plot(np.arange(0, 361), np.append(ys, ys[0]), linewidth=1.5,\n", " ax[i, 0].plot(np.arange(0, 361), np.append(ys, ys[0]), linewidth=1.5,\n",
" color='royalblue', clip_on=False, zorder = 4)\n", " color='royalblue', clip_on=False, zorder=4)\n",
"\n", "\n",
" ys = np.sum(phase_avg_rcomp[i, :, :2], axis=1)\n", " ys = np.sum(phase_avg_rcomp[i, :, :2], axis=1)\n",
" ax[i, 1].plot(np.arange(0, 361), np.append(ys, ys[0]), linewidth=1.5,\n", " ax[i, 1].plot(np.arange(0, 361), np.append(ys, ys[0]), linewidth=1.5,\n",
" color='darkgreen', clip_on=False, zorder = 4)\n", " color='darkgreen', clip_on=False, zorder=4)\n",
"\n", "\n",
" ys = phase_avg_rcomp[i, :, 0]\n", " ys = phase_avg_rcomp[i, :, 0]\n",
" ax[i, 2].plot(np.arange(0, 361), np.append(ys, ys[0]), linewidth=1.5,\n", " ax[i, 2].plot(np.arange(0, 361), np.append(ys, ys[0]), linewidth=1.5,\n",
" color='orangered', clip_on=False, zorder = 5)\n", " color='orangered', clip_on=False, zorder=5)\n",
" ys = phase_avg_rcomp[i, :, 1]\n", " ys = phase_avg_rcomp[i, :, 1]\n",
" ax[i, 2].plot(np.arange(0, 361), np.append(ys, ys[0]), linewidth=1.5,\n", " ax[i, 2].plot(np.arange(0, 361), np.append(ys, ys[0]), linewidth=1.5,\n",
" color='teal', clip_on=False, zorder = 4)\n", " color='teal', clip_on=False, zorder=4)\n",
"\n", "\n",
"box1 = TextArea('Total (all EOFs and PCs)',\n", "box1 = TextArea('Total (all EOFs and PCs)',\n",
" textprops=dict(color='royalblue', fontsize='large'))\n", " textprops=dict(color='royalblue', fontsize='large'))\n",
@ -653,6 +666,14 @@
"fig.savefig('figures/longitudinal_structure.eps', bbox_inches='tight')\n", "fig.savefig('figures/longitudinal_structure.eps', bbox_inches='tight')\n",
"fig.savefig('figures/longitudinal_structure.png', dpi=300, bbox_inches='tight')" "fig.savefig('figures/longitudinal_structure.png', dpi=300, bbox_inches='tight')"
] ]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4af362e7",
"metadata": {},
"outputs": [],
"source": []
} }
], ],
"metadata": { "metadata": {

2
figures/eofs_and_pcs.eps

@ -1,7 +1,7 @@
%!PS-Adobe-3.0 EPSF-3.0 %!PS-Adobe-3.0 EPSF-3.0
%%Title: eofs_and_pcs.eps %%Title: eofs_and_pcs.eps
%%Creator: Matplotlib v3.5.1, https://matplotlib.org/ %%Creator: Matplotlib v3.5.1, https://matplotlib.org/
%%CreationDate: Fri Sep 2 14:19:13 2022 %%CreationDate: Mon Nov 14 00:52:07 2022
%%Orientation: portrait %%Orientation: portrait
%%BoundingBox: -19 33 632 759 %%BoundingBox: -19 33 632 759
%%HiResBoundingBox: -19.310156 33.199984 631.310156 758.800016 %%HiResBoundingBox: -19.310156 33.199984 631.310156 758.800016

2
figures/equatorial_variation.eps

@ -1,7 +1,7 @@
%!PS-Adobe-3.0 EPSF-3.0 %!PS-Adobe-3.0 EPSF-3.0
%%Title: equatorial_variation.eps %%Title: equatorial_variation.eps
%%Creator: Matplotlib v3.5.1, https://matplotlib.org/ %%Creator: Matplotlib v3.5.1, https://matplotlib.org/
%%CreationDate: Fri Sep 2 14:19:15 2022 %%CreationDate: Mon Nov 14 00:52:09 2022
%%Orientation: portrait %%Orientation: portrait
%%BoundingBox: -17 238 630 554 %%BoundingBox: -17 238 630 554
%%HiResBoundingBox: -17.400000 238.932563 629.400000 553.067437 %%HiResBoundingBox: -17.400000 238.932563 629.400000 553.067437

3093
figures/ip_pg_rmm_variation.eps

File diff suppressed because it is too large Load Diff

BIN
figures/ip_pg_rmm_variation.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 KiB

After

Width:  |  Height:  |  Size: 237 KiB

2
figures/ip_pg_variation_partial.eps

@ -1,7 +1,7 @@
%!PS-Adobe-3.0 EPSF-3.0 %!PS-Adobe-3.0 EPSF-3.0
%%Title: ip_pg_variation_partial.eps %%Title: ip_pg_variation_partial.eps
%%Creator: Matplotlib v3.5.1, https://matplotlib.org/ %%Creator: Matplotlib v3.5.1, https://matplotlib.org/
%%CreationDate: Fri Sep 2 14:21:20 2022 %%CreationDate: Mon Nov 14 01:38:19 2022
%%Orientation: portrait %%Orientation: portrait
%%BoundingBox: -11 74 624 718 %%BoundingBox: -11 74 624 718
%%HiResBoundingBox: -11.200000 74.184563 623.200000 717.815437 %%HiResBoundingBox: -11.200000 74.184563 623.200000 717.815437

2
figures/longitudinal_structure.eps

@ -1,7 +1,7 @@
%!PS-Adobe-3.0 EPSF-3.0 %!PS-Adobe-3.0 EPSF-3.0
%%Title: longitudinal_structure.eps %%Title: longitudinal_structure.eps
%%Creator: Matplotlib v3.5.1, https://matplotlib.org/ %%Creator: Matplotlib v3.5.1, https://matplotlib.org/
%%CreationDate: Fri Sep 2 14:19:16 2022 %%CreationDate: Mon Nov 14 00:52:11 2022
%%Orientation: portrait %%Orientation: portrait
%%BoundingBox: -15 26 628 766 %%BoundingBox: -15 26 628 766
%%HiResBoundingBox: -15.621875 26.357913 627.621875 765.642087 %%HiResBoundingBox: -15.621875 26.357913 627.621875 765.642087

842
figures/map_of_contributions.eps

File diff suppressed because it is too large Load Diff

3866
figures/olr_sn_cape_variation.eps

File diff suppressed because it is too large Load Diff

BIN
figures/olr_sn_cape_variation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

2
figures/rmm_diagram.eps

@ -1,7 +1,7 @@
%!PS-Adobe-3.0 EPSF-3.0 %!PS-Adobe-3.0 EPSF-3.0
%%Title: rmm_diagram.eps %%Title: rmm_diagram.eps
%%Creator: Matplotlib v3.5.1, https://matplotlib.org/ %%Creator: Matplotlib v3.5.1, https://matplotlib.org/
%%CreationDate: Fri Sep 2 14:21:16 2022 %%CreationDate: Mon Nov 14 01:38:16 2022
%%Orientation: portrait %%Orientation: portrait
%%BoundingBox: 141 233 471 559 %%BoundingBox: 141 233 471 559
%%HiResBoundingBox: 141.380469 233.603125 470.619531 558.396875 %%HiResBoundingBox: 141.380469 233.603125 470.619531 558.396875

30
map_of_contributions.ipynb

@ -54,17 +54,27 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 2,
"id": "02837325-92a2-471e-a2c4-20a0e78b38d8",
"metadata": {},
"outputs": [],
"source": [
"path = './data'"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "56b259ed", "id": "56b259ed",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"map_contrib = np.load('./data/DAILY-IP-MAP-V4.3.npy')\n", "map_contrib = np.load('%s/DAILY-IP-MAP-V4.3.npy'%path)\n",
"# original data with the shape (number of days, number of latitudes, number of longitudes)\n", "# original data with the shape (number of days, number of latitudes, number of longitudes)\n",
"# contains IP values (not normalised) depending on (d, lat, lon)\n", "# contains IP values (not normalised) depending on (d, lat, lon)\n",
"# d (axis 0) is the number of a day starting with 0 and ending with 4991\n", "# d (axis 0) is the number of a day starting with 0 and ending with 4991\n",
"# every third day is taken, 0 corresponds to 1 Jan 1980 and 4991 corresponds to 29 Dec 2020\n", "# every third day is taken, 0 corresponds to 1 Jan 1980 and 4991 corresponds to 29 Dec 2020\n",
"# lat (axis 1) describes the latitude (an integer in [0, 180])\n", "# lat (axis 1) describes the latitude (an integer in [0, 179])\n",
"# lon (axis 2) describes the longitude (an integer in [0, 360])\n", "# lon (axis 2) describes the longitude (an integer in [0, 359])\n",
"\n", "\n",
"map_contrib /= np.mean(np.sum(map_contrib, axis=(1, 2)))\n", "map_contrib /= np.mean(np.sum(map_contrib, axis=(1, 2)))\n",
"map_contrib *= 240e3\n", "map_contrib *= 240e3\n",
@ -72,7 +82,7 @@
"\n", "\n",
"avg_map_contrib = np.mean(map_contrib, axis=0) # long-term means of contributions\n", "avg_map_contrib = np.mean(map_contrib, axis=0) # long-term means of contributions\n",
"\n", "\n",
"rmm = np.genfromtxt('./data/rmm.txt')\n", "rmm = np.genfromtxt('%s/rmm.txt'%path)\n",
"rmm = rmm[::3, [3, 4]] # RMM1 and RMM2\n", "rmm = rmm[::3, [3, 4]] # RMM1 and RMM2\n",
"# the array should look like the IP data (with every third day taken)\n", "# the array should look like the IP data (with every third day taken)\n",
"angle_rmm = np.arctan2(rmm[:, 1], rmm[:, 0]) # phase angles of RMM values\n", "angle_rmm = np.arctan2(rmm[:, 1], rmm[:, 0]) # phase angles of RMM values\n",
@ -105,7 +115,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 4,
"id": "b2a2b2a9", "id": "b2a2b2a9",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@ -132,7 +142,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 5,
"id": "87d48691", "id": "87d48691",
"metadata": { "metadata": {
"tags": [] "tags": []
@ -218,6 +228,14 @@
"fig.savefig('figures/map_of_contributions.png', dpi=300, bbox_inches='tight')\n", "fig.savefig('figures/map_of_contributions.png', dpi=300, bbox_inches='tight')\n",
"fig.savefig('figures/map_of_contributions.eps', bbox_inches='tight')" "fig.savefig('figures/map_of_contributions.eps', bbox_inches='tight')"
] ]
},
{
"cell_type": "code",
"execution_count": null,
"id": "560b26b1-7abd-4145-9126-f49bfb33b456",
"metadata": {},
"outputs": [],
"source": []
} }
], ],
"metadata": { "metadata": {

323
variations_ip_pg_rmm_with_mjo_phase.ipynb

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save