本文整理匯總了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)