def main(mapset,map_name,remove,msk_type):
    
    set_mapset(mapset)
    
    if remove:
        drop_mask(msk_type)
    else:
        set_mask(name,msk_type)
def make_output_mask(mapcalc_str,border_vec):
    gscript.run_command('v.to.rast',input=border_vec,
                        output='{}_rast'.format(border_vec),
                        use='val',
                        value=1,
                       overwrite=True)
    gscript.mapcalc('output_mask = {}_rast && ({})'.format(border_vec,mapcalc_str),
                   overwrite=True,
                   verbose=True)
    set_mask('output_mask',maskcats=1)
Esempio n. 3
0
    def start(self):
        """Initialize a new word to start playing."""

        if not self.suspended:
            return

        new_word = utilities.get_new_word(self.lexicon)
        if new_word == "":
            raise ValueError("no word found!")
        self.__word = new_word
        self.__valid_chars = utilities.decompose(new_word)
        self.mask, symbols = utilities.set_mask(new_word)
        self.symbols.extend(symbols)
        self.suspended = False
def main(out,mapy,mapx,ms,residname,estimatesname,seed):
	
	mapx = parse_feature_names(mapx)
	
	gscript.run_command('g.mapset',mapset=ms)
	
	# run regression
	run_regression(out,mapy,mapx,residname,estimatesname)
	
	# develop mask from residuals map
	set_mask(residname)
	
	# calculate sum of squares of residuals and number of observations (will be dividing by  too many degrees
	# of freedom, but N is so big that the variance of the residuals is a reasonable approximation of the unbiased estimator of
	# the variance of the dependent variable.
	stats = get_stats(residname)
	sigma_hat2 = float(stats['variance'])
	
	# calculate standard error for each parameter estimate in the regression and output to file
	se_list = get_param_se(mapx,sigma_hat2)
	add_output_lines(out,mapx,se_list)
	
	# drop the mask from this mapset
	drop_mask()