def METHOD_NAME(pfile,output,outname,pos='Position',weight='Mass',dataset='0/',resolution=1.0,value='Value',norm='global'):
    """ Takes a MP-Gadget output file (bigfile, formatted /PART_XYZ/ptype/prop/...) and builds grids of the desired property 
        Positional Arguments:
            pfile: path to particle file
            output: path to output bigfile
            outname: dataset name to save
        Keyword Arguments:
            resolution: desired output resolution (Mpc h-1)
            pos: name of position column (usually 'Position')
            weight: name of weighting column (usually 'Mass')
            value: name of the vlaue column (desired property)
            dataset: name of particle dataset
            norm: 'global' => normalise the output grids by the global mean (weight*value / global mean)
                  'local' => divide by mass grid (average value in cell)
                  'none' => do not normalise (grid is weight*value in cell)
        Defaults produce a 1+delta field of gas
    """
    comm = MPI.COMM_WORLD
    cat = BigFileCatalog(pfile,dataset=dataset,header='Header')
    BoxSize = cat.attrs['BoxSize'] / 1000
    Redshift = 1/cat.attrs['Time'] - 1
    Nmesh = int(BoxSize / resolution)
    # round it to 8.
    Nmesh -= Nmesh % 8
    if comm.rank == 0:
        logger.info("source = %s", pfile)
        logger.info("output = %s", output)
        logger.info("Weight = %s",weight)
        logger.info("Value = %s",value)
        logger.info("BoxSize = %g", BoxSize)
        logger.info("Redshift = %g", Redshift)
        logger.info("Nmesh = %g", Nmesh)
    #particle field
    mesh = cat.to_mesh(Nmesh=Nmesh,weight=weight,value=value,position=pos,compensated=True)    
    #mesh = cat.to_mesh(Nmesh=Nmesh,value=value,position=pos,compensated=True)    
    #TODO: nbodykit has a save function which does almost everything below, but doesn't have the option for a non-normalised field
    # we sometimes need: mass-weighted & globally normalized (density)
    # mass-weighted & locally normalised (neutral fraction, local J21)
    # particle-weighted & not normalised (SFR)
    # mass-weighted & not normalised (Stellar Mass)
    #mesh.save(f'{outname}.bigfile')
    #'''
    field = mesh.to_real_field(normalize=(norm=='global'))
    if norm == 'local':
        mesh_mass = cat.to_mesh(Nmesh=Nmesh,weight=weight,position=pos,compensated=True)
        #mesh_mass = cat.to_mesh(Nmesh=Nmesh,weight=weight,position=pos)
        field_mass = mesh_mass.to_real_field(normalize=False)
        field[...] /= field_mass[...]
    meshmean = field.cmean()
    meshshape = field.cshape
    meshsize = field.csize
    if comm.rank == 0:
        logger.info("mean %s per cell = %s, grid size %s (%s)", value, meshmean,meshshape,meshsize)
    data = np.empty(shape=field.size, dtype=field.dtype)
    field.ravel(out=data)
    with bigfile.BigFileMPI(comm, output, create=True) as ff:
        with ff.create_from_array(outname, data) as bb:
            bb.attrs['BoxSize'] = BoxSize
            bb.attrs['Redshift'] = Redshift
            bb.attrs['Nmesh'] = Nmesh
    #'''
    if comm.rank == 0:
        logger.info("done. written at %s / %s", output, outname)