Commits

Admi...@luobo  committed 5498765

tune MAX_LEN_AS_PLANE and MAX_LEN_

  • Participants
  • Parent commits 52d53a1

Comments (0)

Files changed (1)

File demfunctions.py

 logger.setLevel(logging.INFO)
 logger.addHandler(logging.StreamHandler())
 
-MAX_LEN_ = 3
+MAX_LEN_AS_PLANE = 3
+MAX_LEN_ = MAX_LEN_AS_PLANE + 5
 
 def fill_sinks(data):
     '''
                     logger.debug('len_:%s'%len_)
                     logger.debug('___')
                     len_ += 1
+                    if len_ > MAX_LEN_:
+                        logger.info('len_>MAX_LEN_, break')
+                        break # this sink or gorge is too large
                     for i in range(len_+1):
                         if r+len_ <= r_max-1 and c+i <=c_max-1:
                             tem = [r+len_,c+i]
                     hidden_outset = []
                     tag = []
                     for node in border:
-                        if len_ > MAX_LEN_:
+                        if len_ > MAX_LEN_AS_PLANE:
                             if data[node[0]][node[1]] == data[r][c]:
                                 tag.append(True)
                             else:
                                 tag.append(False)
                     if False not in tag and len(tag) != 0:
-                        logger.info('len_ > MAX_LEN_. it is deem a large plane')
+                        logger.info('len_ > MAX_LEN_AS_PLANE. it is deem a large plane')
                         break
                     del tag
                     for node in border: