<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def trajectory(self, ini, end, delta, mass_coo, age_in_sec=False, online=False):
 """ create a trajectory out of a stellar model Parameters ini : integer Initial model, inital cycle number. end : integer Final model, final cycle number. delta : integer Sparsity factor of the frames. mass_coo : float Mass coordinate for the traj. age_in_sec : boolean, optional Set to True if age in se file is in seconds (like in MESA). The default is False. Returns -------- float radius_at_mass_coo, density_at_mass_coo, temperature_at_mass_coo, age_all Notes ----- plus writes a file with the trajectory information to be used with ppn. Warning: remove the old trajectory, if you have any for the same mass coordinate. You are appending data, not overwriting. Update: this method works for output types with indexes going from the outside in (MESA) or the other way around. Also the requested quantities are linearly interpolated in the mass shell. online: boolean, optional are you working online in the ipython notebook? If so, you will be given an HTML link to download the file. """


        filename='traj_'+str(mass_coo)+'.dat'
        f = open(filename,'a')
        radius_at_mass_coo=[]
        density_at_mass_coo=[]
        temperature_at_mass_coo=[]
        masses=self.se.get(list(range(ini,end+1,delta)),'mass')
        temps=self.se.get(list(range(ini,end+1,delta)),'temperature')
        rhos=self.se.get(list(range(ini,end+1,delta)),'rho')
        radii=self.se.get(list(range(ini,end+1,delta)),'radius')
        ages=self.se.get(list(range(ini,end+1,delta)),'age')
        cycs=list(range(ini,end+1,delta))
        age_all=[]
        for i in range(len(ages)):
            age=ages[i]
            if age_in_sec:
                age /= constants.one_year
            mass=masses[i]
            temperature=temps[i]
            rho=rhos[i]
            radius=radii[i]
            my_things=[temperature,rho,radius]

            if mass[0]>mass[len(mass)-1]:
                zone_above=where(mass>mass_coo)[0][-1]
                zone_below=zone_above+1
            else:
                zone_above=where(mass>mass_coo)[0][0]
                zone_below=zone_above-1

            if mass[zone_below]>mass[zone_above]:
                sys.exit("ERROR: finding of zone index confused")
            all_things_interplt=[]
            for thing in my_things:
                thing_interplt=thing[zone_below]+(mass_coo-mass[zone_below])* \
                    (thing[zone_above]-thing[zone_below])/(mass[zone_above]-mass[zone_below])
                all_things_interplt.append(thing_interplt)
            this_temperature,this_rho,this_radius=all_things_interplt

            string = str(cycs[i])+'  '+str(age)+'  '+str(this_temperature)+'  '+str(this_rho)
            f.write(string+"\n")
            radius_at_mass_coo.append(this_radius)
            density_at_mass_coo.append(this_rho)
            temperature_at_mass_coo.append(this_temperature)
            age_all.append(age)
        f.close()
        if online:
            return FileLink(filename)

        return radius_at_mass_coo, density_at_mass_coo, temperature_at_mass_coo, age_all