本文整理汇总了Python中FileIO.outputGrid方法的典型用法代码示例。如果您正苦于以下问题:Python FileIO.outputGrid方法的具体用法?Python FileIO.outputGrid怎么用?Python FileIO.outputGrid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileIO
的用法示例。
在下文中一共展示了FileIO.outputGrid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import FileIO [as 别名]
# 或者: from FileIO import outputGrid [as 别名]
def main(*arguements):
# --------------------------------------------------------
# Parse command line, to fetch session input file
# --------------------------------------------------------
if len(sys.argv) >= 2:
ripFilePath = sys.argv[1]
# If user did not specify .rip file
else:
print "User must specify input file name (e.g., at command line type GARM.py user_input.rip)."
sys.exit(-1)
# If .ip file does not exist
if not os.path.exists(ripFilePath):
print ("Cannot find or open runtime inputs file(%s)" % (ripFilePath))
sys.exit(-1)
dir = "tree100perlandscape/"
# bird_types = ['St','Mu','Gl','Cr','Ax',Sh,Tu
# Skipped Du, Re, Ru
bird_types = ["Ha"]
file_types = ["_tree_100_1_10.asc", "_tree_100_1_100.asc"]
# file_types = ['_tree_100_1_2.asc','_tree_100_1_5.asc','_tree_100_1_10.asc','_tree_100_1_100.asc']
grid_file_out = "aus_bird_unicor.rip"
for bird in bird_types:
for type in file_types:
print "now running " + bird + type
header_dict, data = FileIO.loadFile(ripFilePath, header_lines=16)
header_dict["XY_Filename"] = str(bird + "_XY.csv")
header_dict["Grid_Filename"] = str(dir + bird + type)
header_dict["Session_label"] = bird + "_type"
FileIO.outputGrid(grid_file_out, ["null", "null"], header_dict=header_dict)
cd_matrix = RunUNICOR(grid_file_out)