Ignore:
Timestamp:
Jan 21, 2009, 4:37:45 PM (15 years ago)
Author:
ole
Message:

Various cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/polygon.py

    r6189 r6223  
    661661    """
    662662
    663     def __init__(self, regions, default=0.0, geo_reference=None):
     663    def __init__(self,
     664                 regions,
     665                 default=0.0,
     666                 geo_reference=None):
    664667
    665668        try:
     
    702705        for polygon, value in regions:
    703706            P = geo_reference.change_points_geo_ref(polygon)
    704             self.regions.append( (P, value) )
     707            self.regions.append((P, value))
    705708
    706709
     
    714717        assert len(y) == N
    715718
    716         points = num.concatenate( (num.reshape(x, (N, 1)),
    717                                    num.reshape(y, (N, 1))), axis=1 )
     719        points = num.concatenate((num.reshape(x, (N, 1)),
     720                                  num.reshape(y, (N, 1))), axis=1)
    718721
    719722        if callable(self.default):
     
    735738                    z[i] = value
    736739
     740        if len(z) == 0:
     741            msg = 'Warning: points provided to Polygon function did not fall within'
     742            msg += 'its regions'
     743            msg += 'x in [%.2f, %.2f], y in [%.2f, %.2f]' % (min(x), max(x),
     744                                                             min(y), max(y))
     745            print msg
     746
     747           
    737748        return z
    738749
Note: See TracChangeset for help on using the changeset viewer.