def __init__(self,parFile='Fg.par'): # print 'init ...' par=readPar(parFile) self.Path1=par['Path1'] self.Path2=par['Path2'] self.Nx=par['Nx'] self.Ny=par['Ny'] self.Nz=par['Nz'] self.h =par['h'] self.Om0=par['Om0'] self.bins=par['bins'] self.ICn=par['ICn'] self.PCn=par['PCn']
#!/usr/bin/env python # coding=utf-8 import numpy as np import matplotlib.pyplot as plt from PCA import PCA from ICA import ICA from getGridPk import getGridPk from read_par import readPar from read import ReadMeta #============================================================ PathPar='Fg.par'# parameter file par=readPar(PathPar) print par Path1=par['Path1'] Path2=par['Path2'] path_data_wigglez='/home/ycli/data/wigglez/gbt_15hr_41-80_pointcorr/reg15data.npy' #========= Load data ======================================== data_wig=np.load(path_data_wigglez)[:,10:-10,5:-5] data=np.load(Path1) freq,ra,dec=ReadMeta(Path1) data=np.load(Path1)[:,10:-10,5:-5] ra=ra[10:-10] dec=dec[5:-5] data*=1000 # converse unit to mK #========== run PCA ========================================= pca=PCA(PathPar) pca.PcaInit(freq=freq,ra=ra,dec=dec,data=data) data_clean_pca=pca.RunPca() #pca.Plot() #plt.savefig('png/meanMapWithPCA.png')