当前位置: 首页>>代码示例>>Python>>正文


Python FileIO.outputGrid方法代码示例

本文整理汇总了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)
开发者ID:ComputationalEcologyLab,项目名称:UNICOR,代码行数:37,代码来源:unicor_script.py


注:本文中的FileIO.outputGrid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。