예제 #1
0
    def test_web2array( self ):

        colours = ((255,0,0),(255,255,255),(0,0,255) )
        wparray =  \
          mb.web2array(url = 'http://www.subsurfwiki.org/mediawiki/'+
                       'images/4/41/Modelr_test_ellipse.png',
              colours = colours)

        # Test to make sure only valid colours made it in.
        for i in wparray[:,100,:]:
            self.assertTrue( (i[0],i[1],i[2]) in colours )
예제 #2
0
파일: mb_test.py 프로젝트: xian-ran/modelr
    def test_web2array(self):

        colours = ((255, 0, 0), (255, 255, 255), (0, 0, 255))
        wparray =  \
          mb.web2array(url = 'http://www.subsurfwiki.org/mediawiki/'+
                       'images/4/41/Modelr_test_ellipse.png',
              colours = colours)

        # Test to make sure only valid colours made it in.
        for i in wparray[:, 100, :]:
            self.assertTrue((i[0], i[1], i[2]) in colours)
예제 #3
0
def run_script(args):
    matplotlib.interactive(False)
 
    Rprop0 = args.Rock0 
    Rprop1 = args.Rock1
    Rprop2 = args.Rock2
    Rprop3 = args.Rock3
    
    colourmap = {}

    if isinstance(Rprop0, str):
        Rprop0 = None
    else:
        colourmap[rgb(255,255,255)] = Rprop0 
        
    if isinstance(Rprop1, str):
        Rprop1 = None
    else:
        colourmap[rgb( 255,0,0 )] = Rprop1 
        
    if isinstance(Rprop2, str):
        Rprop2 = None
    else:
        colourmap[rgb( 0,0,255 )] = Rprop2 
        
    if isinstance(Rprop3, str):
        Rprop3 = None
    else:
        colourmap[3] = Rprop3 
    
    if not isinstance(args.rocks, int):
        colours = 0
    else:
        colours = args.rocks

    
    colours = ((255,255,255),(255,0,0), (0,0,255) )
    model = mb.web2array(args.url,
                         colours = colours
                         )
    
    return modelr_plot( model, colourmap, args )
예제 #4
0
def run_script(args):
    matplotlib.interactive(False)

    Rprop0 = args.Rock0
    Rprop1 = args.Rock1
    Rprop2 = args.Rock2
    Rprop3 = args.Rock3

    colourmap = {}

    if isinstance(Rprop0, str):
        Rprop0 = None
    else:
        colourmap[rgb(255, 255, 255)] = Rprop0

    if isinstance(Rprop1, str):
        Rprop1 = None
    else:
        colourmap[rgb(255, 0, 0)] = Rprop1

    if isinstance(Rprop2, str):
        Rprop2 = None
    else:
        colourmap[rgb(0, 0, 255)] = Rprop2

    if isinstance(Rprop3, str):
        Rprop3 = None
    else:
        colourmap[3] = Rprop3

    if not isinstance(args.rocks, int):
        colours = 0
    else:
        colours = args.rocks

    colours = ((255, 255, 255), (255, 0, 0), (0, 0, 255))
    model = mb.web2array(args.url, colours=colours)

    return modelr_plot(model, colourmap, args)