check_rays¶
-
salsa.utils.check_rays(ray_dir, n_rays, fields, parallel=True)¶ Check if a directory already contains a given number of trident lrays and contains necessary fields
- Parameters
ray_dir (str) – The path to the directory where rays are held
n_rays (int) – The number of lrays that should be in the directory
fields (list, str) – List of the fields needed in each light ray
- Returns
ray_bool – True if there are n_rays in the ray_dir and each one contains necessary fields. If no rays are found then returns False. Otherwise if the rays found don’t match requirements an error is raised (see below).
- Return type
bool
- Raises
RuntimeError – This is raised if there are a non-zero number of rays but they don’t match the specified number of rays, don’t contain the specified fields, or simply can’t be opened.