本文整理汇总了Python中WRCCUtils.orient_shape_ccw方法的典型用法代码示例。如果您正苦于以下问题:Python WRCCUtils.orient_shape_ccw方法的具体用法?Python WRCCUtils.orient_shape_ccw怎么用?Python WRCCUtils.orient_shape_ccw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WRCCUtils
的用法示例。
在下文中一共展示了WRCCUtils.orient_shape_ccw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: station_meta_to_json
# 需要导入模块: import WRCCUtils [as 别名]
# 或者: from WRCCUtils import orient_shape_ccw [as 别名]
#.........这里部分代码省略.........
params = {'meta':'name,state,sids,ll,elev,uid,valid_daterange','elems':vX_tuple}
params[WRCCData.STN_AREA_FORM_TO_PARAM[by_type]] = val
if by_type == 'sw_states':params['state'] = 'az,ca,co,nm,nv,ut'
#Find bbox for custom shapes
if by_type == 'shape':
shape_type,bbox = WRCCUtils.get_bbox(val)
params['bbox'] = bbox
#Acis Metadata call and sanity checks on results
try:
request = StnMeta(params)
except:
stn_json['error'] = 'Metadata request failed. Please check your parameters!'
WRCCUtils.load_data_to_json_file(f_dir + f_name, stn_json)
return stn_json, f_name
if request is None:
stn_json['error'] = 'No metadata found.'
WRCCUtils.load_data_to_json_file(f_dir + f_name, stn_json)
return stn_json, f_name
if not 'meta' in request.keys() or not request['meta'] or 'error' in request.keys():
stn_json['error'] = 'No metadata found.'
WRCCUtils.load_data_to_json_file(f_dir + f_name, stn_json)
return stn_json, f_name
stn_meta_list = []
#For alphabetic ordering of station names
sorted_list =[]
#Keep track of duplicates
unique_stations = []
for i, stn in enumerate(request['meta']):
#if custom shape, check if stn lies within shape
if by_type == 'shape':
if shape_type in ['bbox','location']:shape = bbox.split(',')
elif shape_type == 'polygon':shape = WRCCUtils.orient_shape_ccw(val).split(',')
else:shape = val.split(',')
if not stn_in_poly(by_type, shape_type, shape, stn):
continue
#sanity check
if not stn['valid_daterange']:
continue
#check if we are looking for stations with particular variables
if el_list is not None and time_range is not None:
#Check if ACIS produced correct output, i.e. one valid_daterange per variable
if len(stn['valid_daterange']) < len(el_list):
continue
#Check if station is valid, if not, proceed to next station
flag_invalid_station = station_invalid(el_list, vX_list, time_range, stn, constraints)
if flag_invalid_station:
continue
stn_sids = []
stn_networks = []
stn_network_codes = []
sids = stn['sids'] if 'sids' in stn.keys() else []
marker_icons = []
for sid in sids:
sid_split = sid.split(' ')
'''
#put coop id up front (for csc application metagraph and possibly others)
if str(sid_split[1]) == '2':
#stn_sids.append(re.sub('[^a-zA-Z0-9\n\.]', ' ', str(sid_split[1])))
stn_sids.insert(0,str(sid_split[0]).replace("\'"," "))
stn_network_codes.insert(0, str(sid_split[1]))
marker_icons.insert(0, WRCCData.NETWORK_ICONS[str(sid_split[1])])
stn_networks.insert(0,WRCCData.NETWORK_CODES[str(sid_split[1])])
else:
'''