foscat.FoCUS#

Attributes#

Classes#

Module Contents#

foscat.FoCUS.TMPFILE_VERSION = 'V14_0'#
class foscat.FoCUS.FoCUS(NORIENT=4, LAMBDA=1.2, KERNELSZ=3, slope=1.0, all_type='float32', nstep_max=20, padding='SAME', gpupos=0, mask_thres=None, mask_norm=False, isMPI=False, TEMPLATE_PATH=None, BACKEND='torch', use_2D=False, use_1D=False, return_data=False, DODIV=False, use_median=False, InitWave=None, silent=True, mpi_size=1, mpi_rank=0)[source]#
TMPFILE_VERSION = 'V14_0'#
P1_dic = None#
P2_dic = None#
isMPI = False#
mask_thres = None#
mask_norm = False#
InitWave = None#
mask_mask = None#
mpi_size = 1#
mpi_rank = 0#
return_data = False#
silent = True#
use_median = False#
kernel_smooth#
padding_smooth#
kernelR_conv#
kernelI_conv#
padding_conv#
down#
up#
TEMPLATE_PATH = None#
number_of_loss = 0#
history#
nlog = 0#
padding = 'SAME'#
use_2D = False#
use_1D = False#
all_type = 'float32'#
BACKEND = 'torch'#
all_bk_type = Ellipsis#
all_cbk_type = Ellipsis#
gpulist#
ngpu = 1#
rank = 0#
gpupos#
NORIENT = 4#
LAMBDA = 1.2#
slope = 1.0#
R_off = 1#
ww_Real#
ww_Imag#
ww_CNN_Transpose#
ww_CNN#
X_CNN#
Y_CNN#
Z_CNN#
Idx_CNN#
Idx_WCNN#
filters_set#
edge_masks#
KERNELSZ = 3#
Idx_Neighbours#
w_smooth#
pix_interp_val#
weight_interp_val#
ring2nest#
ampnorm#
loss#
dtype_dcode_map#
dtype_code_map#
get_dtype_code(dtype)[source]#
get_type()[source]#
get_mpi_type()[source]#
conv_to_FoCUS(x, axis=0)[source]#
diffang(a, b)[source]#
corr_idx_wXX(x, y)[source]#
calc_indices_convol(nside, kernel, rotation=None)[source]#
save_index(filepath, data, offset=0, count=None)[source]#

Save an N-dimensional NumPy array with shape (N, …) to binary file. A 12x int64 header is written, describing dtype and shape beyond axis 0.

Header layout (12 x int64): [0] = dtype code (0=int64, 1=int32, 2=float32, 3=float64, 4=complex64, 5=complex128) [1] = number of extra dimensions (i.e., data.ndim - 1) [2:12] = shape[1:] padded with zeros

Parameters: - filepath: target binary file path - data: NumPy array with shape (N, …) - offset: number of items to skip on axis 0 - count: number of items to write on axis 0 (default: rest of the array)

read_index(filepath, offset=0, count=None)[source]#

Load a NumPy array from a binary file with a 12x int64 header.

Header layout: [0] = dtype code [1] = number of extra dimensions (D) [2:2+D] = shape[1:] of each sample (shape after axis 0)

Parameters: - filepath: path to the binary file - offset: number of samples to skip on axis 0 - count: number of samples to read (default: all remaining)

Returns: - data: NumPy array with shape (count, …) and correct dtype

healpix_layer(im, ww, indices=None, weights=None)[source]#
get_rank()[source]#
get_size()[source]#
barrier()[source]#
toring(image, axis=0)[source]#
ud_grade(im, j, axis=0, cell_ids=None, nside=None)[source]#
ud_grade_2(im, axis=0, cell_ids=None, nside=None, max_poll=False)[source]#
up_grade(im, nout, axis=-1, nouty=None, cell_ids=None, o_cell_ids=None, force_init_index=False, nside=None)[source]#
fill_1d(i_arr, nullval=0)[source]#
fill_2d(i_arr, nullval=0)[source]#
fill_healpy(i_map, nmax=10, nullval=hp.UNSEEN)[source]#
ud_grade_1d(im, nout, axis=0)[source]#
up_grade_2_1d(im, axis=0)[source]#
convol_1d(im, axis=0)[source]#
smooth_1d(im, axis=0)[source]#
up_grade_1d(im, nout, axis=0)[source]#
init_index(nside, kernel=-1, cell_ids=None, spin=0)[source]#
init_index_cnn(nside, NORIENT=4, kernel=-1, cell_ids=None)[source]#
swapaxes(x, axis1, axis2)[source]#
masked_mean(x, mask, rank=0, calc_var=False)[source]#
reduce_dim(x, axis=0)[source]#
conv2d(image, ww, axis=0)[source]#
diff_data(x, y, is_complex=True, sigma=None)[source]#
convol(in_image, axis=0, cell_ids=None, nside=None, spin=0)[source]#
smooth(in_image, axis=0, cell_ids=None, nside=None, spin=0)[source]#
get_kernel_size()[source]#
get_nb_orient()[source]#
get_ww(nside=1)[source]#
plot_ww()[source]#