PtclTableCache¶
- class halotools.sim_manager.PtclTableCache(read_log_from_standard_loc=True, **kwargs)[source]¶
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.
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, ...)Methods Documentation
- determine_log_entry_from_fname(fname, overwrite_fname_metadata=False)[source]¶
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:
- fnamestring
Name of the file
- Returns:
- log_entry
PtclTableCacheLogEntry
instance
- log_entry
- remove_entry_from_cache_log(simname, version_name, redshift, fname, raise_non_existence_exception=True, update_ascii=True, delete_corresponding_ptcl_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 particle catalogs in your cache. The simnames processed by Halotools are ‘bolshoi’, ‘bolplanck’, ‘consuelo’ and ‘multidark’.
- version_namestring
Nickname of the version of the particle catalog.
- redshiftstring or float
Redshift of the particle catalog, rounded to 4 decimal places.
- fnamestring
Name of the hdf5 file storing the table of particles.
- 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_ptcl_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/ptcl_table_cache_log.txt’, clean the log of any repeated entries, sort the log, and return the resulting list of
PtclTableCacheLogEntry
instances.