Esempio n. 1
0
    def __init__(self, source_datacube=None, default_tile_type_id=1):
        if source_datacube:
            # Copy values from source_datacube and then override command line args
            self.__dict__ = copy(source_datacube.__dict__)
            
            args = self.parse_args()
            # Set instance attributes for every value in command line arguments file
            for attribute_name in args.__dict__.keys():
                attribute_value = args.__dict__[attribute_name]
                self.__setattr__(attribute_name, attribute_value)

        else:
            Stacker.__init__(self, source_datacube, default_tile_type_id) # Call inherited constructor
            
        if self.debug:
            console_handler.setLevel(logging.DEBUG)
            
        try:
            self.years = int(self.years) 
        except:
            self.years = 0
Esempio n. 2
0
    def __init__(self, source_datacube=None, default_tile_type_id=1):
        if source_datacube:
            # Copy values from source_datacube and then override command line args
            self.__dict__ = copy(source_datacube.__dict__)

            args = self.parse_args()
            # Set instance attributes for every value in command line arguments file
            for attribute_name in args.__dict__.keys():
                attribute_value = args.__dict__[attribute_name]
                self.__setattr__(attribute_name, attribute_value)

        else:
            Stacker.__init__(
                self, source_datacube,
                default_tile_type_id)  # Call inherited constructor

        if self.debug:
            console_handler.setLevel(logging.DEBUG)

        try:
            self.years = int(self.years)
        except:
            self.years = 0