mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-05-14 06:31:11 +00:00
Add galaxy sampling (#88)
* Improve calculations * Improve flags * Add smoothed options * Remove some old comments * Edit little things * Save smoothed * Move files * Edit imports * Edit imports * Renaming imports * Renaming imports * Sort imports * Sort files * Sorting * Optionally make copies of the field * Add quijote backup check * Add direct field smoothing * Shorten stupid documentation * Shorten stupid docs * Update conversion * Add particles to ASCII conversion * Add a short comment * Add SDSS uncorrected distance * Adjust comment * Add FITS index to galaxies * Remove spare space * Remove a stupid line * Remove blank line * Make space separated * Add interpolated field path * Add field sampling * Sort imports * Return density in cells * Clear out observer velocity * Add 170817 sampling * Fix normalization * Update plot
This commit is contained in:
parent
0af925e26a
commit
eccd8e3507
26 changed files with 610 additions and 365 deletions
|
@ -37,22 +37,14 @@ except ModuleNotFoundError:
|
|||
def get_nsims(args, paths):
|
||||
"""
|
||||
Get simulation indices from the command line arguments.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
args : argparse.Namespace
|
||||
Command line arguments. Must include `nsims` and `simname`. If `nsims`
|
||||
is `None` or `-1`, all simulations in `simname` are used.
|
||||
paths : :py:class`csiborgtools.paths.Paths`
|
||||
Paths object.
|
||||
|
||||
Returns
|
||||
-------
|
||||
nsims : list of int
|
||||
Simulation indices.
|
||||
"""
|
||||
try:
|
||||
from_quijote_backup = args.from_quijote_backup
|
||||
except AttributeError:
|
||||
from_quijote_backup = False
|
||||
|
||||
if args.nsims is None or args.nsims[0] == -1:
|
||||
nsims = paths.get_ics(args.simname, args.from_quijote_backup)
|
||||
nsims = paths.get_ics(args.simname, from_quijote_backup)
|
||||
else:
|
||||
nsims = args.nsims
|
||||
return list(nsims)
|
||||
|
@ -81,8 +73,7 @@ def read_single_catalogue(args, config, nsim, run, rmax, paths, nobs=None):
|
|||
|
||||
Returns
|
||||
-------
|
||||
cat : csiborgtools.read.CSiBORGHaloCatalogue or csiborgtools.read.QuijoteHaloCatalogue # noqa
|
||||
Halo catalogue with selection criteria applied.
|
||||
`csiborgtools.read.CSiBORGHaloCatalogue` or `csiborgtools.read.QuijoteHaloCatalogue` # noqa
|
||||
"""
|
||||
selection = config.get(run, None)
|
||||
if selection is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue