def save_hdf(self, filename, path='<STR_LIT>', overwrite=False, append=False):
if os.path.exists(filename):<EOL><INDENT>store = pd.HDFStore(filename)<EOL>if path in store:<EOL><INDENT>store.close()<EOL>if overwrite:<EOL><INDENT>os.remove(filename)<EOL><DEDENT>elif not append:<EOL><INDENT>raise IOError('<STR_LIT>'.format(path,filename))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>store.close()<EOL><DEDENT><DEDENT>df = self.to_df()<EOL>df.to_hdf(filename, path+'<STR_LIT>')<EOL>with pd.HDFStore(filename) as store:<EOL><INDENT>attrs = store.get_storer(path+'<STR_LIT>').attrs<EOL>attrs.spectroscopy = self.spectroscopy<EOL>attrs.parallax = self.parallax<EOL>attrs.N = self._N<EOL>attrs.index = self._index<EOL>store.close()<EOL><DEDENT>
Writes all info necessary to recreate object to HDF file

Saves table of photometry in DataFrame

Saves model specification, spectroscopy, parallax to attrs