code: def from_df(cls, df, **kwargs):
          
          tree = cls(**kwargs)
  
          for (n,b), g in df.groupby(['name','band']):
              #g.sort('separation', inplace=True) #ensures that the first is reference
              sources = [Source(**s[['mag','e_mag','separation','pa','relative']])
                          for _,s in g.iterrows()]
              obs = Observation(n, b, g.resolution.mean(),
                                sources=sources, relative=g.relative.any())
              tree.add_observation(obs)
  
          # For all relative mags, set reference to be brightest
  
  
  
          return tree
docs: DataFrame must have the right columns.
  
          these are: name, band, resolution, mag, e_mag, separation, pa