+{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.7.10","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"#!wget -rc -nH --cut-dirs=3 --ftp-user=anonymous ftp://data.eol.ucar.edu/pub/download/data/TIWAR299318/ \n#wget ftp://data.eol.ucar.edu/pub/download/data/TIWAR299318/ST4.2012060312.24h.Z\n#gunzip ST4.2012060312.24h.Z\n#https://data.eol.ucar.edu/dataset/21.093","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2021-11-21T05:06:54.407149Z","iopub.execute_input":"2021-11-21T05:06:54.407717Z","iopub.status.idle":"2021-11-21T05:06:54.411686Z","shell.execute_reply.started":"2021-11-21T05:06:54.407675Z","shell.execute_reply":"2021-11-21T05:06:54.410847Z"},"trusted":true},"execution_count":23,"outputs":[]},{"cell_type":"code","source":"#!tar -xvf ./TIWAR299318/katz_stageIV_readme.txt.gz","metadata":{"execution":{"iopub.status.busy":"2021-11-21T05:06:59.113714Z","iopub.execute_input":"2021-11-21T05:06:59.113999Z","iopub.status.idle":"2021-11-21T05:06:59.118026Z","shell.execute_reply.started":"2021-11-21T05:06:59.113970Z","shell.execute_reply":"2021-11-21T05:06:59.117217Z"},"trusted":true},"execution_count":24,"outputs":[]},{"cell_type":"code","source":"#!ls TIWAR299318","metadata":{"execution":{"iopub.status.busy":"2021-11-21T05:07:01.900991Z","iopub.execute_input":"2021-11-21T05:07:01.901584Z","iopub.status.idle":"2021-11-21T05:07:01.906315Z","shell.execute_reply.started":"2021-11-21T05:07:01.901531Z","shell.execute_reply":"2021-11-21T05:07:01.905406Z"},"trusted":true},"execution_count":25,"outputs":[]},{"cell_type":"code","source":"!conda install -y -c conda-forge pygrib","metadata":{"execution":{"iopub.status.busy":"2021-11-21T04:48:21.270875Z","iopub.execute_input":"2021-11-21T04:48:21.271649Z","iopub.status.idle":"2021-11-21T04:55:49.642119Z","shell.execute_reply.started":"2021-11-21T04:48:21.271604Z","shell.execute_reply":"2021-11-21T04:55:49.641059Z"},"trusted":true},"execution_count":8,"outputs":[]},{"cell_type":"code","source":"#from basemap import Basemap # import Basemap matplotlib toolkit\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pygrib # import pygrib interface to grib_api","metadata":{"execution":{"iopub.status.busy":"2021-11-21T06:00:21.588111Z","iopub.execute_input":"2021-11-21T06:00:21.589029Z","iopub.status.idle":"2021-11-21T06:00:21.593517Z","shell.execute_reply.started":"2021-11-21T06:00:21.588988Z","shell.execute_reply":"2021-11-21T06:00:21.592733Z"},"trusted":true},"execution_count":42,"outputs":[]},{"cell_type":"code","source":"grbs = pygrib.open('../input/st4-sample-file/ST4.2012060312.24h')","metadata":{"execution":{"iopub.status.busy":"2021-11-21T05:05:52.418689Z","iopub.execute_input":"2021-11-21T05:05:52.419422Z","iopub.status.idle":"2021-11-21T05:05:52.460057Z","shell.execute_reply.started":"2021-11-21T05:05:52.419372Z","shell.execute_reply":"2021-11-21T05:05:52.458874Z"},"trusted":true},"execution_count":21,"outputs":[]},{"cell_type":"code","source":"for grb in grbs:\n print(grb)","metadata":{"execution":{"iopub.status.busy":"2021-11-21T05:05:54.234728Z","iopub.execute_input":"2021-11-21T05:05:54.235602Z","iopub.status.idle":"2021-11-21T05:05:54.256260Z","shell.execute_reply.started":"2021-11-21T05:05:54.235541Z","shell.execute_reply":"2021-11-21T05:05:54.255187Z"},"trusted":true},"execution_count":22,"outputs":[]},{"cell_type":"code","source":"#https://nbviewer.org/gist/jswhit/8635665","metadata":{"execution":{"iopub.status.busy":"2021-11-21T05:07:12.414279Z","iopub.execute_input":"2021-11-21T05:07:12.414879Z","iopub.status.idle":"2021-11-21T05:07:12.418006Z","shell.execute_reply.started":"2021-11-21T05:07:12.414839Z","shell.execute_reply":"2021-11-21T05:07:12.417480Z"},"trusted":true},"execution_count":26,"outputs":[]},{"cell_type":"code","source":"grb.keys()","metadata":{"execution":{"iopub.status.busy":"2021-11-21T05:07:27.903175Z","iopub.execute_input":"2021-11-21T05:07:27.903503Z","iopub.status.idle":"2021-11-21T05:07:27.912766Z","shell.execute_reply.started":"2021-11-21T05:07:27.903469Z","shell.execute_reply":"2021-11-21T05:07:27.911773Z"},"trusted":true},"execution_count":28,"outputs":[]},{"cell_type":"code","source":"pr = np.array(grb.values)","metadata":{"execution":{"iopub.status.busy":"2021-11-21T05:08:28.403681Z","iopub.execute_input":"2021-11-21T05:08:28.404100Z","iopub.status.idle":"2021-11-21T05:08:28.431741Z","shell.execute_reply.started":"2021-11-21T05:08:28.404070Z","shell.execute_reply":"2021-11-21T05:08:28.430816Z"},"trusted":true},"execution_count":32,"outputs":[]},{"cell_type":"code","source":"lats, lons = grb.latlons() ","metadata":{"execution":{"iopub.status.busy":"2021-11-21T05:08:43.792329Z","iopub.execute_input":"2021-11-21T05:08:43.792634Z","iopub.status.idle":"2021-11-21T05:08:44.051593Z","shell.execute_reply.started":"2021-11-21T05:08:43.792604Z","shell.execute_reply":"2021-11-21T05:08:44.050629Z"},"trusted":true},"execution_count":33,"outputs":[]},{"cell_type":"code","source":"pr[pr==9999] = np.nan","metadata":{"execution":{"iopub.status.busy":"2021-11-21T06:01:56.119685Z","iopub.execute_input":"2021-11-21T06:01:56.120316Z","iopub.status.idle":"2021-11-21T06:01:56.129208Z","shell.execute_reply.started":"2021-11-21T06:01:56.120255Z","shell.execute_reply":"2021-11-21T06:01:56.128220Z"},"trusted":true},"execution_count":48,"outputs":[]},{"cell_type":"code","source":"plt.imshow(pr)","metadata":{"execution":{"iopub.status.busy":"2021-11-21T06:02:01.048556Z","iopub.execute_input":"2021-11-21T06:02:01.048831Z","iopub.status.idle":"2021-11-21T06:02:01.427619Z","shell.execute_reply.started":"2021-11-21T06:02:01.048803Z","shell.execute_reply":"2021-11-21T06:02:01.426651Z"},"trusted":true},"execution_count":49,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}
0 commit comments