Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Assign NameStore Num FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpDiv Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpMult Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword NameLoad keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword NameLoad keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword NameLoad keyword NameLoad keyword Str Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Str If NameLoad body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr handlers ExceptHandler body Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str attr handlers ExceptHandler body Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str attr handlers ExceptHandler body Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr handlers ExceptHandler body Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr handlers ExceptHandler body Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr handlers ExceptHandler body Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr handlers ExceptHandler body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad FunctionDef arguments args NameParam defaults body Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Str Str FunctionDef arguments args NameParam NameParam defaults body Assert Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpMod Str NameLoad Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Assert CompareEq Call NameLoad NameLoad Num BinOpMod Str NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str If NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str NameLoad Assert CompareEq Call AttributeLoad NameLoad attr NameLoad Num Str orelse Assert Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Str Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr BinOpAdd SubscriptLoad NameLoad Index Num BinOpMult SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr BinOpAdd SubscriptLoad NameLoad Index Num BinOpMult SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad NameLoad NameLoad Return TupleLoad Call NameLoad Call NameLoad BinOpDiv BinOpSub NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Call NameLoad Call NameLoad BinOpDiv BinOpSub NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Call NameLoad Call NameLoad BinOpDiv BinOpSub NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Call NameLoad Call NameLoad BinOpDiv BinOpSub NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Dict For NameStore NameLoad body Assign NameStore Dict Str Str Str Str Str Str Str SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Str Str Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore ListLoad For NameStore ListLoad Str body Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index TupleLoad Str NameLoad For NameStore Call NameLoad Call AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str Str Str Str NameLoad NameLoad SubscriptLoad NameLoad Index Str NameLoad SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad Num Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Dict Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Str Assign NameStore Dict Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad For NameStore Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body For NameStore Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad For NameStore NameLoad body Assign SubscriptStore NameLoad Index TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num NameLoad Return NameLoad decorator_list Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Assign NameStore BinOpAdd Call AttributeLoad Str attr ListLoad SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr Str Str SubscriptLoad NameLoad Index Str Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr attr Str BinOpMod Str SubscriptLoad NameLoad Index Str BinOpMod Str SubscriptLoad NameLoad Index Str Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str BinOpAdd BinOpAdd SubscriptLoad NameLoad Index Str Str Call AttributeLoad NameLoad attr Str Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Str Assign NameStore BinOpMult Call NameLoad BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad Call NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Return NameLoad TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad Assign NameStore NameLoad For NameStore Call AttributeLoad NameLoad attr body AugAssignBitOr NameStore NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Return NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Return NameLoad If BoolOpAnd AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad For NameStore ListLoad Str body Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareEq SubscriptLoad NameLoad Index Str NameLoad Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Num Index Str Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Num Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd BinOpAdd NameLoad Str NameLoad If BoolOpOr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Continue Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore Str If UnaryOpNot AttributeLoad NameLoad attr body AugAssignAdd NameStore Str If CompareIsNot NameLoad NameLoad body AugAssignAdd NameStore BinOpMod Str TupleLoad NameLoad NameLoad AugAssignAdd NameStore BinOpMod Str TupleLoad NameLoad Call AttributeLoad Str attr ListComp SubscriptLoad NameLoad Index Str comprehension NameStore NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad keyword NameLoad If SubscriptLoad NameLoad Index Str body Expr Call NameLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str BinOpAdd Str NameLoad Str If SubscriptLoad NameLoad Index Str body Expr Call NameLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str BinOpAdd Str NameLoad Str Raise Call NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr BinOpMod Str SubscriptLoad NameLoad Index Str BinOpMod Str SubscriptLoad NameLoad Index Str For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr Dict Str Str SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad For NameStore Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body For NameStore Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Assign NameStore TupleLoad BinOpAdd SubscriptLoad NameLoad Index Str BinOpMult NameLoad SubscriptLoad NameLoad Index Str BinOpAdd SubscriptLoad NameLoad Index Str BinOpMult NameLoad SubscriptLoad NameLoad Index Str BinOpAdd SubscriptLoad NameLoad Index Str BinOpMult BinOpAdd NameLoad Num SubscriptLoad NameLoad Index Str BinOpAdd SubscriptLoad NameLoad Index Str BinOpMult BinOpAdd NameLoad Num SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr Str Str BinOpMod Str TupleLoad NameLoad NameLoad BinOpMod Str AttributeLoad SubscriptLoad NameLoad Index Str attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd Call AttributeLoad Str attr ListLoad SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr Str Str SubscriptLoad NameLoad Index Str NameLoad Call AttributeLoad NameLoad attr Str Str BinOpMod Str TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr Str Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr SubscriptLoad NameLoad Index Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Continue If BoolOpOr CompareIs Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad body Assign NameStore Str If UnaryOpNot AttributeLoad NameLoad attr body AugAssignAdd NameStore Str AugAssignAdd NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str NameLoad If CompareIsNot NameLoad NameLoad body AugAssignAdd NameStore BinOpMod Str TupleLoad NameLoad NameLoad AugAssignAdd NameStore BinOpMod Str SubscriptLoad NameLoad Index Str If SubscriptLoad NameLoad Index Str body For NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str body AugAssignAdd NameStore BinOpMod Str NameLoad AugAssignAdd NameStore BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore NameLoad While NameLoad body Assign NameStore Call NameLoad keyword NameLoad If SubscriptLoad NameLoad Index Str body Expr Call NameLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str BinOpAdd Str NameLoad Str If SubscriptLoad NameLoad Index Str body Expr Call NameLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str BinOpAdd Str NameLoad Str If BoolOpAnd CompareGt Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Str Num CompareEq SubscriptLoad NameLoad Index Str Str CompareGt Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Str Num body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad AugAssignAdd NameStore Str If SubscriptLoad NameLoad Index Str body For NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str body AugAssignAdd NameStore BinOpMod Str NameLoad AugAssignAdd NameStore BinOpMod Str TupleLoad NameLoad NameLoad orelse Raise Call NameLoad Str NameLoad orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert NameLoad BinOpMod Str NameLoad If BoolOpAnd CompareIs Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad CompareEq NameLoad Str body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Call AttributeLoad CompareGt Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr Num attr BinOpLShift Num AttributeLoad NameLoad attr Num attr Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad If SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad keyword NameLoad If SubscriptLoad NameLoad Index Str body Expr Call NameLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str BinOpAdd Str NameLoad Str If SubscriptLoad NameLoad Index Str body Expr Call NameLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad If SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad body Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num Assign NameStore Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str NameLoad NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad SubscriptLoad NameLoad Index Num Index Str NameLoad NameLoad NameLoad Expr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Return NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body Raise decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Str While UnaryOpNot Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str body Expr Call AttributeLoad NameLoad attr Num TryFinally body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad finalbody Expr Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str For NameStore NameLoad body Assign NameStore Dict For NameStore Call NameLoad Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad If AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad orelse TryExcept body Expr Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Expr Call NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr
N/A N/A 
Created on 05/10/2012

