def __init__(self, params: dict): """ Constructor """ # Record parameters self.params.update(params) logger.setLevel(self.params['verbose']) ch.setLevel(self.params['verbose']) logger.addHandler(ch) self._validate_setup() logger.info("read_domain") self.domain = io.read_domain(self.params) self._normalize_times() logger.info("read_met_data") self.met_data = io.read_met_data(self.params, self.domain) self._validate_force_times(force_times=self.met_data['time']) logger.info("read_state") self.state = io.read_state(self.params, self.domain) self.met_data['elev'] = self.domain['elev'] self.met_data['lat'] = self.domain['lat'] logger.info("_aggregate_state") self._aggregate_state() logger.info("load_inputs") self.load_inputs()
def state(self): if self._state is None: self._state = io.read_state(self.params, self.domain) self._aggregate_state() return self._state