def get_all_sites(url = "https://www.esrl.noaa.gov/gmd/dv/site/"): html = _ul.request.urlopen(url).read() sites = _pd.read_html(html)[0] #remove discontinued sites = sites[~sites.apply(lambda row: '*' in row.Code, axis = 1)].copy() sites['name'] = sites.apply(lambda row: row.Name.split(',')[0], axis=1) def gstate(row): try: out = row.Name.split(',')[1] except IndexError: out = None return out sites['state'] = sites.apply(gstate, axis=1) sites.rename({'Longitude': 'lon', 'Latitude': 'lat', 'Elevation (meters)': 'alt', 'Code': 'abbreviation', 'Country': 'country'}, axis=1, inplace = True) sites site_dict_list = [] for idx, si in sites.iterrows(): site_dict_list.append(si.to_dict()) gml_sites = _ms.Network(site_dict_list) return gml_sites
{'name': 'Mt Waliguan', 'state': 'China', 'lat': 36.28, 'lon': 100.9, 'abbreviation': 'WLG', 'alt': 3810.0, 'operation_period': '2005-present'}, {'name': 'Sable Island', 'state': 'Nova Scotia', 'lat': 43.93, 'lon': -60.01, 'abbreviation': 'WSA', 'alt': 5.0, 'operation_period': '1992-2000'}, {'name': 'Ny-Alesund', 'state': 'Norway', 'lat': 78.907, 'lon': 11.889, 'abbreviation': 'ZEP', 'alt': 475.0, 'operation_period': '2018-present'}, {'name': 'Zugspitze', 'state': 'Germany', 'lat': 47.42, 'lon': 10.98, 'abbreviation': 'ZSF', 'alt': 2671.0, 'operation_period': '2018-present'}] network = _measurement_site.Network(_stations) network.name = 'aero'
# 'alt': 314, # 'timezone': 6, # 'type': 'permanent'}, # {'name': '', # 'state': '', # 'abbriviations': ['', ''], # 'lon': -, # 'lat': , # 'alt': , # 'timezone': , # 'type': 'permanent'} ] _channel_labels = _np.array([415, 500, 614, 673, 870, 1625]) network = _measurement_site.Network(_locations) network.name = 'surfrad' network.data_specs = DataSpecs(network) for station in network.stations._stations_list: station.data = Surfrad_Data(station) #todo: remove the following dictionary ... its not used anymore _deprecated_col_label_trans_dict = { 'OD413': 415, 'OD414': 415, 'OD415': 415, 'OD416': 415, 'OD417': 415, 'AOD417': 415, 'OD495': 500, 'OD496': 500,
'name': 'Tonkawa, OK (NE radar wind profiler site, Intermediate / Auxiliary)', 'alt': 306.0, 'facility': 'I8'}, {'active': True, 'Site Code': 'SGP', 'lat': 36.4762, 'lon': -97.4217, 'Surface Type': 'Pasture', 'name': 'Billings, OK (SE radar wind profiler site, Intermediate / Auxiliary)', 'alt': 291.0, 'facility': 'I9'}, {'active': True, 'Site Code': 'SGP', 'lat': 36.6656, 'lon': -97.6242, 'Surface Type': 'Pasture (Ungrazed)', 'name': 'Lamont, OK (NW radar wind profiler site, Intermediate / Auxiliary)', 'alt': 312.0, 'facility': 'I10'}] for site in sites_list: site['abbreviation'] = site['facility'] def site_from_file_info(file_info): site_info = [site for site in sites_list if site['Site Code'].upper() == file_info['site'].upper() and file_info['facility'] == site['facility']][0] site = ms.Station(**site_info) return site sgp_sites = ms.Network(sites_list, by_keys = ['name', 'abb'])