@author: Alex Ip
 N/A os N/A sys N/A argparse N/A logging N/A re N/A psycopg2 N/A numpy N/A shutil osgeo gdal osr math floor ceil datetime datetime copy copy N/A time N/A string EOtools.utils log_multiline EOtools.execute execute agdc DataCube N/A TILE_OWNER axi547:rs0 N/A console_handler N/A N/A logging StreamHandler N/A sys stdout N/A N/A N/A console_handler setLevel N/A logging INFO N/A console_formatter N/A N/A logging Formatter %(message)s N/A N/A N/A console_handler setFormatter console_formatter N/A logger N/A N/A logging getLogger __name__ N/A N/A N/A logger level N/A N/A N/A N/A logger setLevel N/A logging DEBUG N/A N/A N/A logger addHandler console_handler LandsatTiler N/A DataCube N/A N/A CONTIGUITY_BIT_INDEX 8 getFileSizeMB N/A N/A self path N/A N/A N/A Gets the size of a file (megabytes).
    
        Arguments:
            path: file path
     
        Returns:
            File size (MB)
    
        Raises:
            OSError [Errno=2] if file does not exist
         N/A N/A N/A N/A N/A os path getsize path N/A 1024 1024 N/A parse_args N/A N/A self N/A N/A N/A Overrides Datacube function to parse the command line arguments.
    
        Returns:
            argparse namespace object
         N/A N/A N/A logger debug   Calling parse_args() N/A _arg_parser N/A N/A argparse ArgumentParser datacube N/A N/A N/A _arg_parser add_argument -C --config dest config_file default N/A N/A N/A os path join N/A self agdc_root agdc_default.conf help DataCube configuration file N/A N/A N/A _arg_parser add_argument -d --debug dest debug default False action store_const const True help Debug mode flag N/A N/A N/A _arg_parser add_argument --refresh dest refresh default True action store_const const True help Refresh mode flag to force updating of existing records N/A N/A N/A _arg_parser add_argument -t --tile_type dest default_tile_type_id required False default None help Tile type ID of tile to be stacked N/A N/A N/A _arg_parser parse_args N/A __init__ N/A N/A self source_datacube default_tile_type_id N/A None 1 N/A N/A Constructor
        Arguments:
            source_datacube: Optional DataCube object whose connection and data will be shared
            tile_type_id: Optional tile_type_id value (defaults to config file value = 1)
         N/A source_datacube N/A N/A N/A self __dict__ N/A copy N/A source_datacube __dict__ N/A args N/A N/A self parse_args N/A attribute_name N/A N/A N/A args __dict__ keys N/A N/A attribute_value N/A N/A args __dict__ N/A attribute_name N/A N/A N/A self __setattr__ attribute_name attribute_value N/A N/A N/A N/A DataCube __init__ self N/A N/A self debug N/A N/A N/A N/A console_handler setLevel N/A logging DEBUG N/A N/A N/A self db_connection autocommit False N/A N/A N/A N/A self db_connection set_isolation_level N/A N/A psycopg2 extensions ISOLATION_LEVEL_READ_COMMITTED N/A N/A N/A N/A self default_tile_type_id N/A int N/A self default_tile_type_id N/A N/A N/A N/A N/A self default_tile_type_id default_tile_type_id N/A N/A N/A N/A self start_date N/A N/A N/A N/A datetime strptime N/A self start_date %d/%m/%Y date N/A N/A N/A N/A N/A self start_date None N/A N/A N/A N/A self end_date N/A N/A N/A N/A datetime strptime N/A self end_date %d/%m/%Y date N/A N/A N/A N/A N/A self end_date None N/A N/A N/A N/A self min_path N/A int N/A self min_path N/A N/A N/A N/A N/A self min_path None N/A N/A N/A N/A self max_path N/A int N/A self max_path N/A N/A N/A N/A N/A self max_path None N/A N/A N/A N/A self min_row N/A int N/A self min_row N/A N/A N/A N/A N/A self min_row None N/A N/A N/A N/A self max_row N/A int N/A self max_row N/A N/A N/A N/A N/A self max_row None N/A create_tiles N/A N/A self start_date end_date min_path max_path min_row max_row tile_type_id N/A None None None None None None None N/A N/A start_date N/A start_date N/A self start_date N/A end_date N/A end_date N/A self end_date N/A min_path N/A min_path N/A self min_path N/A max_path N/A max_path N/A self max_path N/A min_row N/A min_row N/A self min_row N/A max_row N/A max_row N/A self max_row N/A tile_type_id N/A tile_type_id N/A self default_tile_type_id N/A tile_type_info N/A N/A self tile_type_dict N/A tile_type_id process_dataset N/A N/A dataset_info N/A N/A N/A N/A log_multiline N/A logger debug dataset_info Dataset values find_file N/A N/A dataset_dir file_pattern N/A N/A N/A N/A N/A N/A os path isdir dataset_dir N/A %s is not a valid directory dataset_dir N/A filelist N/A filename N/A filename N/A N/A os listdir dataset_dir N/A N/A re match file_pattern filename N/A N/A N/A len filelist 1 N/A Unable to find unique match for file pattern %s file_pattern N/A N/A N/A N/A os path join dataset_dir N/A filelist N/A 0 N/A get_tile_index_range N/A N/A dataset_filename N/A N/A N/A Returns integer (xmin, ymin, xmax, ymax) tuple for input GDAL dataset filename N/A dataset N/A N/A gdal Open dataset_filename N/A dataset N/A Unable to open dataset %s dataset_filename N/A spatial_reference N/A N/A osr SpatialReference N/A N/A N/A spatial_reference ImportFromWkt N/A N/A dataset GetProjection N/A geotransform N/A N/A dataset GetGeoTransform N/A N/A N/A logger debug geotransform = %s geotransform N/A tile_spatial_reference N/A N/A osr SpatialReference N/A s N/A N/A re match EPSG:(\d+) N/A tile_type_info N/A crs N/A s N/A N/A epsg_code N/A int N/A N/A s group 1 N/A N/A N/A logger debug epsg_code = %d epsg_code N/A N/A N/A N/A tile_spatial_reference ImportFromEPSG epsg_code 0 Invalid EPSG code for tile projection N/A N/A N/A N/A tile_spatial_reference ImportFromWkt N/A tile_type_info N/A crs Invalid WKT for tile projection N/A N/A N/A logger debug Tile WKT = %s N/A N/A tile_spatial_reference ExportToWkt N/A coord_transform_to_tile N/A N/A osr CoordinateTransformation spatial_reference tile_spatial_reference N/A N/A xmin ymax _z N/A N/A coord_transform_to_tile TransformPoint N/A geotransform N/A 0 N/A geotransform N/A 3 0 N/A N/A xmax ymin _z N/A N/A coord_transform_to_tile TransformPoint N/A N/A geotransform N/A 0 N/A N/A geotransform N/A 1 N/A dataset RasterXSize N/A N/A geotransform N/A 3 N/A N/A geotransform N/A 5 N/A dataset RasterYSize 0 N/A N/A N/A logger debug Coordinates: xmin = %f, ymin = %f, xmax = %f, ymax = %f xmin ymin xmax ymax N/A N/A N/A int N/A floor N/A N/A xmin N/A tile_type_info N/A x_origin N/A tile_type_info N/A x_size N/A int N/A floor N/A N/A ymin N/A tile_type_info N/A y_origin N/A tile_type_info N/A y_size N/A int N/A ceil N/A N/A xmax N/A tile_type_info N/A x_origin N/A tile_type_info N/A x_size N/A int N/A ceil N/A N/A ymax N/A tile_type_info N/A y_origin N/A tile_type_info N/A y_size N/A find_tiles N/A N/A x_index y_index N/A None None N/A N/A Find any tile records for current dataset
                returns dict of tile information keyed by tile_id
                 N/A db_cursor2 N/A N/A N/A self db_connection cursor N/A sql -- Check for any existing tiles
