PtclTableCache

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

Bases: object

Object providing a collection of particle 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 PtclTableCacheLogEntry 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/ptcl_table_cache_log.txt’, clean the log of any repeated entries, sort the log, and return the resulting list of PtclTableCacheLogEntry 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 PtclTableCacheLogEntry 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 : PtclTableCacheLogEntry instance

matching_log_entry_generator(dz_tol=0.0, **kwargs)[source] [edit on github]
remove_entry_from_cache_log(simname, version_name, redshift, fname, raise_non_existence_exception=True, update_ascii=True, delete_corresponding_ptcl_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 particle catalogs in your cache. The simnames processed by Halotools are ‘bolshoi’, ‘bolplanck’, ‘consuelo’ and ‘multidark’.

version_name : string

Nickname of the version of the particle catalog.

redshift : string or float

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

fname : string

Name of the hdf5 file storing the table of particles.

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_ptcl_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/ptcl_table_cache_log.txt’, clean the log of any repeated entries, sort the log, and return the resulting list of PtclTableCacheLogEntry 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]