In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to use cartopy library code to draw typhoon path in python". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use cartopy library code to draw typhoon path in python" can help you solve the problem.
Using python to draw Typhoon tracks based on cartopy Library
Use python to draw the typhoon path of the western Pacific into China, the file is in .dat format, the content is as follows:
The code is as follows:
Import netCDF4 as nc4import matplotlib.pyplot as pltimport numpy as npimport datetimeimport osimport cartopy.crs as ccrspath='E://' # File path files= os.listdir (path) # get all the file names under the folder fig=plt.figure (figsize= (20jue 12)) # set the canvas size parallels = np.arange (0.mem90.Magne3.) Meridians = np.arange (0.0360.1) Ax = plt.axes (projection=ccrs.Robinson ()) # set projection mode # Set figure extent & ticksax.set_extent ([100,150,5,50]) # set latitude range # plt.grid (linestyle=':',color='y') # for file in files: # read the data name of each file in files in order to read f = open (path+file) 'r') # Open the first dat file records = f.readlines () # read all the data in this file f.close () # close the dat file date_t ='# # set a space btk_lat = [] # set an empty Latitude btk_lon = [] # set an empty longitude btk_vmax = [] # maximum wind speed Maximum sustained wind speed in knots: 0-300 kts. Btk_time = [] # time btk_rmw = [] # maximum wind speed radius radius of max winds, 0-999 n mi. Btk_name = [] # Typhoon name for rcd in records: # Loop every line of data that has been read in this dat file strs = rcd.split (',') # separate each', 'from if (len (strs))
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.