Python Documentation¶
interpolator module¶
cosmology module¶
occupation_p module¶
halo_model module¶
gadget_file module¶
-
class
scampy.gadget_file.
gadget_file
(filebase, byteorder='little', ids_lenght=8, masstab=True)¶ A class for reading GaDGET SUBFIND subgroup tables
- Parameters
filebase (string) – common name of the files to be read
byteorder (string) – ‘little’ or ‘big’ for little or big endian, respectively
ids_lenght (int) – number of bytes of the integer storing the IDs (8 or 16)
masstab (bool) – whether the file contains mass tables
-
read_file
(num, scale_mass=10000000000.0, scale_lenght=0.001, add_to_internal=False, verbose=False)¶ Reads the num`^th file in `base
- Parameters
num (int) – file to read
scale_mass (float) – mass unit (in terms of solar masses, default = 1.e+10)
scale_lenght (float) – lenght unit (in terms of Mpc/h, default = 1.e-3)
add_to_internal (bool) – whether to add the data to the internal storage array of the class (default = False)
verbose (bool) – whether to print on screen additional info (default = False)
- Returns
- Return type
None
-
read_header
(num=0)¶ Reads only the Header of the num`^th file in `base
- Parameters
num (the file number to read) –
- Returns
loc (dictionary with meta-data local to file num)
glob (dictionary with meta-data global to all files in base)
objects module¶
catalogue module¶
-
scampy.catalogue.
extract_galaxies
(hhaloes, ngxy)¶ Extracts objects of type galaxy from an host halo catalogue :param hhaloes: :type hhaloes: the input host-halo catalogue :param ngxy: in the input catalogue :type ngxy: the number of galaxies hosted by all the host haloes
- Returns
- Return type
numpy array containing ngxy galaxies
-
class
scampy.catalogue.
catalogue
(X=None, scale_lenght=0.001, scale_mass=10000000000.0, boxsize=None)¶ Class to handle catalogues of objects of type halo, host_halo, galaxy
-
Nhost
(mask=None)¶ Return the total number of host haloes (central + satellites)
- Parameters
mask (array-like) – Array mask for filtering the original catalogue
- Returns
- Return type
int
-
get_coord_cen
(store=False)¶ Get the coordinates of all the central objects in the catalogue
- Parameters
store (whether to store the returned array into an internal variable ( default = False )) –
- Returns
- Return type
Array of central objects coordinates ( shape = ( n_central, 3 ) )
-
get_coord_sat
(store=False)¶ Get the coordinates of all the satellite objects in the catalogue
- Parameters
store (whether to store the returned array into an internal variable ( default = False )) –
- Returns
- Return type
Array of satellite objects coordinates ( shape = ( n_satellites, 3 ) )
-
get_mass_cen
(store=False)¶ Get the masses of all the central objects in the catalogue
- Parameters
store (whether to store the returned array into an internal variable ( default = False )) –
- Returns
- Return type
Array of central objects mass ( shape = ( n_central, ) )
-
get_mass_halo
(store=False)¶ Get the masses of
- Parameters
store (whether to store the returned array into an internal variable ( default = False )) –
- Returns
- Return type
Array of ( shape = ( n_central + n_satellites, ) )
-
get_mass_sat
(store=False)¶ Get the masses of all the satellite objects in the catalogue
- Parameters
store (whether to store the returned array into an internal variable ( default = False )) –
- Returns
- Return type
Array of satellite objects mass ( shape = ( n_satellites, ) )
-
read_hierarchy_from_gadget
(filebase, boxsize=None)¶ Reads the halo/sub-halo hierarchy from a Subgroup gadget output
- Parameters
filebase –
- Returns
- Return type
None
-
set_content
(X)¶ Add element(s) to the catalogue
- Parameters
X (array-like) –
- Returns
- Return type
None
-