API
pipeline
- pipeline_evaluation_NN.cl_flat(Lx, Ly, Nx, Ny, mpq, mpu, lmax, mask, beam_amin=None, w22_file='w22_flat_320_320.fits')
not correcting for the beam: takes about 18mins
- pipeline_evaluation_NN.first_normalization(maps_out_3Q, maps_out_3U, gauss_ss_mean_std)
Normalize the small scales w.r.t. Gaussian case in the map level;
maps_out_3Q/U: small scales generated from the Neural Network. With shape: (174, 49, 320, 320); gauss_ss_mean_std: mean and std for each patch of small scales of Gaussian realization, defined by the ratio: Gaussian_maps_3amin/Gaussian_maps_20amin; 4 in 1: Q_mean, Q_std, U_mean, U_std. With shape (4, 174, 49).
- pipeline_evaluation_NN.get_one_MF(Thr, NNout, patch_N)
Defined for output at 3amin, [174,49, 320, 320] calculate MFs of generated NN small scales and overlapping with Intensity small scales
- pipeline_evaluation_NN.plot_maps(Nico_20amin, maps_out_3, NNmap_corr, m=36, n=4)
map visualization; maps at 20 amin; output from NN; renormalize the NN output and combine with the large scales m: sky_position. 0-174 n: patch_position in the 7*7 square
- pipeline_evaluation_NN.second_normalization(maps_out_3Q, maps_out_3U, gauss_ss_ps, gauss_ss_mean_std, Nico_20amin_Q, Nico_20amin_U, lmin=560, lmax=3500)
Normalize the small scales w.r.t. Gaussian case in the power spectra level, after the first normalization.
maps_out_3Q/U: small scales after the first normalization; With shape: (174, 49, 320, 320); gauss_ss_ps: power spectra for each patch of small scales of Gaussian realization; 2 in 1: cl_QQ and cl_UU; with shape: (2, 174, 49, 1, 25).
post-training
- class after_training12amin.post_training(NNout_Q, NNout_U, training_files_Q, training_file_U, MF=True)
All processes after the training. training_files_Q/U; input training files for the NN, shape:(2, 348, 320, 320)
- cl_sphere(nside, msk_apo, map_QU, lmax, nlbins, w22_file='w22_2048_full_sky.fits')
nside: msk_apo: apodized mask nlbins: ell-number in each bin
- first_normalization(gauss_ss_mean_std)
Normalize the small scales w.r.t. Gaussian case in the map level;
:param
maps_out_12Q/U: small scales generated from the Neural Network. With shape: (174, 320, 320); gauss_ss_mean_std: mean and std for each patch of small scales of Gaussian realization, defined by the ratio: Gaussian_maps_12amin/Gaussian_maps_80amin; 4 in 1: Q_mean, Q_std, U_mean, U_std. With shape (4, 174).
Returns
normalized maps.
- get_one_MF(input_maps, npatches=174, patch_N=False)
Defined for output at 12amin, [174, 320, 320] or for ordinary maps with shape [174, 320, 320] for nn output at 12amin, npatches = 174; for intensity small scales, npatch = 174;
Returns
rhos: threshold values, normally [-1, 1] f, u, chi : three kinds of MFs for each patch
- normalization(gauss_ss_ps, gauss_ss_mean_std, Ls_Q, Ls_U, mask_path='mask_320*320.npy', lmin=560, lmax=3500)
Normalize the small scales w.r.t. Gaussian case in the power spectra level and multiply with the large scales to get a full-resolution maps, after the first normalization.
:param
maps_out_12Q/U: small scales after the first normalization; With shape: (174, 320, 320); gauss_ss_ps: power spectra for each patch of small scales of Gaussian realization; 2 in 1: cl_QQ and cl_UU; with shape: (2, 174, 1, 25). Ls_Q/U: large scales, same as the input for the training; with shape (348,320,320).
Returns
patches of full resolution maps with physical units.
- power_spectra_full_sky()
full-sky EE/BB power spectra
- power_spectra_patch(n, w22_file='w22_flat_320_320.fits', mask_path='mask_320*320.npy')
plot EE/BB power spectra for each flat patch of sky. For Large scales only, Large scales with gaussian small scales; Large scales with ForSE small scales.
- reproject_to_fullsky()
salloc –nodes 4 –qos interactive –time 00:30:00 –constraint cpu –account=mp107 module load tensorflow/2.6.0 srun -n 16 python reproject2fullsky_mpi.py –pixelsize 3.75 –npix 320 –overlap 2 –verbose –flat-projection /pscratch/sd/j/jianyao/forse_processed_data/NN_out_Q_12amin_physical_units_from_real_Nico.npy –flat2hpx –nside 2048 –apodization-file /global/homes/j/jianyao/Small_Scale_Foreground/mask_320*320.npy –adaptive-reprojection
srun -n 16 python reproject2fullsky_mpi.py –pixelsize 0.9375 –npix 1280 –overlap 2 –verbose –flat-projection /pscratch/sd/j/jianyao/forse_output/Nico_Q_20amin_20x20_1280.npy –flat2hpx –nside 4096 –apodization-file /global/homes/j/jianyao/Small_Scale_Foreground/mask_1280*1280.npy –adaptive-reprojection
- visualization(stokes, n)
map visualization; maps at 80 amin; ss_only output from NN; renormalize the NN output and combine with the large scales n: patch_position
needs to set the color scale fixed