def reprocess_wfc3ir(parallel=False, cpu_count=0, clean_dark_refs=True):
    """
    Run reprocessing script to flatten IR backgrounds
    
    """
    if parallel:
        import matplotlib as mpl
        mpl.rcParams['backend'] = 'agg'
    import glob
    import os
    import astropy.io.fits as pyfits
    try:
        from reprocess_wfc3 import reprocess_wfc3
    except:
        try:
            from mywfc3 import reprocess_wfc3
        except:
            print(
                """
    Couldn't `import reprocess_wfc3`.  
    Get it from https://github.com/gbrammer/reprocess_wfc3 """
                )
            return False
    print('\ngrizli.pipeline.reprocess: Fetch calibrations...\n')
    files = glob.glob('*raw.fits')
    for file in files:
        reprocess_wfc3.fetch_calibs(file, ftpdir=
            'https://hst-crds.stsci.edu/unchecked_get/references/hst/',
            verbose=False)
    if parallel:
        files = glob.glob('*raw.fits')
        files.sort()
        reprocess_wfc3.show_ramps_parallel(files, cpu_count=cpu_count)
        files = glob.glob('*raw.fits')
        files.sort()
        reprocess_wfc3.reprocess_parallel(files, cpu_count=cpu_count)
    else:
        files = glob.glob('*raw.fits')
        files.sort()
        for file in files:
            if not os.path.exists(file.replace('raw.fits', 'ramp.png')):
                reprocess_wfc3.show_MultiAccum_reads(raw=file, stats_region
                    =[[300, 700], [300, 700]])
        for file in files:
            if not os.path.exists(file.replace('raw.fits', 'flt.fits')):
                reprocess_wfc3.make_IMA_FLT(raw=file, stats_region=[[300, 
                    700], [300, 700]])
    if clean_dark_refs:
        files = glob.glob('*raw.fits')
        files.sort()
        for file in files:
            im = pyfits.open(file)
            dark_file = im[0].header['DARKFILE'].replace('iref$', '')
            dark_file = os.path.join(os.getenv('iref'), dark_file)
            im.close()
            if os.path.exists(dark_file):
                print('clean_dark: {0}'.format(dark_file))
                os.remove(dark_file)
