timothydmorton / isochrones

Pythonic stellar model grid access; easy MCMC fitting of stellar properties
http://isochrones.readthedocs.org
MIT License
117 stars 63 forks source link

isochrones crashes when reloading some hdf file #83

Open wkerzendorf opened 5 years ago

wkerzendorf commented 5 years ago
[gaia_src_2014636873563874816_this_is_a_h5.txt](https://github.com/timothydmorton/isochrones/files/2958481/gaia_src_2014636873563874816_this_is_a_h5.txt)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-57-2bba10b5cdca> in <module>
----> 1 StarModel.load_hdf(fname)

~/python/isochrones/isochrones/starmodel.py in load_hdf(cls, filename, path, name)
   1233         store.close()
   1234 
-> 1235         obs = ObservationTree.load_hdf(filename, path+'/obs', ic=ic)
   1236 
   1237         mod = cls(ic, obs=obs,

~/python/isochrones/isochrones/observation.py in load_hdf(cls, filename, path, ic)
    870             raise
    871         df = store[path+'/df']
--> 872         new = cls.from_df(df)
    873 
    874         if ic is None:

~/python/isochrones/isochrones/observation.py in from_df(cls, df, **kwargs)
    777                         for _,s in g.iterrows()]
    778             obs = Observation(n, b, g.resolution.mean(),
--> 779                               sources=sources, relative=g.relative.any())
    780             tree.add_observation(obs)
    781 

~/python/isochrones/isochrones/observation.py in __init__(self, name, band, resolution, sources, relative)
    632 
    633         self.relative = relative
--> 634         self._set_reference()
    635 
    636     def observe(self, stars, unc, ic=None):

~/python/isochrones/isochrones/observation.py in _set_reference(self)
    698         """
    699         if len(self.sources) > 0:
--> 700             self.brightest.is_reference = True
    701 
    702     def __str__(self):

AttributeError: 'NoneType' object has no attribute 'is_reference'
timothydmorton commented 4 years ago

Is this still an issue? Can you reproduce?