def METHOD_NAME(outfile, skycorr):
    """Write sky model.
    Args:
        outfile : filename or (night, expid, camera) tuple
        skycorr : SkyCorr object
    """
    from .util import fitsheader, makepath
    log = get_logger()
    outfile = makepath(outfile, 'skycorr')
    #- Convert header to fits.Header if needed
    hdr = fitsheader(skycorr.header)
    hx = fits.HDUList()
    hdr['EXTNAME'] = 'WAVELENGTH'
    hx.append( fits.PrimaryHDU(skycorr.wave.astype('f8'), header=hdr) )
    hx.append( fits.ImageHDU(skycorr.dwave.astype('f4'), name='DWAVE') )
    hx.append( fits.ImageHDU(skycorr.dlsf.astype('f4'), name='DLSF') )
    hx['DWAVE'].header['BUNIT'] = 'Angstrom'
    hx['DLSF'].header['BUNIT'] = 'Angstrom'
    t0 = time.time()
    tmpfile = get_tempfilename(outfile)
    hx.writeto(tmpfile, overwrite=True, checksum=True)
    os.rename(tmpfile, outfile)
    duration = time.time() - t0
    log.info(iotime.format('write', outfile, duration))
    return outfile