select
  tile_id,
  x_index,
  y_index,
  tile_type_id,
  tile_pathname,
  dataset_id,
  tile_class_id,
  tile_size
from tile_footprint
inner join tile using(x_index, y_index, tile_type_id)
where (%(x_index)s is null or x_index = %(x_index)s)
  and (%(y_index)s is null or y_index = %(y_index)s)
  and tile_type_id = %(tile_type_id)s
  and dataset_id = %(fc_dataset_id)s

  and ctime is not null -- TODO: Remove this after reload
;
 N/A params N/A x_index y_index tile_type_id fc_dataset_id x_index y_index N/A tile_type_info N/A tile_type_id N/A dataset_info N/A fc_dataset_id N/A N/A log_multiline N/A logger debug N/A N/A db_cursor2 mogrify sql params SQL N/A N/A N/A db_cursor2 execute sql params N/A tile_info N/A N/A record db_cursor2 N/A N/A tile_info_dict N/A x_index y_index tile_type_id tile_pathname dataset_id tile_class_id tile_size N/A record N/A 1 N/A record N/A 2 N/A record N/A 3 N/A record N/A 4 N/A record N/A 5 N/A record N/A 6 N/A record N/A 7 N/A N/A tile_info N/A N/A record N/A 0 tile_info_dict N/A N/A log_multiline N/A logger debug tile_info tile_info N/A tile_info N/A get_vrt_band_list N/A N/A N/A N/A N/A Returns list of band information to create tiles
                 N/A N/A N/A logger debug get_vrt_band_list() called N/A vrt_band_list N/A N/A band_level N/A FC N/A N/A derived_bands N/A N/A N/A self bands N/A tile_type_id N/A N/A DERIVED band_level N/A file_number N/A sorted N/A N/A derived_bands keys N/A N/A band_info N/A derived_bands N/A file_number N/A file_pattern N/A band_info N/A file_pattern N/A dataset_dir N/A N/A N/A os path join N/A dataset_info N/A fc_dataset_path scene01 N/A dataset_id N/A dataset_info N/A fc_dataset_id N/A filename N/A find_file dataset_dir file_pattern N/A processing_level N/A dataset_info N/A fc_level_name N/A nodata_value N/A dataset_info N/A fc_nodata_value N/A resampling_method N/A dataset_info N/A fc_resampling_method N/A N/A N/A vrt_band_list append N/A file_number filename name dataset_id band_id processing_level nodata_value resampling_method tile_layer None filename N/A band_info N/A band_name dataset_id N/A band_info N/A band_id processing_level nodata_value resampling_method 1 N/A N/A log_multiline N/A logger debug vrt_band_list vrt_band_list = %s N/A vrt_band_list N/A get_tile_has_data N/A N/A tile_index_range N/A N/A N/A tile_has_data N/A N/A db_cursor2 N/A N/A N/A self db_connection cursor N/A sql -- Find all PQA tiles which exist for the dataset
