Пример #1
0
def test3Fn():
    tempProf = InputProfile(tColorTableDefault, [defaultOceanColor])
    precProf = InputProfile(pColorTableDefault, [defaultOceanColor])
    outProf = readAndValidateKoppenOutputProfile(getParentDirPath('defaultOutputProfile'))

    outputPath = getTestDirPath('test3-out.png')
    tempnsPath, tempnwPath, precnsPath, precnwPath = getBoxesInputs()

    comparePath = getTestDirPath('BoxesOutputDefault.png')

    outputToFile(outputPath, buildOutput(tempnsPath, tempnwPath, precnsPath, precnwPath, tempProf, precProf, outProf))
                                
    return compareImages(outputPath, comparePath)
Пример #2
0
def test1Fn():
    tempProf = InputProfile(tColorTableDefault, [defaultOceanColor])
    precProf = InputProfile(pColorTableDefault, [defaultOceanColor])
    outProf = OutputProfile(kColorTableDefault, defaultOceanColor, defaultUnknownColor)

    outputPath = getTestDirPath('test1-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)
Пример #3
0
def test14Fn():
    tempProf = InputProfile(tColorTableDefault, [defaultOceanColor])
    precProf = InputProfile(pColorTableDefault, [defaultOceanColor])
    outProf = readOutputProfile(getTestDirPath('testCustomColorOceanOutputProfile2'))

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

    comparePath = getTestDirPath('ProfiaCustomOceanOutput.png')

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

    return compareImages(outputPath, comparePath)
Пример #4
0
def test6Fn():
    tempProf = InputProfile(tColorTableDefault, [defaultOceanColor])
    precProf = InputProfile(pColorTableDefault, [defaultOceanColor])
    outProf = OutputProfile(kColorTableDefault, defaultOceanColor, defaultUnknownColor)

    outputPath = getTestDirPath('test6-out.png')
    tempnsPath, tempnwPath, precnsPath, precnwPath = getProfiaInputsBadPixel()

    correctError = False
    try:
        buildOutput(tempnsPath, tempnwPath, precnsPath, precnwPath, tempProf, precProf, outProf)
    except SKCCError as e:
        if (str(e) == 'Invalid color in input data (did not match input profile): (255, 0, 0)'):
            correctError = True
        else:
            raise
    return correctError
Пример #5
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)
Пример #6
0
        except getopt.error:
            optErr()

        startTime = time.time()

        tempFileNameNW = ''
        tempFileNameNS = ''
        precFileNameNW = ''
        precFileNameNS = ''
        outfileName = ''

        # Default mode for the script is to do Köppen-Geiger climates
        mode = 'koppen'

        # Set up default color profiles
        tempProfile = InputProfile(tColorTableDefault, [defaultOceanColor])
        precProfile = InputProfile(pColorTableDefault, [defaultOceanColor])

        outProfile = OutputProfile(kColorTableDefault, defaultOceanColor,
                                   defaultUnknownColor)

        quiet = False
        # Parse options - debug, help, version, and mode flags either must come before or they
        # override certain other flags, so they must be parsed first.
        for a in options[:]:
            if a[0] == '-d' or a[0] == '--debug':
                debug = True
        for a in options[:]:
            if a[0] == '-h' or a[0] == '--help':
                usage()
        for a in options[:]: