Пример #1
0
import sys
from Tailor.Category import SplitRange, Range, Category, CategorySet

columnNumbers = [2, 3, 4, 5]

regions = {
            "A" : (Range(-180, 0), Range(-90, 90)),
            "B" : (Range(-180, 0), Range(90, 180)),
            "R" : (Range(-180, 0), Range(-180, 180)),
            "L" : (Range(0, 180), Range(-180, 180)),
          }

categorySet = CategorySet(columnNumbers, regions)
categorySet.createCategoryFromRegions("A", "B")
categorySet.createCategoryFromRegions("B", "A")
categorySet.createCategoryFromRegions("R", "R")
categorySet.createCategoryFromRegions("L", "L")
categorySet.createCategoryFromRegions("L", "R")
categorySet.createCategoryFromRegions("R", "L")

categorySet.fromFile(sys.argv[1])

if len(sys.argv) == 2:
    categorySet.printResults()
    print "total", categorySet.total

else:
    selectedName = sys.argv[2]
    for member in categorySet.getCategory(selectedName):
        print "\t".join(member)
Пример #2
0
import sys
from Tailor.Category import Range, Category, CategorySet

columnNumbers = [2, 3, 4, 5, 6, 7]

regions = {
            "R" : (Range(-180, 0), Range(-180, 180)),
            "L" : (Range(0, 180), Range(-180, 180)),
            "A" : (Range(-150, -30), Range(-60, 50)),
            "a" : (Range(30, 150), Range(-30, 90)),
            "B" : (Range(-180, 30), Range(90, 180)),
          }

categorySet = CategorySet(columnNumbers, regions)
categorySet.createCategoryFromRegions("A", "A", "A")
categorySet.createCategoryFromRegions("A", "A", "B")
categorySet.createCategoryFromRegions("A", "B", "B")
categorySet.createCategoryFromRegions("A", "B", "A")
categorySet.createCategoryFromRegions("R", "R", "R")

categorySet.createCategoryFromRegions("R", "B", "a")
categorySet.createCategoryFromRegions("R", "B", "L")

categorySet.createCategoryFromRegions("R", "A", "a")
categorySet.createCategoryFromRegions("R", "A", "L")

categorySet.createCategoryFromRegions("R", "R", "L")

categorySet.createCategoryFromRegions("R", "L", "A")
categorySet.createCategoryFromRegions("R", "a", "B")
categorySet.createCategoryFromRegions("R", "L", "B")
Пример #3
0
import sys
from Tailor.Category import SplitRange, Range, Category, CategorySet

columnNumbers = [2, 3, 4, 5]

regions = {
            "R" : (Range(-180, 0), Range(-180, 180)),
            "L" : (Range(0, 180), Range(-180, 180)),
            "X" : (Range(0, 180), SplitRange(-90, 90)),
          }

categorySet = CategorySet(columnNumbers, regions)
categorySet.createCategoryFromRegions("R", "R")
categorySet.createCategoryFromRegions("L", "L")
#categorySet.createCategoryFromRegions("R", "L")
categorySet.createCategoryFromRegions("R", "X")
categorySet.createCategoryFromRegions("L", "R")

categorySet.fromFile(sys.argv[1])
categorySet.printResults()
print("total", categorySet.total)

for category in categorySet:
    for member in category:
        print(category.name, member)