pyfan.amto.array.geomspace

Created on May 24, 2018

@author: fan

To have a better grid denser at the beginning

Module Contents

Functions

grid_to_geom_short(choice_grid, choice_grid_max, choice_grid_min, start, stop, num, geom_ratio, a)

grid_to_geom_short_core(choice_grid, a, scaler, displacement, multiplier, geom_ratio)

grid_to_geom(choice_grid, choice_grid_max, choice_grid_min, start, stop, num, geom_ratio, a)

the code now is under the assumption that initial start and end were 0 and 1

gen_geom_grid(start, stop, num, geom_ratio, a)

Specify geom_ratio, the z below:

tester(a=1, b=51, max_power=49)

  1. 1 to 51, geomspace

tester_plus1(a=0, b=50, max_power=49, adjust=1)

to accomndate zero,

pyfan.amto.array.geomspace.logger[source]
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

pyfan.amto.array.geomspace.tester(a=1, b=51, max_power=49)[source]
  1. 1 to 51, geomspace

pyfan.amto.array.geomspace.tester_plus1(a=0, b=50, max_power=49, adjust=1)[source]

to accomndate zero,

pyfan.amto.array.geomspace.FORMAT = %(filename)s - %(funcName)s - %(lineno)d - %(asctime)s - %(levelname)s %(message)s[source]