gravelamps.interpolator.grid¶
Handles the generation and validation of the grid for the interpolators.
- gravelamps.interpolator.grid.generate_grid_files(config: ConfigParser, fp: str, grid_type: str, num_files: int = 1) None¶
Generate grid file(s).
- Parameters:
- config: ConfigParser
INI configuration values.
- fp: str
Path to save grid file to
- grid_type: str
Grid axis name e.g. dimensionless_frequency.
- num_files: int, optional, default=1
Number of files to make for axis. Will append “-n” to fp as naming scheme.
- Raises:
- AttributeError
If the specified function is not a numpy function.
- ValueError
If more files than grid points is requested.
- gravelamps.interpolator.grid.validate_grid_files(config: ConfigParser, file_dict: dict) None¶
Validates that the grid files of the file dictionary are present and can be loaded by numpy.
If the files are not currently extant, will use the config options to generate them.
- Parameters:
- config: ConfigParser
INI configuration values.
- file_dict: dict
File paths to the different file types. Should contain dimensionless_frequency and source_position keys.
- Raises:
- KeyError
If either grid file type is missing from dictionary
- AttributeError
If the specified function is not a numpy function