Пример #1
0
def test8Fn():
    tempProf = readInputProfile(getParentDirPath('defaultTempProfile'))
    precProf = readInputProfile(getParentDirPath('defaultPrecProfile'))
    outProf = OutputProfile(kColorTableDefault, defaultOceanColor, defaultUnknownColor)

    outputPath = getTestDirPath('test8-out.png')
    tempnsPath, tempnwPath, precnsPath, precnwPath = getProfiaInputs()

    comparePath = getTestDirPath('ProfiaOutputDefault.png')

    outputToFile(outputPath, buildOutput(tempnsPath, tempnwPath, precnsPath, precnwPath, tempProf, precProf, outProf))

    return compareImages(outputPath, comparePath)
Пример #2
0
def test10Fn():
    correctError = False
    try:
        tempProf = readInputProfile(getTestDirPath('testBrokenTempProfile'))
    except SKCCError as e:
        if (str(e) == 'Invalid RGB color in input profile: (275, 225, 140)'):
            correctError = True
        else:
            raise
    return correctError
Пример #3
0
def test9Fn():
    tempProf = InputProfile(tColorTableDefault, [defaultOceanColor])
    precProf = readInputProfile(getParentDirPath('altPrecProfile'))
    outProf = OutputProfile(kColorTableDefault, defaultOceanColor, defaultUnknownColor)

    outputPath = getTestDirPath('test9-out.png')
    tempnsPath, tempnwPath, precnsPath, precnwPath = getBallInputs()

    comparePath = getTestDirPath('BallOutput.png')

    outputToFile(outputPath, buildOutput(tempnsPath, tempnwPath, precnsPath, precnwPath, tempProf, precProf, outProf))

    return compareImages(outputPath, comparePath)
Пример #4
0
         tempFileNameNS = a[1]
 if a[0] == '-p' or a[0] == '--precnw':
     if a[1] == '':
         optErr()
     else:
         precFileNameNW = a[1]
 if a[0] == '-q' or a[0] == '--precns':
     if a[1] == '':
         optErr()
     else:
         precFileNameNS = a[1]
 if a[0] == '-v' or a[0] == '--tempprof':
     if a[1] == '':
         optErr()
     else:
         tempProfile = readInputProfile(a[1])
 if a[0] == '-r' or a[0] == '--precprof':
     if a[1] == '':
         optErr()
     else:
         precProfile = readInputProfile(a[1])
 if a[0] == '-k' or a[0] == '--outprof':
     if a[1] == '':
         optErr()
     else:
         # Output profiles differ by mode
         if (mode == 'koppen'):
             outProfile = readAndValidateKoppenOutputProfile(a[1])
         elif (mode == 'holdridge'):
             outProfile = readAndValidateHoldridgeOutputProfile(
                 a[1])