HaloTableCache

class halotools.sim_manager.HaloTableCache(read_log_from_standard_loc=True, **kwargs)[source] [edit on github]

Bases: object

Object providing a collection of halo catalogs for use with Halotools.

Methods Summary

add_entry_to_cache_log(log_entry[, update_ascii])
determine_log_entry_from_fname(fname[, …]) Method tries to construct a HaloTableCacheLogEntry using the metadata that may be stored in the input file.
matching_log_entry_generator([dz_tol])
remove_entry_from_cache_log(simname, …[, …]) If the log stores an entry matching the input metadata, the entry will be deleted and the ascii file storing the log will be updated.
retrieve_log_from_ascii() Read ‘$HOME/.astropy/cache/halotools/halo_table_cache_log.txt’, clean the log of any repeated entries, sort the log, and return the resulting list of HaloTableCacheLogEntry instances.
update_cached_file_location(new_fname, …)
Parameters:
update_log_from_current_ascii()

Methods Documentation

add_entry_to_cache_log(log_entry, update_ascii=True)[source] [edit on github]
determine_log_entry_from_fname(fname, overwrite_fname_metadata=False)[source] [edit on github]

Method tries to construct a HaloTableCacheLogEntry using the metadata that may be stored in the input file. An exception will be raised if the determination is not possible.

Parameters:

fname : string

Name of the file

Returns:

log_entry : HaloTableCacheLogEntry instance

matching_log_entry_generator(dz_tol=0.0, **kwargs)[source] [edit on github]
remove_entry_from_cache_log(simname, halo_finder, version_name, redshift, fname, raise_non_existence_exception=True, update_ascii=True, delete_corresponding_halo_catalog=False)[source] [edit on github]

If the log stores an entry matching the input metadata, the entry will be deleted and the ascii file storing the log will be updated. If there is no match, an exception will be raised according to the value of the input raise_non_existence_exception.

Parameters:

simname : string

Nickname of the simulation used as a shorthand way to keep track of the halo catalogs in your cache. The simnames processed by Halotools are ‘bolshoi’, ‘bolplanck’, ‘consuelo’ and ‘multidark’.

halo_finder : string

Nickname of the halo-finder, e.g., ‘rockstar’ or ‘bdm’.

version_name : string

Nickname of the version of the halo catalog used to differentiate between the same halo catalog processed in different ways.

redshift : string or float

Redshift of the halo catalog, rounded to 4 decimal places.

fname : string

Name of the hdf5 file storing the table of halos.

raise_non_existence_exception : bool, optional

If True, an exception will be raised if this function is called and there is no matching entry in the log. Default is True.

delete_corresponding_halo_catalog : bool, optional

If set to True, when the log entry is deleted, the corresponding hdf5 file will be deleted from your disk. Default is False.

retrieve_log_from_ascii()[source] [edit on github]

Read ‘$HOME/.astropy/cache/halotools/halo_table_cache_log.txt’, clean the log of any repeated entries, sort the log, and return the resulting list of HaloTableCacheLogEntry instances.

update_cached_file_location(new_fname, old_fname, **kwargs)[source] [edit on github]
Parameters:

new_fname : string

Name of the new location of the file

old_fname : string

Name of the old location of the file

update_log_from_current_ascii()[source] [edit on github]