def initialize_camera(filename,tel_id,file_closed = True):
    if file_closed:
        ld.clear_lists_camera()
        ld.clear_lists_telescope()
    else:
        pass

    if 'simtel.gz' in filename:
        CD.initialize_hessio(filename,tel_id,file_closed)
    elif 'fits' in filename:
        CD.initialize_fits(filename,tel_id,file_closed)
def initialize_camera(filename, tel_id, file_closed=True):
    if file_closed:
        ld.clear_lists_camera()
        ld.clear_lists_telescope()
    else:
        pass

    if 'simtel.gz' in filename:
        CD.initialize_hessio(filename, tel_id, file_closed)
    elif 'fits' in filename:
        CD.initialize_fits(filename, tel_id, 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)
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)