def phase_qa(flags):
    """
    Returns the quality flag for the layer thermodynamical phase,
    as identified from the feature classification flag

    0 = none
    1 = low
    2 = medium 3 = high
    """
    return (flags & 384) >> 7