def find_torder(dic, shape):
    ndim = len(shape)

    # 1 and 2D files are flat
    if ndim < 3:
        return 'f'  # flat

    if "array" not in dic:
        warn("no array in dictionary, torder set to 'r'")
        return 'r'

    # extract the array list
    al = dic['array']['values'][0].split(',')

    # remove one dimension if non-phase parameter is present in array list
    if False in [s.startswith('phase') for s in al]:
        ndim = ndim - 1
        if ndim < 3:
            return 'f'  # flat

    if ndim == 3:
        if "phase" in al and "phase2" in al:
            if al.index("phase") > al.index("phase2"):
                return 'r'  # regular
            else:
                return 'o'  # opposite
        else:
            warn("missing phase order, torder set to 'r'")
            return 'r'

    if ndim == 4:
        if "phase" in al and "phase2" in al and "phase3" in al:
            if al.index("phase") > al.index("phase2") > al.index("phase3"):
                return 'r'  # regular
            if al.index("phase") < al.index("phase2") < al.index("phase3"):
                return 'o'  # opposite
            else:
                warn("bad phase order, torder set to 'r'")
                return 'r'
        else:
            warn("missing phase order, torder set to 'r'")
            return 'r'

    warn("No trace ordering for" + str(ndim) +
         "dimensional data, torder set to 'r'")
    return 'r'
Create a editor window that can receive the result of the rendering process
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/varian.py/find_torder--crossover with--dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/extras/completion/py/pymel/core/rendering.py/renderWindowEditor