Beispiel #1
0
filtering = True
filter_length = 1000
hypers = (1e7, 1e7)
#hypers = (1e2, 1e2)
deltas = (None, 1e-8, 1e-8)
algo = lo.hacg
tol = 1e-5
maxiter = 30
#wavelet = 'haar'
wavelet = None
ext = ".fits"
pre = "ngc6946_huber_"
# to store results
sol = []
# define same header for all maps
tod, projection, header, obs = csh.load_data(filenames)
# get the weight map
weights = projection.transpose(tod.ones(tod.shape))
weights.writefits(os.path.join(output_path, pre + 'weights' + ext))
del tod, projection, obs
# find a map for each compression and save it
for comp in compressions:
    sol.append(
        csh.rls(filenames,
                compression=comp,
                hypers=hypers,
                header=header,
                factor=factor,
                algo=algo,
                deltas=deltas,
                wavelet=wavelet,
Beispiel #2
0
# define data set
datadir = os.getenv('CSH_DATA')
filenames = [datadir + '/1342185454_blue_PreparedFrames.fits[5954:67614]',
             datadir + '/1342185455_blue_PreparedFrames.fits[5954:67615]']
# no compression
output_path = os.path.join(os.getenv('HOME'), 'data', 'csh', 'output',)
# compression modes
compressions = ["", "ca", "cs"]
#compressions = ["ca"]
# median filter length
deglitch=True
covariance=True
filtering = True
filter_length = 10000
hypers = (1e9, 1e9)
ext = ".fits"
pre = "ngc6946_rls_cov_"
# to store results
sol = []
# define same header for all maps
tod, projection, header, obs = csh.load_data(filenames[0])
del tod, projection, obs
# find a map for each compression and save it
for comp in compressions:
    sol.append(csh.rls(filenames, compression=comp, hypers=hypers, 
                       header=header,
                       deglitch=deglitch, covariance=covariance,
                       filtering=filtering, filter_length=filter_length))
    fname = os.path.join(output_path, pre + comp + ext)
    sol[-1].writefits(fname)
#compressions = [""]
factor=8
# median filter length
deglitch=True
covariance=False
filtering = False
filter_length = 10000
#hypers = (1e9, 1e9)
hypers = (1e0, 1e0)
#hypers = (0., 0.)
ext = ".fits"
pre = "matrix"
# to store results
M = []
# define same header for all maps
tod, projection, header, obs = csh.load_data(filenames)
# get the weight map
weights = projection.transpose(tod.ones(tod.shape))
#weights.writefits(os.path.join(output_path, pre + 'weights' + ext))
del tod, projection, obs
# choose a small portion of the map (in the center)
# center the new map
n = 64
header['CRPIX1'] -= header['NAXIS1'] / 2 - n / 2
header['CRPIX2'] -= header['NAXIS2'] / 2 - n / 2
# correct for wrong centering
#header['CRPIX1'] += 7
#header['CRPIX2'] += 7
# 
header['NAXIS1'] = n
header['NAXIS2'] = n