utils package

Submodules

utils.histogram module

histogram_routine_gpu(lens_model_complete, Numblocks, macroimindx, Nblock, Nresidue, x1corn, x2corn, Lblock, binnum, binmin, binmax, Scale, kwargs_lens, y0, y1, dx)[source]

Obtain F(t) by constructing histogram of time delay function within the given window.

Parameters:
  • lens_model_complete – lens models of the system.

  • Numblocks – number of boxes with Nblock inside.

  • macroimindx

  • Nblock – number of pixels in a box.

  • Nredisude – number of pixels not in a box.

  • x1corn – x-coordinate of the lower side of the window.

  • x2corn – y-coordinate of the left side of the window.

  • Lblock – size of the integration block.

  • binnum – total number of steps.

  • binmin – lower bound of the time integration.

  • binmax – upper bound of the time integration.

  • Scale – Einstein radius of the system.

  • kwargs_lens – arguments of the lens models.

  • y0 – x-coordinate of source position.

  • y1 – y-coordinate of source position.

  • dx – integration step of the window covering lens place.

Returns:

histogram of F(t).

histogram_routine_cpu(lens_model_complete, Numblocks, macroimindx, Nblock, Nresidue, x1corn, x2corn, Lblock, binnum, binmin, binmax, Scale, kwargs_lens, y0, y1, dx)[source]

Obtain F(t) by constructing histogram of time delay function within the given window.

Parameters:
  • lens_model_complete – lens models of the system.

  • Numblocks – number of boxes with Nblock inside.

  • macroimindx

  • Nblock – number of pixels in a box.

  • Nredisude – number of pixels not in a box.

  • x1corn – x-coordinate of the lower side of the window.

  • x2corn – y-coordinate of the left side of the window.

  • Lblock – size of the integration block.

  • binnum – total number of steps.

  • binmin – lower bound of the time integration.

  • binmax – upper bound of the time integration.

  • Scale – Einstein radius of the system.

  • kwargs_lens – arguments of the lens models.

  • y0 – x-coordinate of source position.

  • y1 – y-coordinate of source position.

  • dx – integration step of the window covering lens place.

Returns:

histogram of F(t).

utils.utils module

fitfuncF0(t, F0, a, c)[source]

Fitting function of power law

Parameters:
  • t – independent variable.

  • F0 – costant that the power law converges to.

  • a – parameter multiplying the variable.

  • c – exponent parameter to the variable.

Returns:

fitted power law function.

fitfunc(t, a, b, c)[source]

Fitting function of power law

Parameters:
  • t – independent variable.

  • a – parameter multiplying the variable.

  • c – exponent parameter to the variable.

Returns:

fitted power law function.

gridfromcorn(x1corn, x2corn, dx, num1, num2)[source]

Construct blocks for integration.

Parameters:
  • x1corn – x-coordinate of the left bottom corner of the block.

  • x2corn – y-coordinate of the left bottom corner of the block.

  • dx – steps of integration window.

  • num1 – number of points on the horizontal side of the box.

  • num2 – number of points on the vertical side of the box.

Returns:

numpy meshgrid of the box.

coswindowback(data, percent)[source]

Cosine apodization function for a percentage of points at the end of a timeseries of length len(data)

Parameters:
  • data – data to apodize.

  • percent – percentage of data being apodized.

Returns:

apodized results.

F_tilde_extend(ts, F_tilde, kwargs_macro, kwargs)[source]

Extend the function with fitted power law.

Parameters:
  • ts – time series.

  • F_tilde – data.

  • kwargs – arguments for integration.

Returns:

extended ts and F_tilde.

iwFourier(ts, Ft, dt=1e-06)[source]

Fourier transform the time series data.

Parameters:
  • ts – time series

  • Ft – data

  • type2 – boolean, if True, use the appropriate time step for type 2 image.

Returns:

sampling frequency and transformed data in frequency domain.

smooth(y, box_pts)[source]
Morse_indices(lens_model_list, xs, ys, kwargs)[source]
Parameters:
  • lens_model_list – list of lens models.

  • xs – x-coordinates of position on lens plane.

  • ys – y-coordinates of position on lens plane.

Kwargs:

arguemnts for the lens models.

Returns:

morse indices of the input positions.

compute_geometrical(geofs, mus, tds, ns)[source]
Parameters:
  • geofs – frequency series to compute geometrical optics

  • mus – magnifications of images

  • tds – time delays of images

  • ns – morse indices of images

Returns:

geometrical optics magnification factor

Einstein_radius(zL, zS, mL)[source]
Parameters:
  • zL – redshift where the lens locates

  • zS – redshift where the source locates

  • mL – lens mass

Returns:

Einstein radius of the lens system

Module contents