About... Prerequisites Examples Home Bugs Download Manual Links

Example 9

    from pyclimate.JDTimeHandler import JDTimeHandler 
    from pyclimate.JDTime import monthlystep
    
    mstep = 24 * monthlystep()   # A month in hours
    
    # Handling monthly data: the WRONG way
    jdth = JDTimeHandler("hours since 1948-01-01")
    for t in [0, 1, 2, 3]:
      print jdth.getdatefields(t * mstep, 3)
    
    # Handling monthly data: the RIGHT way 
    jdth = JDTimeHandler("hours since 1948-01-15")
    for t in [0, 1, 2, 3]:
      print jdth.getdatefields(t * mstep, 3)
    



Contact the
Webmaster