Beispiel #1
0
def assign_tes_grid(obsdate=None):
    '''
    make a 17x17 array with TES id's
    '''
    pix_grid = assign_pix_grid()
    TES2PIX = assign_pix2tes(obsdate)
    tes_grid = np.recarray(names='PIX,TES,ASIC',
                           formats='int,int,int',
                           shape=pix_grid.shape)

    nrows = pix_grid.shape[0]
    ncols = pix_grid.shape[1]

    for row in range(nrows):
        for col in range(ncols):
            tes_grid[row, col].PIX = 0
            tes_grid[row, col].TES = 0
            tes_grid[row, col].ASIC = 0

            # the pixel identity associated with its physical location in the array
            physpix = pix_grid[row, col]
            tes_grid[row, col].PIX = physpix
            pix_index = physpix - 1
            if physpix != 0:
                for asic_ctr in range(2):
                    asic = asic_ctr + 1
                    asic_idx = ASIC_index(asic)

                    if physpix in TES2PIX[asic_idx]:
                        TES = pix2tes(physpix)[0]
                        TES_idx = TES - 1
                        tes_grid[row, col].ASIC = asic
                        tes_grid[row, col].TES = TES
    return tes_grid
Beispiel #2
0
def tes2pix(TES, asic):
    global TES2PIX
    if TES2PIX is None: TES2PIX = assign_pix2tes()
    TES_idx = TES_index(TES)
    if TES_idx is None: return None
    if TES_idx == -1: return -1
    PIX = TES2PIX[ASIC_index(asic), TES_idx]
    return PIX
Beispiel #3
0
def asic_index(self):
    return ASIC_index(self.asic)