code: def convert_to_stdev(logL):
      """
      Given a grid of log-likelihood values, convert them to cumulative
      standard deviation.  This is useful for drawing contours from a
      grid of likelihoods.
      """
      sigma = np.exp(logL)
  
      shape = sigma.shape
      sigma = sigma.ravel()
  
      # obtain the indices to sort and unsort the flattened array
      i_sort = np.argsort(sigma)[::-1]
      i_unsort = np.argsort(i_sort)
  
      sigma_cumsum = sigma[i_sort].cumsum()
      sigma_cumsum /= sigma_cumsum[-1]
  
      return sigma_cumsum[i_unsort].reshape(shape)
  
label_desc: Use image node_id 1 for calling a global function with example usage: convert_to_stdev(logL) and returns: sigma_cumsum