Example #1
0
 def setUp(self):
     eg = data_downscaler.EmissGroup()
     eg.set_dimension(90, 90)
     for y in range(90):
         for x in range(90):
             tmp = data_downscaler.EmissData()
             tmp.conc = y * 10 + x + 5.0
             tmp.lat = -7 + y * 0.01
             tmp.lon = 107 + x * 0.01
             tmp.x, tmp.y = utm.convert_to_utm(tmp.lat, tmp.lon)
             eg.append_data(tmp)
     self.eg = eg
 def setUp(self): 
     eg = data_downscaler.EmissGroup()
     eg.set_dimension(90, 90)
     for y in range(90):
         for x in range(90):
             tmp = data_downscaler.EmissData()
             tmp.conc = y*10 + x + 5.0
             tmp.lat = -7 + y*0.01
             tmp.lon = 107 + x*0.01
             tmp.x, tmp.y = utm.convert_to_utm(tmp.lat, tmp.lon)
             eg.append_data(tmp)
     self.eg = eg
Example #3
0
 def process_to_utm(self, force=False):
     """ 
     Memproses lat/lon menjadi x, y, zone & hem
     Harus dipanggil sebelum menggunakan fungsi-fungsi yang ada dalam subclass
     """
     if (force == False) and self.processed_to_utm:
         return False
     flag = False
     try:
         self.zone, self.hem = utm.get_zone_hem(self.lat, self.lon)
         self.x, self.y = utm.convert_to_utm(self.lat, self.lon)
         flag = True
         self.processed_to_utm = True
     except Exception as ex:
         print 'Exception: process_to_utm -->', ex
     return flag
Example #4
0
 def process_to_utm(self, force=False):
     """ 
     Memproses lat/lon menjadi x, y, zone & hem
     Harus dipanggil sebelum menggunakan fungsi-fungsi yang ada dalam subclass
     """
     if (force == False) and self.processed_to_utm:
         return False
     flag = False
     try:
         self.zone, self.hem = utm.get_zone_hem(self.lat, self.lon)
         self.x, self.y      = utm.convert_to_utm(self.lat, self.lon)
         flag                = True
         self.processed_to_utm = True
     except Exception as ex:
         print 'Exception: process_to_utm -->', ex
     return flag
            avg_c = 0

        return avg_c * self.conv_factor

if __name__ == '__main__':
    dat = []

    eg = EmissGroup()
    eg.set_dimension(90, 90)
    for y in range(90):
        for x in range(90):
            tmp = EmissData()
            tmp.conc = y * 10 + x
            tmp.lat = -7 + y * 0.01
            tmp.lon = 107 + x * 0.01
            tmp.x, tmp.y = utm.convert_to_utm(tmp.lat, tmp.lon)
            #            print tmp.x, tmp.y
            #            dat.append(tmp)
            eg.append_data(tmp)

#    for d in dat:
#        eg.append_data(d)
#    for b in eg.data[1]:
#        print b.lat, b.lon
#    print len(eg.data[1])
#    for a in eg.data:
#        for b in a:
#            print b.lat, b.lon

#    print eg.get_data(3, 1)
    print "size: ", eg.w, eg.h
Example #6
0
             avg_c = 0

        return avg_c * self.conv_factor
        
if __name__ == '__main__':
    dat = []
    
    eg = EmissGroup()
    eg.set_dimension(90, 90)
    for y in range(90):
        for x in range(90):
            tmp = EmissData()
            tmp.conc = y*10 + x
            tmp.lat = -7 + y*0.01
            tmp.lon = 107 + x*0.01
            tmp.x, tmp.y = utm.convert_to_utm(tmp.lat, tmp.lon)
#            print tmp.x, tmp.y
#            dat.append(tmp)
            eg.append_data(tmp)
    
#    for d in dat:
#        eg.append_data(d)
#    for b in eg.data[1]:
#        print b.lat, b.lon
#    print len(eg.data[1])
#    for a in eg.data:
#        for b in a:
#            print b.lat, b.lon
    
#    print eg.get_data(3, 1)
    print "size: ", eg.w, eg.h