def initialize_fits(filename,tel_id, file_closed):  
    hdulist = file_closed
    if file_closed == 1:
        hdulist = load_fits(filename)
        teles = hdulist[1].data
        ld.telescope = teles["TelID"].tolist()  
    else:
        pass
    index = ld.telescope_id.index(tel_id)
    ld.mirror_area.append(hdulist[1].data[index]["MirrorArea"])
    
    if file_closed == 1:
        util_functions.close_fits(hdulist)
def initialize_telescope(filename, file_closed = True):
    ld.clear_lists_telescope()
    ld.clear_lists_camera()
    ld.clear_lists_optics()

    if 'simtel.gz' in filename:
        file_closed = TD.initialize_hessio(filename,file_closed)
        for tel in ld.telescope_id:
            CD.initialize_hessio(filename,tel,file_closed)
            OD.initialize_hessio(filename,tel,file_closed)
        util_functions.close_hessio()

    elif 'fits' in filename:
        file_closed = TD.initialize_fits(filename,file_closed)
        for tel in ld.telescope_id:
            CD.initialize_fits(filename,tel,file_closed)
            OD.initialize_fits(filename,tel,file_closed)
        util_functions.close_fits(file_closed)
def initialize_telescope(filename, file_closed=True):
    ld.clear_lists_telescope()
    ld.clear_lists_camera()
    ld.clear_lists_optics()

    if 'simtel.gz' in filename:
        file_closed = TD.initialize_hessio(filename, file_closed)
        for tel in ld.telescope_id:
            CD.initialize_hessio(filename, tel, file_closed)
            OD.initialize_hessio(filename, tel, file_closed)
        util_functions.close_hessio()

    elif 'fits' in filename:
        file_closed = TD.initialize_fits(filename, file_closed)
        for tel in ld.telescope_id:
            CD.initialize_fits(filename, tel, file_closed)
            OD.initialize_fits(filename, tel, file_closed)
        util_functions.close_fits(file_closed)
Пример #4
0
def initialize_fits(filename, tel_id, file_closed):
    hdulist = file_closed
    if file_closed == 1:
        hdulist = util_functions.load_fits(filename)
        teles = hdulist[1].data
        ld.telescope = teles["TelID"].tolist()
    else:
        pass

    index = ld.telescope_id.index(tel_id)
    ld.camera_fov.append(hdulist[1].data[index]["FOV"])

    pixel_id_cam = []
    index2 = np.where(hdulist[2].data['L0ID'] == index)[0]
    for i in index2:
        pixel_id_cam.append(hdulist[2].data[i]['PixelID'])
    ld.pixel_id.append(pixel_id_cam)

    if file_closed == 1:
        util_functions.close_fits(hdulist)
def initialize_fits(filename,tel_id, file_closed):
    hdulist = file_closed
    if file_closed == 1:
        hdulist = util_functions.load_fits(filename)
        teles = hdulist[1].data
        ld.telescope = teles["TelID"].tolist()
    else:
        pass
    
    index = ld.telescope_id.index(tel_id)
    ld.camera_fov.append(hdulist[1].data[index]["FOV"])
    
    pixel_id_cam = []
    index2 = np.where(hdulist[2].data['L0ID'] == index)[0]
    for i in index2:
        pixel_id_cam.append(hdulist[2].data[i]['PixelID'])
    ld.pixel_id.append(pixel_id_cam)
    
    if file_closed == 1:
        util_functions.close_fits(hdulist)