astropy:docs

Catalog_Manager

class halotools.read_nbody.Catalog_Manager[source] [edit on github]

Bases: object

Container class for managing I/O of halo & particle catalogs.

Methods Summary

download_all_default_catalogs() If not already in cache, download default particle and halo catalogs from Yale website.
find_nearest_snapshot_in_cache(catalog_type) Identify the catalog in the cache directory with the closest redshift to the requested redshift.
get_simulation_properties(simname) Return a few characteristics of the input simulation.
identify_relevant_catalogs([catalog_type, ...]) Look in cache for any catalog that matches the inputs.
load_catalog([dirname, filename, ...]) Use the astropy fits reader to load the halo or particle catalog into memory.
numptcl_to_string(numptcl) Reduce the input number to a 3-character string used to encode the number of particles in the particle catalog filenames.
retrieve_catalog_filenames_from_url(url[, ...]) Get the full list of filenames available at the provided url.

Methods Documentation

download_all_default_catalogs()[source] [edit on github]

If not already in cache, download default particle and halo catalogs from Yale website.

find_nearest_snapshot_in_cache(catalog_type, scale_factor=None, redshift=None, simname='bolshoi', halo_finder='rockstar')[source] [edit on github]

Identify the catalog in the cache directory with the closest redshift to the requested redshift.

Returns:

filename : string

filename of pre-processed catalog in cache directory with closest redshift to the requested redshift

nearest_snapshot : float

Value of the scale factor of the returned catalog

get_simulation_properties(simname)[source] [edit on github]

Return a few characteristics of the input simulation.

Parameters:

simname : string

Specifies the simulation of interest, e.g., ‘bolshoi’.

Returns:

Lbox : float

Box size in Mpc/h.

particle_mass : float

Particle mass in Msun/h.

softening : float

Softening length in kpc/h.

identify_relevant_catalogs(catalog_type=None, simname=None, halo_finder=None)[source] [edit on github]

Look in cache for any catalog that matches the inputs.

Parameters:

catalog_type : string

Specifies whether we are interested in halo or particle catalogs.

simname : string

Specifies the simulation of interest, e.g., ‘bolshoi’.

halo_finder : string

Specifies the halo-finder used to generate the catalog.

Returns:

relevant_catalogs : array

array of strings of the filenames of catalogs matching the input specifications.

load_catalog(dirname=u'/Users/aphearin/.astropy/cache/halotools/halo_catalogs', filename=None, download_yn=False, url='http://www.astro.yale.edu/aphearin/Data_files/')[source] [edit on github]

Use the astropy fits reader to load the halo or particle catalog into memory.

Parameters:

dirname : string

Name of directory where filename is stored.

filename : string

Name of file being loaded into memory. Method assumes .fits file format.

download_yn : boolean, optional

If set to True, and if filename is not already stored in the cache directory, method will attempt to download the file from the provided url. If there is no corresponding file at the input url, an exception will be raised.

url : string

Web location from which to download the catalog if it is not present in the cache directory.

Returns:

catalog : object

Data structure located at the input filename.

numptcl_to_string(numptcl)[source] [edit on github]

Reduce the input number to a 3-character string used to encode the number of particles in the particle catalog filenames.

Parameters:

numptcl : float or int

Number specifying the number of particles in the downsampled catalog.

Returns:

output_string : string

3-character string used in the filename conventions of the particle data catalogs.

retrieve_catalog_filenames_from_url(url, catalog_type='halos')[source] [edit on github]

Get the full list of filenames available at the provided url.

This method uses BeautifulSoup to query the provided url for the list of files stored there. Filenames of halo catalogs are expected to begin with ‘hlist’, or they will be ignored; filenames of merger trees are expected to begin with ‘tree’.

Parameters:

url : string

Web address pointing to the directory to be searched.

catalog_type : string

Specifies what type of catalog to look for at the provided url.

Returns:

file_list : list

List of strings of filenames available for downloaded at the provided url.

Page Contents