select
  x_index,
  y_index
from dataset
  inner join tile using(dataset_id)
where tile_type_id = %(tile_type_id)s
  and level_id = 3 -- PQA
  and tile_class_id = 1 -- Tile containing live data
  and acquisition_id = %(acquisition_id)s             
                 N/A params N/A tile_type_id acquisition_id N/A tile_type_info N/A tile_type_id N/A dataset_info N/A acquisition_id N/A N/A log_multiline N/A logger debug N/A N/A db_cursor2 mogrify sql params SQL N/A N/A N/A db_cursor2 execute sql params N/A x_index N/A range N/A tile_index_range N/A 0 N/A tile_index_range N/A 2 N/A N/A y_index N/A range N/A tile_index_range N/A 1 N/A tile_index_range N/A 3 N/A N/A N/A tile_has_data N/A N/A x_index y_index False N/A record db_cursor2 N/A N/A N/A tile_has_data N/A N/A N/A record N/A 0 N/A record N/A 1 True N/A tile_has_data N/A N/A result False N/A db_cursor1 N/A N/A N/A self db_connection cursor N/A N/A N/A logger info Processing dataset %s N/A dataset_info N/A fc_dataset_path N/A vrt_band_stack_basename N/A N/A N/A _ join N/A N/A dataset_info N/A satellite_tag N/A N/A re sub \W N/A dataset_info N/A sensor_name N/A N/A N/A N/A N/A dataset_info N/A start_datetime date strftime %Y%m%d N/A %03d N/A dataset_info N/A x_ref N/A %03d N/A dataset_info N/A y_ref .vrt N/A N/A N/A logger debug vrt_band_stack_basename = %s vrt_band_stack_basename N/A tile_output_root N/A N/A N/A os path join N/A self tile_root N/A tile_type_info N/A tile_directory N/A N/A N/A dataset_info N/A satellite_tag _ N/A N/A re sub \W N/A dataset_info N/A sensor_name N/A N/A N/A logger debug tile_output_root = %s tile_output_root N/A vrt_band_list N/A get_vrt_band_list N/A tile_index_range N/A get_tile_index_range N/A N/A vrt_band_list N/A 0 N/A filename N/A tile_count N/A N/A abs N/A N/A tile_index_range N/A 2 N/A tile_index_range N/A 0 N/A N/A tile_index_range N/A 3 N/A tile_index_range N/A 1 N/A tile_record_count N/A len N/A find_tiles N/A N/A N/A logger info Found %d tile records in database for %d tiles tile_record_count tile_count N/A N/A tile_record_count tile_count N/A N/A N/A N/A logger info All tiles already exist in database - skipping tile creation for %s N/A dataset_info N/A fc_dataset_path N/A result N/A N/A N/A work_directory N/A N/A N/A os path join N/A self temp_dir N/A N/A N/A os path basename N/A dataset_info N/A fc_dataset_path N/A tile_has_data N/A get_tile_has_data tile_index_range N/A any_tile_has_data False N/A value N/A N/A tile_has_data values N/A N/A any_tile_has_data value N/A N/A any_tile_has_data N/A N/A N/A N/A logger info No valid PQ tiles found - skipping tile creation for %s N/A dataset_info N/A fc_dataset_path N/A result N/A N/A N/A N/A self lock_object work_directory N/A N/A N/A N/A logger info Already processing %s - skipping N/A dataset_info N/A fc_dataset_path N/A result N/A N/A N/A self refresh N/A N/A N/A os path exists work_directory N/A N/A N/A N/A shutil rmtree work_directory N/A N/A N/A self create_directory work_directory N/A processing_level N/A FC N/A N/A vrt_band_info_list N/A vrt_band_info N/A vrt_band_info vrt_band_list N/A N/A vrt_band_info N/A processing_level processing_level N/A nodata_value N/A N/A vrt_band_info_list N/A 0 N/A nodata_value N/A resampling_method N/A N/A vrt_band_info_list N/A 0 N/A resampling_method N/A vrt_band_stack_filename N/A N/A N/A os path join work_directory N/A N/A processing_level _ vrt_band_stack_basename N/A N/A N/A N/A N/A N/A os path exists vrt_band_stack_filename N/A N/A self check_object_locked vrt_band_stack_filename N/A N/A N/A N/A N/A self lock_object vrt_band_stack_filename N/A N/A N/A N/A logger warning Band stack %s already being processed - skipping. vrt_band_stack_filename N/A N/A N/A N/A logger info Creating %s band stack file %s processing_level vrt_band_stack_filename N/A command_string gdalbuildvrt -separate N/A N/A N/A self debug N/A N/A command_string  -q N/A N/A nodata_value None N/A N/A command_string N/A  -srcnodata %d -vrtnodata %d N/A nodata_value nodata_value N/A command_string N/A  -overwrite %s %s N/A vrt_band_stack_filename N/A N/A join N/A N/A vrt_band_info N/A filename N/A vrt_band_info vrt_band_info_list N/A N/A N/A logger debug command_string = %s command_string N/A result N/A execute command_string command_string N/A N/A result N/A stdout N/A N/A N/A log_multiline N/A logger info N/A result N/A stdout N/A stdout from  command_string N/A N/A result N/A returncode N/A N/A N/A log_multiline N/A logger error N/A result N/A stderr N/A stderr from  command_string N/A N/A Exception %s failed command_string N/A band_stack_dataset N/A N/A gdal Open vrt_band_stack_filename N/A band_stack_dataset N/A Unable to open VRT %s vrt_band_stack_filename N/A N/A N/A band_stack_dataset SetMetadata N/A satellite sensor start_datetime end_datetime path row N/A dataset_info N/A satellite_tag N/A dataset_info N/A sensor_name N/A N/A N/A dataset_info N/A start_datetime isoformat N/A N/A N/A dataset_info N/A end_datetime isoformat N/A %03d N/A dataset_info N/A x_ref N/A %03d N/A dataset_info N/A y_ref N/A band_index N/A range N/A len vrt_band_info_list N/A N/A band N/A N/A band_stack_dataset GetRasterBand N/A band_index 1 N/A N/A N/A band SetMetadata N/A name filename N/A N/A vrt_band_info_list N/A band_index N/A name N/A N/A vrt_band_info_list N/A band_index N/A filename N/A nodata_value N/A N/A vrt_band_info_list N/A band_index N/A nodata_value N/A N/A nodata_value None N/A N/A N/A N/A band SetNoDataValue nodata_value N/A N/A N/A band_stack_dataset FlushCache N/A N/A N/A self unlock_object vrt_band_stack_filename N/A N/A N/A N/A logger info Band stack %s already exists vrt_band_stack_filename N/A band_stack_dataset N/A N/A gdal Open vrt_band_stack_filename N/A N/A N/A logger info Processing %d %s Tiles tile_count processing_level N/A x_index N/A range N/A tile_index_range N/A 0 N/A tile_index_range N/A 2 N/A N/A y_index N/A range N/A tile_index_range N/A 1 N/A tile_index_range N/A 3 N/A N/A tile_extents N/A N/A N/A tile_type_info N/A x_origin N/A x_index N/A tile_type_info N/A x_size N/A N/A tile_type_info N/A y_origin N/A y_index N/A tile_type_info N/A y_size N/A N/A tile_type_info N/A x_origin N/A N/A x_index 1 N/A tile_type_info N/A x_size N/A N/A tile_type_info N/A y_origin N/A N/A y_index 1 N/A tile_type_info N/A y_size N/A N/A N/A logger debug tile_extents = %s tile_extents N/A tile_output_dir N/A N/A N/A os path join tile_output_root N/A N/A re sub \+ N/A %+04d_%+04d N/A x_index y_index N/A %04d N/A N/A dataset_info N/A start_datetime year N/A N/A N/A self create_directory N/A N/A N/A os path join tile_output_dir mosaic_cache N/A tile_output_path N/A N/A N/A os path join tile_output_dir N/A N/A N/A _ join N/A N/A dataset_info N/A satellite_tag N/A N/A re sub \W N/A dataset_info N/A sensor_name processing_level N/A N/A re sub \+ N/A %+04d_%+04d N/A x_index y_index N/A N/A re sub : - N/A N/A N/A dataset_info N/A start_datetime isoformat N/A tile_type_info N/A file_extension N/A N/A N/A N/A self lock_object tile_output_path N/A N/A N/A N/A logger warning Tile  %s already being processed - skipping. tile_output_path N/A N/A N/A N/A N/A N/A tile_has_data get N/A x_index y_index None N/A tile_has_data N/A N/A x_index y_index N/A N/A command_string gdalwarp N/A N/A N/A self debug N/A N/A command_string  -q N/A command_string N/A  -t_srs %s -te %f %f %f %f -tr %f %f -tap -tap -r %s N/A N/A tile_type_info N/A crs N/A tile_extents N/A 0 N/A tile_extents N/A 1 N/A tile_extents N/A 2 N/A tile_extents N/A 3 N/A tile_type_info N/A x_pixel_size N/A tile_type_info N/A y_pixel_size resampling_method N/A N/A nodata_value None N/A N/A command_string N/A  -srcnodata %d -dstnodata %d N/A nodata_value nodata_value N/A command_string N/A  -of %s N/A tile_type_info N/A file_format N/A N/A tile_type_info N/A format_options N/A N/A format_option N/A N/A N/A tile_type_info N/A format_options split , N/A N/A command_string N/A  -co %s format_option N/A command_string N/A  -overwrite %s %s N/A vrt_band_stack_filename tile_output_path N/A N/A N/A logger debug command_string = %s command_string N/A retry True N/A retry N/A N/A result N/A execute command_string command_string N/A N/A result N/A stdout N/A N/A N/A log_multiline N/A logger info N/A result N/A stdout N/A stdout from  command_string N/A N/A result N/A returncode N/A N/A N/A log_multiline N/A logger error N/A result N/A stderr N/A stderr from  command_string N/A N/A N/A N/A N/A string find N/A result N/A stderr LZW -1 N/A N/A tile_type_info N/A file_format GTiff N/A N/A N/A string find N/A tile_type_info N/A format_options COMPRESS=LZW -1 N/A N/A temp_tile_path N/A N/A N/A os path join N/A N/A N/A os path dirname vrt_band_stack_filename N/A N/A N/A os path basename tile_output_path N/A command_string N/A N/A string replace command_string COMPRESS=LZW COMPRESS=NONE N/A command_string N/A N/A string replace command_string tile_output_path temp_tile_path N/A command_string ; gdal_translate -of GTiff N/A N/A tile_type_info N/A format_options N/A N/A format_option N/A N/A N/A tile_type_info N/A format_options split , N/A N/A command_string N/A  -co %s format_option N/A command_string N/A  %s %s N/A temp_tile_path tile_output_path N/A N/A N/A Exception %s failed command_string N/A N/A retry False N/A tile_dataset N/A N/A gdal Open tile_output_path N/A tile_dataset N/A Unable to open tile dataset %s tile_output_path N/A N/A N/A N/A N/A tile_has_data get N/A x_index y_index None N/A processing_level PQA N/A N/A N/A tile_has_data N/A N/A x_index y_index N/A N/A N/A N/A N/A numpy bitwise_and N/A N/A N/A N/A tile_dataset GetRasterBand 1 ReadAsArray N/A 1 N/A LandsatTiler CONTIGUITY_BIT_INDEX 0 any N/A N/A N/A logger debug %s tile (%d, %d) has data = %s processing_level x_index y_index N/A tile_has_data N/A N/A x_index y_index N/A N/A tile_has_data N/A N/A x_index y_index N/A N/A metadata N/A N/A band_stack_dataset GetMetadata N/A N/A metadata N/A x_index N/A str x_index N/A N/A metadata N/A y_index N/A str y_index N/A N/A N/A tile_dataset SetMetadata metadata N/A band_index N/A range N/A len vrt_band_info_list N/A N/A scene_band N/A N/A band_stack_dataset GetRasterBand N/A band_index 1 N/A tile_band N/A N/A tile_dataset GetRasterBand N/A band_index 1 N/A N/A N/A tile_band SetMetadata N/A N/A scene_band GetMetadata N/A nodata_value N/A N/A vrt_band_info_list N/A band_index N/A nodata_value N/A N/A nodata_value None N/A N/A N/A N/A tile_band SetNoDataValue nodata_value N/A N/A N/A logger info Processed %s Tile (%d, %d) processing_level x_index y_index N/A N/A N/A N/A logger info Skipped empty %s Tile (%d, %d) processing_level x_index y_index N/A N/A N/A N/A logger info Skipped empty %s Tile (%d, %d) processing_level x_index y_index N/A command_string N/A chmod -R a-wxs,u+rwX,g+rsX %s; chown -R %s %s N/A tile_output_dir TILE_OWNER tile_output_dir N/A result N/A execute command_string command_string N/A N/A result N/A stdout N/A N/A N/A log_multiline N/A logger info N/A result N/A stdout N/A stdout from  command_string N/A N/A result N/A returncode N/A N/A N/A log_multiline N/A logger warning N/A result N/A stderr N/A stderr from  command_string N/A N/A N/A self unlock_object tile_output_path N/A N/A tile_has_data N/A N/A x_index y_index N/A N/A tile_class_id 1 N/A tile_size N/A N/A self getFileSizeMB tile_output_path N/A N/A tile_class_id 2 N/A N/A N/A self remove tile_output_path N/A tile_size 0 N/A sql -- Insert new tile_footprint record if necessary
    insert into tile_footprint (
      x_index, 
      y_index, 
      tile_type_id, 
      x_min, 
      y_min, 
      x_max, 
      y_max
      )
    select
      %(x_index)s, 
      %(y_index)s, 
      %(tile_type_id)s, 
      %(x_min)s, 
      %(y_min)s, 
      %(x_max)s, 
      %(y_max)s
    where not exists
      (select 
        x_index, 
        y_index, 
        tile_type_id
      from tile_footprint
      where x_index = %(x_index)s 
        and y_index = %(y_index)s 
        and tile_type_id = %(tile_type_id)s);
    
    -- Update any existing tile record
    update tile
    set 
      tile_pathname = %(tile_pathname)s,
      tile_class_id = %(tile_class_id)s,
      tile_size = %(tile_size)s,
      ctime = now()
    where 
      x_index = %(x_index)s
      and y_index = %(y_index)s
      and tile_type_id = %(tile_type_id)s
      and dataset_id = %(dataset_id)s;
    
    -- Insert new tile record if necessary
    insert into tile (
      tile_id,
      x_index,
      y_index,
      tile_type_id,
      dataset_id,
      tile_pathname,
      tile_class_id,
      tile_size,
      ctime
      )  
    select
      nextval('tile_id_seq'::regclass),
      %(x_index)s,
      %(y_index)s,
      %(tile_type_id)s,
      %(dataset_id)s,
      %(tile_pathname)s,
      %(tile_class_id)s,
      %(tile_size)s,
      now()
    where not exists
      (select tile_id
      from tile
      where 
        x_index = %(x_index)s
        and y_index = %(y_index)s
        and tile_type_id = %(tile_type_id)s
        and dataset_id = %(dataset_id)s
      );
     N/A params N/A x_index y_index tile_type_id x_min y_min x_max y_max dataset_id tile_pathname tile_class_id tile_size x_index y_index N/A tile_type_info N/A tile_type_id N/A tile_extents N/A 0 N/A tile_extents N/A 1 N/A tile_extents N/A 2 N/A tile_extents N/A 3 N/A N/A vrt_band_info_list N/A 0 N/A dataset_id tile_output_path tile_class_id tile_size N/A N/A log_multiline N/A logger debug N/A N/A db_cursor1 mogrify sql params SQL N/A N/A N/A db_cursor1 execute sql params N/A N/A N/A self unlock_object work_directory N/A N/A N/A self debug N/A N/A N/A N/A shutil rmtree work_directory N/A result True N/A N/A N/A N/A self db_connection commit N/A N/A N/A logger info Dataset tiling completed - Transaction committed N/A result N/A N/A N/A Exception N/A e N/A N/A N/A N/A logger error Tiling operation failed: %s N/A e message N/A N/A N/A N/A self db_connection rollback N/A N/A self debug N/A N/A N/A process_scenes N/A N/A N/A N/A N/A db_cursor N/A N/A N/A self db_connection cursor N/A sql -- Find all scenes with L1T, fc and PQA level datasets with missing tiles
