const.py 939 Bytes
Newer Older
1
2
3
4
5
6
7
8
__author__ = "Steven B. Hoek"

class Const:
    class ConstError(TypeError): pass
    def __setattr__(self,name,value):
        if name in self.__dict__:
            raise self.ConstError("Can't rebind const(%s)" % name)
        self.__dict__[name]=value
Hoek, Steven's avatar
Hoek, Steven committed
9
      
10
11
12
13
14
15
16
17
18
19
20
21
constants = Const()
constants.BYTE = 'b'
constants.UINT8 = 'B'
constants.SHORT = 'h'
constants.UINT16 = 'H'
constants.INTEGER = 'i'
constants.UINT32 = 'I'
constants.INT64 = 'q'
constants.UINT64 = 'Q'
constants.FLOAT = 'f'
constants.DOUBLE = 'd'
constants.HEADEREXT = "hdr"
22
constants.WORLDFILEXT = 'wld'
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

constants.XLLCORNER = "XLLCORNER"  
constants.YLLCORNER = "YLLCORNER"
constants.NCOLS = "ncols"
constants.NROWS = "nrows"
constants.CELLSIZE = "cellsize"
constants.NODATA_VALUE = 'NODATA_value'
constants.BYTEORDER = 'BYTEORDER'

constants.LON = 'lon'
constants.LAT = 'lat'
constants.TIME = 'time'
constants.DESC = "DESC"
constants.ASC = "ASC"
constants.epsilon = 0.0000001