Esempio n. 1
0
def preprocess_T(imap, dust_removal=False, dust_template=None, box=None, auto_adj=False):
    omap = enmap.submap(imap[0], box=box)
    if dust_removal:
        dust = enmap.submap(dust_template[0], box=box)
        if auto_adj:
            par, _ = leastsq(lambda x: np.ravel(omap-x*dust), x0=1)
            factor = par[0]
        else: factor = 1
        print("factor:", factor)
        omap -= dust * factor
    return omap
Esempio n. 2
0
def preprocess_P(imap, dust_removal=None, smooth=None, box=None):
    omap = np.sum(imap[1:]**2, axis=0)**0.5
    if dust_removal is not None:
        omap -= np.sum(dust_removal[1:]**2, axis=0)**0.5
    if smooth is not None:
        omap = enmap.smooth_gauss(omap, smooth * u.fwhm * u.arcmin)
    return enmap.submap(omap, box=box)
Esempio n. 3
0
def getSubmaps_originalPixelization(theMap, ras_deg, decs_deg, semiWidth_deg):
    '''From the original pixelization of the map, extract a list of submaps.
    theMap_fname: map to extract submaps from
    ra_deg, dec_deg: arrays of ra and decs in degrees
    semiWidth_deg: half of the width of the submap to be extracted in degrees.
    '''
    boxes = gen_boxes(ras_deg, decs_deg, semiWidth_deg)
    submaps = []
    for box in boxes:
        submaps.append(enmap.submap(theMap, box))
    return submaps
Esempio n. 4
0
def getSubmap_originalPixelization(theMap, ra_deg, dec_deg, semiWidth_deg):
    '''Receives theMap and gets a submap centered in ra,dec with width
    semiWidth_deg'''
    box = gen_box(ra_deg, dec_deg, semiWidth_deg)
    submap = enmap.submap(theMap, box)
    return submap