def average_iso_abund_marco(self,mass_range,cycle,stable,i_decay):
import nuutils as u<EOL>if not stable and i_decay == <NUM_LIT:2>:<EOL><INDENT>print('<STR_LIT>')<EOL>return<EOL><DEDENT>self._read_iso_abund_marco(mass_range,cycle)<EOL>if i_decay == <NUM_LIT:2>:<EOL><INDENT>u.stable_specie()<EOL>self.decay(self.mass_frac)<EOL><DEDENT>print('<STR_LIT>')<EOL>print(used_masses[<NUM_LIT:0>],used_masses[len(used_masses)-<NUM_LIT:1>],'<STR_LIT>',mass_range[<NUM_LIT:0>],mass_range[<NUM_LIT:1>])<EOL>global average_mass_frac<EOL>average_mass_frac = []<EOL>if len(used_masses) >= <NUM_LIT:2>:<EOL><INDENT>dm_tot = abs(used_masses[len(used_masses)-<NUM_LIT:1>]-used_masses[<NUM_LIT:0>])<EOL>for j in range(len(u.spe)-<NUM_LIT:1>):<EOL><INDENT>temp = <NUM_LIT:0.><EOL>for i in range(len(used_masses)-<NUM_LIT:1>):<EOL><INDENT>dm_i = abs(used_masses[i+<NUM_LIT:1>]-used_masses[i])<EOL>temp = float(self.mass_frac[i][j]*dm_i/dm_tot) + temp<EOL><DEDENT>average_mass_frac.append(temp)<EOL><DEDENT><DEDENT>elif  len(used_masses) == <NUM_LIT:1>:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>somma = <NUM_LIT:0.><EOL>somma = sum(average_mass_frac)<EOL>print('<STR_LIT>',abs(<NUM_LIT:1.> - somma))<EOL>if i_decay == <NUM_LIT:2>:<EOL><INDENT>global average_mass_frac_decay<EOL>average_mass_frac_decay = []<EOL>dm_tot = abs(used_masses[len(used_masses)-<NUM_LIT:1>]-used_masses[<NUM_LIT:0>])<EOL>for j in range(len(u.back_ind)):<EOL><INDENT>temp = <NUM_LIT:0.><EOL>for i in range(len(used_masses)-<NUM_LIT:1>):<EOL><INDENT>dm_i = abs(used_masses[i+<NUM_LIT:1>]-used_masses[i])<EOL>temp = float(decayed_multi_d[i][j]*dm_i/dm_tot) + temp<EOL><DEDENT>average_mass_frac_decay.append(temp)<EOL><DEDENT>somma = <NUM_LIT:0.><EOL>somma = sum(average_mass_frac_decay)<EOL>print('<STR_LIT>',abs(<NUM_LIT:1.> - somma))<EOL><DEDENT>
Interface to average over mass_range.

Parameters
----------
mass_range : list
    A 1x2 array required to plot data in a certain mass range.
    Needed for _read_iso_abund_marco.
cycle : integer
    which cycle from the h5 file?.  Needed for _read_iso_abund_marco
stable : boolean
    Do you want to plot only stable or not.
i_decay : integer
    If i_decay is 1, then plot not decayed.  If i_decay is 2,
    then plot decayed.  Make sense only if stable is true.

See Also
--------
_read_iso_abund_marco()