Browse Source

Use new source of T2 data

FGeo 7 months ago
parent
commit
290cd77851
  1. 84
      0_prepare_data.ipynb
  2. 14
      3_WRF_T2_images.ipynb
  3. BIN
      data/WRF/WRF_T2_LATxMON.npy

84
0_prepare_data.ipynb

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 56,
"execution_count": 2,
"id": "7b2a7f44-b0cb-4471-a0c6-e56da23caf86",
"metadata": {},
"outputs": [],
@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "36b9f49e-32e6-4544-a9d3-f6a8ba49d867",
"metadata": {},
"outputs": [],
@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "78a4350c-59fb-479a-b7cd-e2bf9b996d36",
"metadata": {},
"outputs": [],
@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "53cb9cc3-0e56-4da4-920b-2f071a0846fb",
"metadata": {},
"outputs": [],
@ -89,32 +89,53 @@ @@ -89,32 +89,53 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "0e4d0268-208f-45c7-bb0a-b5e8d3c7c1f7",
"execution_count": 10,
"id": "87860fa8-0a9c-4304-9c3c-94561c3e966c",
"metadata": {},
"outputs": [],
"source": [
"# air temperature at the height of 2 m with the shape\n",
"# (number of days, number of latitudes, number of longitudes)\n",
"\n",
"# contains temperature values depending on (d, lat, lon)\n",
"\n",
"# d (axis 0) is the number of a day starting with 0 and ending with 5113\n",
"# every third day is taken\n",
"# d = 0 corresponds to 1 Jan 1980, d = 5113 corresponds to 30 Dec 2021\n",
"# d = 4991 corresponds to 29 Dec 2020\n",
"# (we will restrict our attention to 1980–2020)\n",
"\n",
"# lat (axis 2) describes the latitude (an integer in [0, 179])\n",
"\n",
"# (number of days, number of hours, number of latitudes, number of longitudes)\n",
"# contains temperature values depending on (d, h, lat, lon)\n",
"# d (axis 0) is the number of a day starting with 0 and ending with 5113\n",
"# every third day is taken\n",
"# d = 0 corresponds to 1 Jan 1980, \n",
"# d = 5113 corresponds to 30 Dec 2021\n",
"# d = 4991 corresponds to 29 Dec 2020\n",
"# (we will restrict our attention to 1980–2020)\n",
"# h (axis 1) is the hour of the day (an integer in [0, 24])\n",
"# the values corresponding to h = 0 and h = 24 are the same\n",
"# lat (axis 2) describes the latitude (an integer in [0, 179]) \n",
"# lon (axis 3) describes the longitude (an integer in [0, 359])\n",
"\n",
"wrf_T2_data = np.load(f\"{src_path}/T2-MAP-FULL.npy\")[:wrf_N_days]"
"wrf_T2_data = np.load(f\"{src_path}/WRF-T2-MAP.npy\")[:wrf_N_days]\n",
"wrf_T2_data_DAYxLAT = wrf_T2_data.mean(axis=(1, 3))"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"id": "1124d9f9-95d9-4c02-8176-82b9c0331d34",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(4992, 180)"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wrf_T2_data_DAYxLAT.shape"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "ec569ffd-93c2-4490-8ba1-69af4fab8f23",
"metadata": {},
"outputs": [],
@ -129,11 +150,32 @@ @@ -129,11 +150,32 @@
" ]\n",
"\n",
" # putting values at specific month into averaged array\n",
" wrf_mon_T2[:, month_idx] = wrf_mean_T2[monthly_indicies].mean(axis=0)\n",
" wrf_mon_T2[:, month_idx] = wrf_T2_data_DAYxLAT[monthly_indicies].mean(axis=0)-273.15\n",
"\n",
"np.save(f\"./data/WRF/WRF_T2_LATxMON.npy\",wrf_mon_T2)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "b480c05f-4b06-4d33-9527-dbe2655ed251",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"27.894258059212177"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wrf_mon_T2.max()"
]
},
{
"cell_type": "markdown",
"id": "46d4f093-a420-42c7-b885-a8409d9d8ee4",

14
3_WRF_T2_images.ipynb

File diff suppressed because one or more lines are too long

BIN
data/WRF/WRF_T2_LATxMON.npy

Binary file not shown.
Loading…
Cancel
Save