from troposphere import Ref from troposphere import Tags from troposphere import Template from troposphere.ec2 import VPCGatewayAttachment from troposphere.ec2 import InternetGateway from troposphere.ec2 import VPC from functions import readConfigFile from functions import addRouteTable from functions import addNatGateway from functions import addSubnetRouteTableAssociation from functions import addSubnet from functions import addRouteToRouteTableIGW from functions import addRouteToRouteTableNAT # Loading the config file based on the argument passed data = readConfigFile('filename') t = Template() t.add_version('2010-09-09') t.add_description("""\ AWS CloudFormation Template VPC with Public and Private Subnets following AWS Scenario 2\ """) # Parameters vpcName_param = t.add_parameter(Parameter( "VpcName", Description="VPC for %s environment" % data['EnvInfo']['Name'], Default="%s-VPC" % data['EnvInfo']['Name'], Type="String"
print( "Read bands(tif file) and align with block mode." "This mode support removing the movement of clouds so that align results will be more accurate." ) print("\nUsage instruction:") print("example.exe [img_dir] [img_out_dir]") print("[img_dir]:The input dir that contains band data(tif files).") print("[img_out_dir]:The output dir for resampled images.") print("\nUsage example:") print("AlignTIF_Block.exe C:\\tif C:\\tifout") os.system('pause') elif sys.argv.__len__() == 3: # 多波段分块对准模式(tif -> tif) print('---Block mode for tif files---') # 读取参数 fun.readConfigFile('config.yml') exe_paths = [] if fun.isCloudMode: print("=>Cloud movement detector on") else: print("=>Cloud movement detector off") if fun.isIteration: print('---Base image iteration mode---') # 构造执行命令 input_path = sys.argv[1] output_path = sys.argv[2] if fun.isReverse: paths, names, files = fun.findAllFilesReverse( input_path, '.tif') else: