docs: def slice_rates_to_data(self, strain):
          '''
          For the strain data, checks to see if seismicity rates have been
          calculated. If so, each column in the array is sliced and stored as a
          single vector in the strain.data dictionary with the corresponding
          magnitude as a key.
  
          :param strain:
              Instance of :class: openquake.hmtk.strain.geodetic_strain.GeodeticStrain
  
          :returns:
              strain - Instance of strain class with updated data dictionary
              output_variables - Updated list of headers
          '''
          output_variables = list(strain.data)
          cond = (isinstance(strain.target_magnitudes, np.ndarray) or
                  isinstance(strain.target_magnitudes, list))
          if cond:
              magnitude_list = ['%.3f' % mag for mag in strain.target_magnitudes]
          else:
              return strain, output_variables
  
          # Ensure that the number of rows in the rate array corresponds to the
          # number of observations
          assert np.shape(strain.seismicity_rate)[0] == \
              strain.get_number_observations()
  
          for iloc, magnitude in enumerate(magnitude_list):
              strain.data[magnitude] = strain.seismicity_rate[:, iloc]
          output_variables.extend(magnitude_list)
          return strain, output_variables