select * from (
    select distinct
      acquisition_id,
      fc.dataset_id as fc_dataset_id,
      fc.dataset_path as fc_dataset_path,
      fc.level_name as fc_level_name,
      fc.nodata_value as fc_nodata_value,
      fc.resampling_method as fc_resampling_method,
      fc.tile_count as fc_tile_count,
      satellite_tag,
      sensor_name,
      x_ref,
      y_ref,
      start_datetime,
      end_datetime,
      ll_lon,
      ll_lat,
      lr_lon,
      lr_lat,
      ul_lon,
      ul_lat,
      ur_lon,
      ur_lat,
      fc.crs,
      fc.ll_x,
      fc.ll_y,
      fc.lr_x,
      fc.lr_y,
      fc.ul_x,
      fc.ul_y,
      fc.ur_x,
      fc.ur_y,
      fc.x_pixels,
      fc.y_pixels,
      -- TODO: Use dataset_footprint table so that this will not break for projected tile types
      (
        ceil(greatest((lr_lon + 360.0)::numeric %% 360.0::numeric,
          (ur_lon + 360.0)::numeric %% 360.0::numeric) / 1.0)
        -
        floor(least((ll_lon + 360.0)::numeric %% 360.0::numeric,
          (ul_lon + 360.0)::numeric %% 360.0::numeric) / 1.0)
      )
      *
      (
        ceil(greatest(ul_lat, ur_lat) / 1.0)
        -
        floor(least(ll_lat, lr_lat) / 1.0)
      ) as tiles_required
    from acquisition
    inner join (
      select
        acquisition_id,
        d.dataset_id,
        level_name,
        dataset_path,
        nodata_value,
        resampling_method,
        crs,
        ll_x,
        ll_y,
        lr_x,
        lr_y,
        ul_x,
        ul_y,
        ur_x,
        ur_y,
        x_pixels,
        y_pixels,
        count(tile_id) as tile_count
      from dataset d
      inner join processing_level using(level_id)
      left join tile t on t.dataset_id = d.dataset_id and tile_type_id = 1
        and ctime is not null -- *** TODO: Remove this line after reload ***
      where level_name = 'FC'
      group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
      ) fc using(acquisition_id)
    inner join satellite sa using(satellite_id)
    inner join sensor se using(satellite_id, sensor_id)
    where (%(start_date)s is null or start_datetime >= %(start_date)s)
      and (%(end_date)s is null or end_datetime < cast(%(end_date)s as date) + 1)
      and (%(min_path)s is null or x_ref >= %(min_path)s)
      and (%(max_path)s is null or x_ref <= %(max_path)s)
      and (%(min_row)s is null or y_ref >= %(min_row)s)
      and (%(max_row)s is null or y_ref <= %(max_row)s)
) datasets
where fc_tile_count < tiles_required
order by -- Order by path, row then descending date-times
  fc_tile_count,
  x_ref,
  y_ref,
  start_datetime desc,
  end_datetime desc,
  satellite_tag,
  sensor_name;
 N/A params N/A tile_type_id start_date end_date min_path max_path min_row max_row tile_x_size tile_y_size tile_type_id start_date end_date min_path max_path min_row max_row N/A tile_type_info N/A x_size N/A tile_type_info N/A y_size N/A N/A log_multiline N/A logger debug N/A N/A db_cursor mogrify sql params SQL N/A N/A N/A N/A self lock_object N/A N/A N/A N/A os path basename __file__  dataset query N/A N/A N/A N/A time sleep 10 N/A N/A N/A N/A N/A db_cursor execute sql params N/A N/A N/A N/A self unlock_object N/A N/A N/A N/A os path basename __file__  dataset query N/A column_list N/A acquisition_id fc_dataset_id fc_dataset_path fc_level_name fc_nodata_value fc_resampling_method fc_tile_count satellite_tag sensor_name x_ref y_ref start_datetime end_datetime ll_lon ll_lat lr_lon lr_lat ul_lon ul_lat ur_lon ur_lat crs ll_x ll_y lr_x lr_y ul_x ul_y ur_x ur_y x_pixels y_pixels N/A record db_cursor N/A N/A dataset_info N/A N/A column_index N/A range N/A len column_list N/A N/A N/A dataset_info N/A N/A column_list N/A column_index N/A record N/A column_index N/A N/A self debug N/A N/A N/A process_dataset dataset_info N/A N/A N/A N/A N/A process_dataset dataset_info N/A N/A N/A Exception N/A e N/A N/A N/A N/A logger warning N/A e message N/A N/A N/A process_scenes N/A N/A N/A N/A __name__ __main__ N/A N/A landsat_tiler N/A LandsatTiler N/A N/A N/A landsat_tiler create_tiles