code: def great_circle_dist(lat_s, lat_t, lon_s, lon_t):
      """Return the great circle distance between nodes.
  
      The latitude and longitude values in the node table have to be in signed
      decimal degrees without compass direction (the sign indicates west/south).
      The great circle distance is calculated using the spherical law of cosines.
  
      """
  
      # dtypes
      lat_s = np.array(lat_s, dtype=float)
      lat_t = np.array(lat_t, dtype=float)
      lon_s = np.array(lon_s, dtype=float)
      lon_t = np.array(lon_t, dtype=float)
  
      # select by event_indices
      phi_i = np.radians(lat_s)
      phi_j = np.radians(lat_t)
  
      delta_alpha = np.radians(lon_t) - np.radians(lon_s)
  
      # earth's radius
      R = 6371
  
      # spatial distance of nodes
      gcd = (
          np.arccos(
              np.sin(phi_i) * np.sin(phi_j)
              + np.cos(phi_i) * np.cos(phi_j) * np.cos(delta_alpha)
          )
          * R
      )
  
      # for 0 gcd, there might be nans, convert to 0.
      gcd = np.nan_to_num(gcd)
  
      return gcd
  
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: great_circle_dist(lat_s, lat_t, lon_s, lon_t) and returns: gcd