def METHOD_NAME(filename, nx, ny, nz, dtype_str, headersize):
    """
    docstring, woo!
    Parameters
    ----------
    filename : String
        The name of the file to open
    nx : integer
        The number of data elements in the x-direction
    ny : integer
        The number of data elements in the y-direction
    nz : integer
        The number of data elements in the z-direction
    dtype_str : str
        A valid argument for np.dtype(some_str). See read_binary.dsize
        attribute
    headersize : integer
        The size of the file header in bytes
    Returns
    -------
    data : ndarray
            data.shape = (x, y, z) if z > 1
            data.shape = (x, y) if z == 1
            data.shape = (x,) if y == 1 && z == 1
    header : String
            header = file.read(headersize)
    """
    # open the file
    with open(filename, "rb") as opened_file:
        # read the file header
        header = opened_file.read(headersize)
        # read the entire file in as 1D list
        data = np.fromfile(file=opened_file, dtype=np.dtype(dtype_str), count=-1)
    # reshape the array to 3D
    if nz != 1:
        data.resize(nx, ny, nz)
    # unless the 3rd dimension is 1, in which case reshape the array to 2D
    elif ny != 1:
        data.resize(nx, ny)
    # unless the 2nd dimension is also 1, in which case leave the array as 1D
    # return the array and the header
    return data, header