Simulating FAST System Noise on Blurred Maps Using Python and Pandas
import pandas as pd import numpy as np
add FAST system noise on the blur map to simulate true observed map
sigma = 800 # \mu Jy, Standard Deviation of noise
read map
filepath = '/home/wangjiaxin/final/blurred/flux_blurred_all_gal_300f.hdf5' S_df = pd.read_hdf(filepath, key='S')
xbin_df = pd.read_hdf(filepath, key='x_bin_edge') ybin_df = pd.read_hdf(filepath, key='y_bin_edge') fbin_df = pd.read_hdf(filepath, key='nu_bin_edge')
add noise
noise = np.random.normal(0, sigma, S_df.shape) newdata = S_df + noise
save
output = '/home/dyliu/Filament/TNG_100/flux_blurred_all_gal_300f_800n.hdf5' with pd.HDFStore(output, mode='w') as store: store.put('S', newdata) store.put('x_bin_edge', xbin_df) store.put('y_bin_edge', ybin_df) store.put('nu_bin_edge', fbin_df)
原文地址: https://www.cveoy.top/t/topic/nesf 著作权归作者所有。请勿转载和采集!