def get_band_params(meta, fmt='presto'):
    """
    Returns (fmin, fmax, nchans) given a metadata dictionary loaded from
    a specific file format.
    """
    if fmt == 'presto':
        fbot = meta['fbot']
        nchans = meta['nchan']
        ftop = fbot + nchans * meta['cbw']
        fmin = min(fbot, ftop)
        fmax = max(fbot, ftop)
    elif fmt == 'sigproc':
        raise ValueError("Cannot parse observing band parameters from data in sigproc format")
    else:
        raise ValueError(f"Unknown format: {fmt}")
    return fmin, fmax, nchans