From 186471201533d9e45aa6318d8244468734e4ea68 Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 13 Nov 2022 19:21:08 -0700 Subject: [PATCH] running find_RAWS_statio, saving with outputsn --- jh-dev/find_RAWS_station.ipynb | 135 ++++++++++++++++++--- ...ation.ipynb => find_RAWS_station_outputs.ipynb} | 135 ++++++++++++++++++--- jh-dev/station_df_co.csv | 2 +- 3 files changed, 243 insertions(+), 29 deletions(-) copy jh-dev/{find_RAWS_station.ipynb => find_RAWS_station_outputs.ipynb} (58%) diff --git a/jh-dev/find_RAWS_station.ipynb b/jh-dev/find_RAWS_station.ipynb index 4d1b411..c848cb6 100644 --- a/jh-dev/find_RAWS_station.ipynb +++ b/jh-dev/find_RAWS_station.ipynb @@ -12,15 +12,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "edb47918-af48-4002-8a66-7e78c7d10c77", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: MesoPy in /Users/jmandel/miniconda3/lib/python3.9/site-packages (2.0.3)\r\n" + ] + } + ], "source": [ - "# !pip install MesoPy\n", + "!pip install MesoPy\n", "from MesoPy import Meso\n", "\n", - "outpath = \"C:/Users/jhirs/Documents/Projects/openwfm/notebooks/jh-dev\"\n", + "outpath = \".\"\n", "\n", "# bounding_box = \"-115, 38, -110, 40\"\n", "meso_token=\"4192c18707b848299783d59a9317c6e1\"\n", @@ -29,7 +37,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "37683794-406d-4524-99d3-2c167ff444ea", "metadata": {}, "outputs": [], @@ -43,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "7dfb0387-6535-4976-9e9a-62e3cf9a69cd", "metadata": {}, "outputs": [], @@ -54,7 +62,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "2255f323-2685-47b1-b862-f86eca6a3991", "metadata": {}, "outputs": [], @@ -68,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "6f4fbe0d-dd16-4c1c-950e-97e23e5a1918", "metadata": {}, "outputs": [], @@ -83,17 +91,104 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "de8ec8c9-4af7-4bdc-9dbc-1b361d011654", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
STIDair_temprelative_humidityprecip_accumfuel_moisture
123CPTC21111
124CHAC21111
125CHRC21111
144LKGC21111
149CCEC21111
\n", + "
" + ], + "text/plain": [ + " STID air_temp relative_humidity precip_accum fuel_moisture\n", + "123 CPTC2 1 1 1 1\n", + "124 CHAC2 1 1 1 1\n", + "125 CHRC2 1 1 1 1\n", + "144 LKGC2 1 1 1 1\n", + "149 CCEC2 1 1 1 1" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "station_df[station_df[\"fuel_moisture\"]==1].head()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "99dde77e-5f6f-4e45-babf-f7599e8fca14", "metadata": {}, "outputs": [], @@ -114,10 +209,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "d45d76e5-ccb1-45b6-a187-25d0d1f91b8e", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'lon' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Input \u001b[0;32mIn [8]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m e \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0.01\u001b[39m \u001b[38;5;66;03m# tolerance\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m bb \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m, \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m, \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m, \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m%\u001b[39m (\u001b[43mlon\u001b[49m \u001b[38;5;241m-\u001b[39m e, lat \u001b[38;5;241m-\u001b[39m e, lon \u001b[38;5;241m+\u001b[39m e, lat \u001b[38;5;241m+\u001b[39m e)\n\u001b[1;32m 3\u001b[0m meso_ts \u001b[38;5;241m=\u001b[39m m\u001b[38;5;241m.\u001b[39mtimeseries(time_start, time_end, stid\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCPTC2\u001b[39m\u001b[38;5;124m\"\u001b[39m, showemptystations \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m0\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;28mvars\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mvars\u001b[39m)\n", + "\u001b[0;31mNameError\u001b[0m: name 'lon' is not defined" + ] + } + ], "source": [ "e = 0.01 # tolerance\n", "bb = '%s, %s, %s, %s' % (lon - e, lat - e, lon + e, lat + e)\n", @@ -239,7 +346,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.9.13" } }, "nbformat": 4, diff --git a/jh-dev/find_RAWS_station.ipynb b/jh-dev/find_RAWS_station_outputs.ipynb similarity index 58% copy from jh-dev/find_RAWS_station.ipynb copy to jh-dev/find_RAWS_station_outputs.ipynb index 4d1b411..c848cb6 100644 --- a/jh-dev/find_RAWS_station.ipynb +++ b/jh-dev/find_RAWS_station_outputs.ipynb @@ -12,15 +12,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "edb47918-af48-4002-8a66-7e78c7d10c77", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: MesoPy in /Users/jmandel/miniconda3/lib/python3.9/site-packages (2.0.3)\r\n" + ] + } + ], "source": [ - "# !pip install MesoPy\n", + "!pip install MesoPy\n", "from MesoPy import Meso\n", "\n", - "outpath = \"C:/Users/jhirs/Documents/Projects/openwfm/notebooks/jh-dev\"\n", + "outpath = \".\"\n", "\n", "# bounding_box = \"-115, 38, -110, 40\"\n", "meso_token=\"4192c18707b848299783d59a9317c6e1\"\n", @@ -29,7 +37,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "37683794-406d-4524-99d3-2c167ff444ea", "metadata": {}, "outputs": [], @@ -43,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "7dfb0387-6535-4976-9e9a-62e3cf9a69cd", "metadata": {}, "outputs": [], @@ -54,7 +62,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "2255f323-2685-47b1-b862-f86eca6a3991", "metadata": {}, "outputs": [], @@ -68,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "6f4fbe0d-dd16-4c1c-950e-97e23e5a1918", "metadata": {}, "outputs": [], @@ -83,17 +91,104 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "de8ec8c9-4af7-4bdc-9dbc-1b361d011654", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
STIDair_temprelative_humidityprecip_accumfuel_moisture
123CPTC21111
124CHAC21111
125CHRC21111
144LKGC21111
149CCEC21111
\n", + "
" + ], + "text/plain": [ + " STID air_temp relative_humidity precip_accum fuel_moisture\n", + "123 CPTC2 1 1 1 1\n", + "124 CHAC2 1 1 1 1\n", + "125 CHRC2 1 1 1 1\n", + "144 LKGC2 1 1 1 1\n", + "149 CCEC2 1 1 1 1" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "station_df[station_df[\"fuel_moisture\"]==1].head()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "99dde77e-5f6f-4e45-babf-f7599e8fca14", "metadata": {}, "outputs": [], @@ -114,10 +209,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "d45d76e5-ccb1-45b6-a187-25d0d1f91b8e", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'lon' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Input \u001b[0;32mIn [8]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m e \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0.01\u001b[39m \u001b[38;5;66;03m# tolerance\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m bb \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m, \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m, \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m, \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m%\u001b[39m (\u001b[43mlon\u001b[49m \u001b[38;5;241m-\u001b[39m e, lat \u001b[38;5;241m-\u001b[39m e, lon \u001b[38;5;241m+\u001b[39m e, lat \u001b[38;5;241m+\u001b[39m e)\n\u001b[1;32m 3\u001b[0m meso_ts \u001b[38;5;241m=\u001b[39m m\u001b[38;5;241m.\u001b[39mtimeseries(time_start, time_end, stid\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCPTC2\u001b[39m\u001b[38;5;124m\"\u001b[39m, showemptystations \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m0\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;28mvars\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mvars\u001b[39m)\n", + "\u001b[0;31mNameError\u001b[0m: name 'lon' is not defined" + ] + } + ], "source": [ "e = 0.01 # tolerance\n", "bb = '%s, %s, %s, %s' % (lon - e, lat - e, lon + e, lat + e)\n", @@ -239,7 +346,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.9.13" } }, "nbformat": 4, diff --git a/jh-dev/station_df_co.csv b/jh-dev/station_df_co.csv index 5d4f1b2..dfcbe49 100644 --- a/jh-dev/station_df_co.csv +++ b/jh-dev/station_df_co.csv @@ -217,7 +217,6 @@ LEWC2,1,1,0,0 CALC2,1,1,0,0 BTRC2,1,1,0,0 CALVP,1,1,0,0 -TR390,1,1,1,1 CAEGE,1,1,0,0 CABTP,1,1,0,0 CCDC2,1,1,1,1 @@ -364,6 +363,7 @@ C4498,1,1,0,0 C4784,1,1,0,0 TS578,1,1,1,1 AS062,1,0,0,0 +TS582,1,1,1,1 C5038,1,1,0,0 C5066,1,1,0,0 C5171,1,1,0,0 -- 2.11.4.GIT