def __init__(self, cnn, NetworkConfig, year, doys):
try:
self.Name = NetworkConfig['network_id'].lower()
self.Core = NetClass(cnn, self.Name, NetworkConfig['stn_core'], year, doys)
self.Secondary = NetClass(cnn, self.Name + '.Secondary', NetworkConfig['stn_list'], year, doys, self.Core.StrStns)
# create a StationAlias if needed, if not, just assign StationCode
self.AllStations = []
for Station in self.Core.Stations + self.Secondary.Stations:
self.CheckStationCodes(Station)
if [Station.NetworkCode, Station.StationCode] not in [[stn['NetworkCode'], stn['StationCode']] for stn in self.AllStations]:
self.AllStations.append({'NetworkCode': Station.NetworkCode, 'StationCode': Station.StationCode, 'StationAlias': Station.StationAlias})
self.total_stations = len(self.Core.Stations) + len(self.Secondary.Stations)
sys.stdout.write('\n >> Total number of stations: %i (including core)\n\n' % (self.total_stations))
except:
raise
return
评论列表
文章目录