Ignore:
Timestamp:
05/20/15 16:30:57 (6 years ago)
Author:
labetoulle
Message:

Add to bilan a line that shows the theoratical two months under-consumption

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/ConsoGENCMIP6/bin/libconso.py

    r2464 r2517  
    249249    n = np.array([utheos[x1], utheos[x2]]) 
    250250 
     251    poly_ok = True 
    251252    try: 
    252       (a, b) = np.linalg.solve(m, n) 
     253      polynome = np.poly1d(np.linalg.solve(m, n)) 
    253254    except np.linalg.linalg.LinAlgError: 
    254       (a, b) = (None, None) 
    255  
    256     if a and b: 
    257       delta = int(round((-b/a)-x1 + 1)) 
    258  
    259       d1 = dates[x1] 
     255      poly_ok = False 
     256 
     257    if poly_ok: 
     258      delta = int(round(polynome.r[0] + 1)) 
     259 
     260      d1 = dates[0] 
    260261      self.date_init = d1 + dt.timedelta(days=delta) 
    261262    else: 
Note: See TracChangeset for help on using the changeset viewer.