def abund_at_masscoordinate(self, ini, mass_coo, online=False):
age=self.se.get(ini,'<STR_LIT>')<EOL>mass=self.se.get(ini,'<STR_LIT>')<EOL>temperature=self.se.get(ini,'<STR_LIT>')<EOL>rho=self.se.get(ini,'<STR_LIT>')<EOL>abund_string = self.se.dcols[<NUM_LIT:5>]<EOL>print(abund_string)<EOL>if online:<EOL><INDENT>from IPython.display import FileLink, FileLinks<EOL><DEDENT>tm=type(mass_coo)<EOL>if tm is not list:<EOL><INDENT>filename='<STR_LIT>'+str(mass_coo)+'<STR_LIT>'<EOL>f = open(filename,'<STR_LIT:w>')<EOL>zone=np.abs(mass-mass_coo).argmin()<EOL>abunds=self.se.get(ini,abund_string)[zone]<EOL>mass_coo_new=mass[zone]<EOL><DEDENT>else:<EOL><INDENT>filename='<STR_LIT>'+str(mass_coo[<NUM_LIT:0>])+'<STR_LIT:_>'+str(mass_coo[<NUM_LIT:1>])+'<STR_LIT>'<EOL>f = open(filename,'<STR_LIT:w>')<EOL>idx1=np.abs(mass-mass_coo[<NUM_LIT:0>]).argmin()<EOL>idx2=np.abs(mass-mass_coo[<NUM_LIT:1>]).argmin()<EOL>dm=np.diff(np.insert(mass,<NUM_LIT:0>,<NUM_LIT:0.>))<EOL>dm=dm[idx1:idx2]<EOL>totmass=sum(dm)<EOL>abunds=self.se.get(ini,abund_string)[idx1:idx2]<EOL>dmabunds=[abunds[i]*dm[i] for i in range(len(dm))]<EOL>abundsum=np.zeros(len(self.se.isotopes))<EOL>for i in range(len(abundsum)):<EOL><INDENT>abundsum[i]=sum([vec[i] for vec in dmabunds])<EOL><DEDENT>abunds=old_div(abundsum, totmass)<EOL>
Create a file with distribution at a given mass coord, and at
a given time step.

This for instance may be used as intial distribution for
function trajectory, to reproduce local conditions in ppn.

Parameters
----------
ini : integer
    Initial model, inital cycle number.
mass_coo : float or 1x2 list
    Mass coordinate for the traj.
    If list, return mass-averaged abundances for the region
    spanned by the list.
online: boolean, optional
    are you working online in the ipython notebook? If so,
    you will be given an HTML link to download the file.