Beispiel #1
0
def ferret_custom_axes(id):
    """
    Custom axis information for stats_probplot_values Ferret PyEF
    """
    size = 1
    for axis in (pyferret.X_AXIS, pyferret.Y_AXIS, pyferret.Z_AXIS,
                 pyferret.T_AXIS, pyferret.E_AXIS, pyferret.F_AXIS):
        axis_info = pyferret.get_axis_info(id, pyferret.ARG1, axis)
        # Note: axes normal to the data have size = -1
        num = axis_info.get("size", -1)
        if num > 1:
            size *= num
    axis_defs = [None] * pyferret.MAX_FERRET_NDIM
    axis_defs[0] = (
        1,
        size,
        1,
        "VALUE_NUM",
        False,
    )
    axis_defs[1] = (
        1,
        3,
        1,
        "OSM,ORD,P",
        False,
    )
    return axis_defs
Beispiel #2
0
def ferret_custom_axes(id):
    """
    Define custom axis of the stats_ttest1 Ferret PyEF
    """
    arglen = 1
    for axis in ( pyferret.X_AXIS, pyferret.Y_AXIS, pyferret.Z_AXIS, 
                  pyferret.T_AXIS, pyferret.E_AXIS, pyferret.F_AXIS ):
        axis_info = pyferret.get_axis_info(id, pyferret.ARG2, axis)
        num = axis_info.get("size", -1)
        if num > 0:
            arglen *= num
    # if all axes have undefined lengths, assume it is a single value
    axis_defs = [ None ] * pyferret.MAX_FERRET_NDIM
    axis_defs[0] = ( 1, 2, 1, "T,P", False )
    axis_defs[1] = (1, arglen, 1, "MEAN_INDEX", False)
    return axis_defs
Beispiel #3
0
def ferret_result_limits(efid):
    '''
    Provides the bounds of the E abstract axis.  
    The maximum number of EOFs is the number of locations. 
    '''
    maxeofs = pyferret.get_arg_one_val(efid, pyferret.ARG3)
    if maxeofs > 0.95:
        maxeofs = int(maxeofs + 0.1)
    else:
        maxeofs = 1
        for axis in (pyferret.X_AXIS, pyferret.Y_AXIS, pyferret.Z_AXIS):
            axis_info = pyferret.get_axis_info(efid, pyferret.ARG1, axis)
            if axis_info:
                npts = axis_info.get("size", -1)
                if npts > 0:
                    maxeofs *= npts
    result_limits = [None] * pyferret.MAX_FERRET_NDIM
    result_limits[pyferret.E_AXIS] = (1, maxeofs + 1)
    return result_limits