<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Download data
Attributes of .nc files
Step1:  Choose map in background
See http
Step2:  Format data to fit map
Step3:  Draw contour on map
<ASSISTANT_TASK:>
Python Code:
# https://rabernat.github.io/research_computing_2018/xarray-tips-and-tricks.html
url = 'http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis/surface/air.sig995.2018.nc'
from netCDF4 import Dataset as NetCDFFile
nc = NetCDFFile(url)
nc
# Extract data from NetCDF file (will take a minute)
lats = nc.variables['lat'][:]
lons = nc.variables['lon'][:]
time = nc.variables['time'][:]
air  = nc.variables['air'][:]  # shape is time, lat, lon
# Convert time values to datetime objects
import datetime as dt
dt_time = [dt.date(1, 1, 1) + dt.timedelta(hours=t) for t in time]
Explanation: Download data
Attributes of .nc files: http://earthpy.org/04_work_with_different_data_formats.html#Open-netCDF-files
End of explanation
# Setup the map
m = Basemap(projection='moll', llcrnrlat=-90, urcrnrlat=90,\
            llcrnrlon=0, urcrnrlon=360, resolution='c', lon_0=0)
m.drawcoastlines()
m.drawmapboundary()
Explanation: Choose map in background
See http://matplotlib.org/basemap/users/mapsetup.html for other projections.
End of explanation
# Take a random day in the year
time_idx = 237
cur_time = dt_time[time_idx]
print(cur_time)
# Make the plot continuous
air_cyclic, lons_cyclic = addcyclic(air[time_idx, :, :], lons)
# Shift the grid so lons go from -180 to 180 instead of 0 to 360.
air_cyclic, lons_cyclic = shiftgrid(180., air_cyclic, lons_cyclic, start=False)
# Create 2D lat/lon arrays for Basemap
lon2d, lat2d = np.meshgrid(lons_cyclic, lats)
# Transforms lat/lon into plotting coordinates for projection
x, y = m(lon2d, lat2d)
Explanation: Format data to fit map
End of explanation
m.drawcoastlines()
m.drawmapboundary()
m.contourf(x, y, air_cyclic, 11, cmap=plt.cm.Spectral_r)
plt.title("Air temperature on %s" % cur_time)
plt.show()
Explanation: Draw contour on map
End of explanation
<END_TASK>