HaloTableCache

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

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]
determine_log_entry_from_fname(fname, overwrite_fname_metadata=False)[source]

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:
fnamestring

Name of the file

Returns:
log_entryHaloTableCacheLogEntry instance
matching_log_entry_generator(dz_tol=0.0, **kwargs)[source]
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]

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:
simnamestring

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_finderstring

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

version_namestring

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

redshiftstring or float

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

fnamestring

Name of the hdf5 file storing the table of halos.

raise_non_existence_exceptionbool, 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_catalogbool, 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]

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]
Parameters:
new_fnamestring

Name of the new location of the file

old_fnamestring

Name of the old location of the file

update_log_from_current_ascii()[source]