i_albedo.py 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. """
  2. ***************************************************************************
  3. i_albedo.py
  4. -----------
  5. Date : February 2016
  6. Copyright : (C) 2016 by Médéric Ribreux
  7. Email : medspx at medspx dot fr
  8. ***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************
  16. """
  17. __author__ = 'Médéric Ribreux'
  18. __date__ = 'March 2016'
  19. __copyright__ = '(C) 2016, Médéric Ribreux'
  20. from .i import verifyRasterNum
  21. def checkParameterValuesBeforeExecuting(alg, parameters, context):
  22. if alg.parameterAsBoolean(parameters, '-m', context):
  23. return verifyRasterNum(alg, parameters, context, 'input', 7)
  24. elif alg.parameterAsBoolean(parameters, '-n', context):
  25. return verifyRasterNum(alg, parameters, context, 'input', 2)
  26. elif (alg.parameterAsBoolean(parameters, '-l', context)
  27. or alg.parameterAsBoolean(parameters, '-a', context)):
  28. return verifyRasterNum(alg, parameters, context, 'input', 6)
  29. return True, None