<jupyter_start><jupyter_text>Plot the Sierra Nevada region and Upper Colorado regionThis code prepares a spatial map of two large watersheds considered in this study.<jupyter_code># Libraries
import numpy as np
import pandas as pd
import geopandas as gp


import matplotlib.pyplot as plt

from matplotlib.patches import Polygon
from matplotlib.lines import Line2D
from mpl_toolkits.basemap import Basemap

%matplotlib inline
# Directory
idir_shp = 'D:/Project_soil_moisture/00_SM_project/05_shape/'
ax = gp.read_file(idir_shp + "Sierra_UCol.shp").plot(figsize = (10,5), facecolor = 'none', linewidth =2.)
gdf = gp.read_file(idir_shp + "Sierra_reg_d.shp")

# # read the location shapefile
gdf.crs = {'init': 'epsg:4326'}

# 1. Draw the map background
fig = plt.figure(figsize=(10, 14))

m = Basemap(projection='lcc', resolution='h', #lcc
            lat_0=40.0, lon_0=-114.5,
            width=2.0E6, height=1.3E6)


# Add stuff to basemap 
m.shadedrelief(zorder = 0)
m.drawcoastlines(color='gray')
m.drawcountries(color='gray')
m.drawstates(color='gray')
m.drawrivers(color = "skyblue")
# m.fillcontinents(color='none',lake_color='blue')

# Draw lines of latitude and longitude. Labels are like [left,right,top,bottom]
parallels = np.arange(0.,90.,2.)
meridians = np.arange(0.,360.,4.)

m.drawparallels(parallels,labels=[True,False,True,False]) # [left,right,top,bottom]
m.drawmeridians(meridians,labels=[True,False,False,True]) # [left,right,top,bottom]

m.readshapefile((idir_shp + "Sierra_reg_d"),'Sierra Nevada Region', drawbounds=True, linewidth=1, color='r')
m.readshapefile((idir_shp + "UCol_reg"),'Upper Colorado Region', drawbounds=True, linewidth=1, color='b')


# Scalebar
m.drawmapscale(-106., 34.5,lon0=gdf.centroid.x[0], lat0=gdf.centroid.y[0], length = 300, fontsize = 14, linewidth = 2)

#====================================================
# Legend
#====================================================
# Make the first legend (upper right of map)
custom_lines = [Line2D([0], [0], color='red', lw=2),
                Line2D([0], [0], color='blue', lw=2)
               ]

plt.legend(custom_lines, ["Sierra Nevada Region", 'Upper Colorado Region'], 
                    loc = "upper right",
                    prop={'size':13})


plt.show()<jupyter_output>C:\Users\sarfa\Anaconda3\envs\gwatt\lib\site-packages\pyproj\crs\crs.py:131: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  in_crs_string = _prepare_from_proj_string(in_crs_string)
C:\Users\sarfa\Anaconda3\envs\gwatt\lib\site-packages\ipykernel_launcher.py:34: UserWarning: Geometry is in a geographic CRS. Results from 'centroid' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.

C:\Users\sarfa\Anaconda3\envs\gwatt\lib\site-packages\ipykernel_launcher.py:34: UserWarning: Geometry is in a geographic CRS. Results from 'centroid' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
{'fraction_non_alphanumeric': 0.16546987199500468, 'fraction_numerical': 0.025913206369029034, 'mean_word_length': 5.233463035019455, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '223771', 'license': 'Unlicense', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1111, 'n_words': 250, 'path': '02_code/060_Large_wat_map.ipynb', 'repo_name': 'szalam/SM_carryover', 'size': '3203'}