def set_and_normalize(self,species_hash):
sum_before = sum(self.abu)<EOL>for i in range(len(species_hash)):<EOL><INDENT>sum_before -= self.abu[self.hindex[list(species_hash.keys())[i]]]<EOL><DEDENT>print("<STR_LIT>"+str(sum_before))<EOL>normalization_factor=old_div(<NUM_LIT:1.0>-sum(species_hash.values()),sum_before)<EOL>print("<STR_LIT>"+str(normalization_factor))<EOL>self.abu *= normalization_factor<EOL>for i in range(len(species_hash)):<EOL><INDENT>self.abu[self.hindex[list(species_hash.keys())[i]]]=list(species_hash.values())[i]<EOL><DEDENT>for l in range(len(self.abu)):<EOL><INDENT>if self.abu[l] <= <NUM_LIT>:   <EOL><INDENT>self.abu[l] = <NUM_LIT><EOL><DEDENT><DEDENT>for name in self.habu:<EOL><INDENT>self.habu[name]=self.abu[self.hindex[name]]<EOL><DEDENT>
species_hash is a hash array in which you provide abundances
referenced by species names that you want to set to some
particular value; all other species are then normalised so that
the total sum is 1.

Examples
--------

You can set up the argument array for this method for example
in the following way.

>>> sp={}
>>> sp['he  4']=0.2
>>> sp['h   1']=0.5