def __init__(self,snap_dir,snapnum,minpart,reload_file=False,savefile=None): if savefile==None: savefile_s=path.join(snap_dir,"snapdir_"+str(snapnum).rjust(3,'0'),"velocity_grid.hdf5") else: savefile_s = savefile HaloHI.__init__(self,snap_dir,snapnum,minpart=minpart,reload_file=reload_file,savefile=savefile_s) return
def save_file(self, save_grid=False, LLS_cut = 17., DLA_cut = 20.3): """Save the file, by default without the grid""" HaloHI.save_file(self,save_grid) #Save a list of DLA positions instead f=h5py.File(self.savefile,'r+') ind = np.where(self.sub_nHI_grid > DLA_cut) ind_LLS = np.where((self.sub_nHI_grid > LLS_cut)*(self.sub_nHI_grid < DLA_cut)) grp = f.create_group("abslists") grp.create_dataset("DLA",data=ind) grp.create_dataset("DLA_val",data=self.sub_nHI_grid[ind]) grp.create_dataset("LLS",data=ind_LLS) grp.create_dataset("LLS_val",data=self.sub_nHI_grid[ind_LLS]) f.close()
def save_file(self, save_grid=False, LLS_cut=17., DLA_cut=20.3): """Save the file, by default without the grid""" HaloHI.save_file(self, save_grid) #Save a list of DLA positions instead f = h5py.File(self.savefile, 'r+') ind = np.where(self.sub_nHI_grid > DLA_cut) ind_LLS = np.where( (self.sub_nHI_grid > LLS_cut) * (self.sub_nHI_grid < DLA_cut)) grp = f.create_group("abslists") grp.create_dataset("DLA", data=ind) grp.create_dataset("DLA_val", data=self.sub_nHI_grid[ind]) grp.create_dataset("LLS", data=ind_LLS) grp.create_dataset("LLS_val", data=self.sub_nHI_grid[ind_LLS]) f.close()