def out_fname_prefix(fmt='clb-%s-%s-r%04d-%s', **kwa):
    """Returns output file name prefix like "doc-cxid9114-cspad_0001-r0116-pixel_rms"
    """
    exp = kwa.get('experiment', 'exp')
    det = kwa.get('detector', 'det')
    run = int(kwa.get('run', 0))
    ctype = kwa.get('ctype', 'ctype')
    return fmt % (exp, det, run, ctype)