pyfan.amto.array.geomspace
¶
Created on May 24, 2018
@author: fan
To have a better grid denser at the beginning
Module Contents¶
Functions¶
|
|
|
|
|
the code now is under the assumption that initial start and end were 0 and 1 |
|
Specify geom_ratio, the z below: |
|
|
|
to accomndate zero, |
-
pyfan.amto.array.geomspace.
grid_to_geom_short
(choice_grid, choice_grid_max, choice_grid_min, start, stop, num, geom_ratio, a)[source]¶
-
pyfan.amto.array.geomspace.
grid_to_geom_short_core
(choice_grid, a, scaler, displacement, multiplier, geom_ratio)[source]¶
-
pyfan.amto.array.geomspace.
grid_to_geom
(choice_grid, choice_grid_max, choice_grid_min, start, stop, num, geom_ratio, a)[source]¶ the code now is under the assumption that initial start and end were 0 and 1
Given geom_grid results, how do we go back to actual data grid. So for interpolation. interpolate not on actual K and B scales, but on any even grid, as long as the grid count is right.
interp_K_grid = np.linspace(0,1,n)
but then there is a vector of actual choices kn_vec, how to map kn_vec to interp_K_grid?
- Parameters
- choice_grid:
this is the choice grid, on the actual choice scale
- start: float
from gen_geom_grid
- stop: float
from gen_geom_grid
- num: int
from gen_geom_grid
- geom_ratio: float
from gen_geom_grid
-
pyfan.amto.array.geomspace.
gen_geom_grid
(start, stop, num, geom_ratio, a)[source]¶ - Specify geom_ratio, the z below:
a*z^0=a a*z^1 a*z^2 … … a*z^49=b
Then generate the grid points that is consistent with the geom_ratio
- Parameters
- start: float
same as in linspace
- stop: float
same as in linspace
- num: int
same as in linspace
- geom_ratio: float
z value below kind of except for rescaling