0

I keep getting this error and was wondering what was triggering it. This is my function definition:

def spectMixGen(M, samp_size, source_pdf = "uniform", pdf_pars = 1,
    pure_pixels = 'no', max_purity = np.ones((1, p)), 
    no_outliers = 0, violation_extremes = [1, 1.2],
    am_modulation = [1, 1], sig_variability = [1, 1],              
    snr = 40, noise_shape = 'uniform',
    noise_pars = [0, 1, 1])

and this is my function call:

spectMixGen(M, N, source_pdf = 'Diri_id', pdf_pars = SHAPE_PARAMETER, 
    max_purity = MAX_PURIRY*np.ones((1,p)), no_outliers = OUTLIERS, 
    violation_extremes = [1,1.2], snr = SNR, noise_shape = 'uniform')

The error points to this part of my code:

if (source_pdf == "Diri_mix"):
    no_modes, cols = pdf_pars.shape
    if cols is not (p+1):
        raise ValueError("Wrong pdf parameters")
    elif (np.sum(pdf_pars[:,1] != 1)) or (np.sum(pdf_pars[:,1] < 0) > 0):
        raise ValueError("Wrong pdf parameters -> mixing weights  do not define a probability")

with the message:

AttributeError: 'str' object has no attribute 'equals'

Can anyone explain this error? I though that the function call sets the variable source_pdf equal to a string. Is this not the case?

Thanks

A.Torres
  • 413
  • 1
  • 6
  • 16

0 Answers0