nodes: 0, module; 1, function_definition; 2, function_name:build_delta_t_table; 3, parameters; 4, block; 5, identifier:delta_t_recent; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, comment:# Prefer USNO over Morrison and Stephenson where they overlap.; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, comment:# Let recent data replace everything else.; 14, expression_statement; 15, expression_statement; 16, expression_statement; 17, expression_statement; 18, comment:# Create initial and final point to provide continuity with formula.; 19, expression_statement; 20, expression_statement; 21, expression_statement; 22, expression_statement; 23, expression_statement; 24, return_statement; 25, comment:"""Build a table for interpolating Delta T.
  
      Given a 2xN array of recent Delta T values, whose element 0 is a
      sorted array of TT Julian dates and element 1 is Delta T values,
      this routine returns a more complete table by prepending two
      built-in data sources that ship with Skyfield as pre-built arrays:
  
      * The historical values from Morrison and Stephenson (2004) which
        the http://eclipse.gsfc.nasa.gov/SEcat5/deltat.html NASA web page
        presents in an HTML table.
  
      * The United States Naval Observatory ``historic_deltat.data``
        values for Delta T over the years 1657 through 1984.
  
      """; 26, assignment; 27, assignment; 28, assignment; 29, assignment; 30, assignment; 31, assignment; 32, assignment; 33, assignment; 34, assignment; 35, assignment; 36, assignment; 37, assignment; 38, assignment; 39, assignment; 40, identifier:table; 41, identifier:ancient; 42, call; 43, identifier:historic; 44, call; 45, identifier:historic_start_time; 46, subscript; 47, identifier:i; 48, call; 49, identifier:bundled; 50, call; 51, identifier:recent_start_time; 52, subscript; 53, identifier:i; 54, call; 55, identifier:row; 56, tuple; 57, identifier:table; 58, call; 59, identifier:century; 60, float:36524.0; 61, identifier:start; 62, binary_operator:table[0,1] - century; 63, subscript; 64, expression_list; 65, identifier:end; 66, binary_operator:table[0,-2] + century; 67, subscript; 68, expression_list; 69, identifier:load_bundled_npy; 70, argument_list; 71, identifier:load_bundled_npy; 72, argument_list; 73, identifier:historic; 74, integer:0; 75, integer:0; 76, identifier:searchsorted; 77, argument_list; 78, identifier:concatenate; 79, argument_list; 80, identifier:delta_t_recent; 81, integer:0; 82, integer:0; 83, identifier:searchsorted; 84, argument_list; 85, tuple; 86, tuple; 87, identifier:concatenate; 88, argument_list; 89, subscript; 90, identifier:century; 91, identifier:table; 92, slice; 93, integer:0; 94, identifier:start; 95, call; 96, subscript; 97, identifier:century; 98, identifier:table; 99, slice; 100, unary_operator; 101, identifier:end; 102, call; 103, string; 104, string; 105, subscript; 106, identifier:historic_start_time; 107, list; 108, keyword_argument; 109, subscript; 110, identifier:recent_start_time; 111, integer:0; 112, integer:0; 113, list; 114, keyword_argument; 115, identifier:table; 116, integer:0; 117, integer:1; 118, identifier:delta_t_formula_morrison_and_stephenson_2004; 119, argument_list; 120, identifier:table; 121, integer:0; 122, unary_operator; 123, integer:1; 124, identifier:delta_t_formula_morrison_and_stephenson_2004; 125, argument_list; 126, string_content:morrison_stephenson_deltat.npy; 127, string_content:historic_deltat.npy; 128, identifier:ancient; 129, integer:0; 130, subscript; 131, identifier:historic; 132, identifier:axis; 133, integer:1; 134, identifier:bundled; 135, integer:0; 136, identifier:row; 137, subscript; 138, identifier:delta_t_recent; 139, identifier:row; 140, identifier:axis; 141, integer:1; 142, identifier:start; 143, integer:2; 144, identifier:end; 145, identifier:ancient; 146, slice; 147, slice; 148, identifier:bundled; 149, slice; 150, slice; 151, identifier:i; 152, identifier:i
code: def build_delta_t_table(delta_t_recent):
      """Build a table for interpolating Delta T.
  
      Given a 2xN array of recent Delta T values, whose element 0 is a
      sorted array of TT Julian dates and element 1 is Delta T values,
      this routine returns a more complete table by prepending two
      built-in data sources that ship with Skyfield as pre-built arrays:
  
      * The historical values from Morrison and Stephenson (2004) which
        the http://eclipse.gsfc.nasa.gov/SEcat5/deltat.html NASA web page
        presents in an HTML table.
  
      * The United States Naval Observatory ``historic_deltat.data``
        values for Delta T over the years 1657 through 1984.
  
      """
      ancient = load_bundled_npy('morrison_stephenson_deltat.npy')
      historic = load_bundled_npy('historic_deltat.npy')
  
      # Prefer USNO over Morrison and Stephenson where they overlap.
      historic_start_time = historic[0,0]
      i = searchsorted(ancient[0], historic_start_time)
      bundled = concatenate([ancient[:,:i], historic], axis=1)
  
      # Let recent data replace everything else.
      recent_start_time = delta_t_recent[0,0]
      i = searchsorted(bundled[0], recent_start_time)
      row = ((0,),(0,))
      table = concatenate([row, bundled[:,:i], delta_t_recent, row], axis=1)
  
      # Create initial and final point to provide continuity with formula.
      century = 36524.0
      start = table[0,1] - century
      table[:,0] = start, delta_t_formula_morrison_and_stephenson_2004(start)
      end = table[0,-2] + century
      table[:,-1] = end, delta_t_formula_morrison_and_stephenson_2004(end)
      return table