<jupyter_start><jupyter_text>SURFRAD and SOLRADThe SURFRAD and SOLRAD are two monitoring networks in the United States operated by the National Oceanic and Atmospheric Administration (NOAA).<jupyter_code>def convert_latitude_longitude(l):
    """Function to convert from latitude/longitude string
    to float with sign convention of ISO 19115"""
    l = l.replace(' ', '')  # Remove all spaces
    cardinal_signs = {'N': 1, 'S': -1, 'E': 1, 'W': -1}
    for c in cardinal_signs.keys():
        if c in l:
            return cardinal_signs[c]*float(l.replace(c, '').replace('°', ''))
surfrad_url = 'https://www.esrl.noaa.gov/gmd/grad/surfrad/sitepage.html'
surfrad_stations = pd.read_html(surfrad_url, index_col=0)[0].iloc[:-1]
surfrad_stations[['Latitude', 'Longitude']] = surfrad_stations[['Latitude', 'Longitude']].applymap(convert_latitude_longitude)
surfrad_stations
solrad_url = 'https://www.esrl.noaa.gov/gmd/grad/solrad/solradsites.html'
solrad_stations = pd.read_html(solrad_url, index_col=0)[0]
solrad_stations.loc['STE',['Name','Latitude','Longitude']] = ['Sterling, Virginia', '38.97203° N', '77.48690° W']
solrad_stations[['Latitude', 'Longitude']] = \
    solrad_stations[['Latitude', 'Longitude']].applymap(convert_latitude_longitude)
solrad_stations
### Initialize Folium map
m = folium.Map(
    location=[40, -95],
    zoom_start=4,
    min_zoom=2,
    max_bounds=True,
    tiles='OpenStreetMap',
)

# Add stations to the map
for i, stations in enumerate([surfrad_stations, solrad_stations]):
    for index, row in stations.iterrows():
        folium.Marker(
            location=[row['Latitude'], row['Longitude']],
            popup=f"{row['Name']} ({row.name})",
            icon=folium.Icon(color=['blue', 'red'][i])
            ).add_to(m)

# Add Category Legend
legend_html = """
<div style="position:fixed;
     bottom: 50px; 
     left: 50px; 
     width: 120px; 
     height: 105px; 
     border:2px solid grey; 
     z-index: 9999;
     font-size:14px;">
     &nbsp;<b>Station network:</b><br>
     &nbsp;<i class="fa fa-circle fa-1x" style="color:blue"></i>&nbsp;SURFRAD<br>
     &nbsp;<i class="fa fa-circle fa-1x" style="color:red"></i>&nbsp;SOLRAD<br>
     &nbsp;<i class="fa fa-circle fa-1x" style="color:orange"></i>&nbsp;SRML<br>
     &nbsp;<i class="fa fa-circle fa-1x" style="color:green"></i>&nbsp;NREL<br>
</div>"""

m.get_root().html.add_child(folium.Element(legend_html))  # Add Legend

m.add_child(folium.LatLngPopup())  # Show latitude,longitude when clicking
m  # Show map<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16974459724950883, 'fraction_numerical': 0.021611001964636542, 'mean_word_length': 4.451820128479658, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '259057', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 986, 'n_tokens_neox': 926, 'n_words': 179, 'path': 'assessingsolar/notebooks/solrad.ipynb', 'repo_name': 'AssessingSolar/Assessing-Solar', 'size': '2545'}