def ZAToYo( ZA ) :
    """Returns yo designator for ZA.  This mapping is not one-to-one as example
    ZA = 1001 could be yo = 2 or 12.  The smaller yo values is returned."""

    ZA_ = ZA
    if( ZA_ > 10 ) and ( ZA_ < 20 ) : ZA_ -= 10
    if ZA_ in [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1001, 1002, 1003, 2003, 2004 ] :
        if ( ZA_ == 0 ) : return 7
        if ( ZA_ < 1001 ) : return ZA_
        if ( ZA_ == 1001 ) : return 2
        if ( ZA_ == 1002 ) : return 3
        if ( ZA_ == 1003 ) : return 4
        if ( ZA_ == 2003 ) : return 5
        if ( ZA_ == 2004 ) : return 6
    raise Exception( "\nError in ZAToYo: unsupported ZA value = %s" % repr(ZA) )