code: def read_samples(self, parameters, array_class=None, **kwargs):
          
          # get the type of array class to use
          if array_class is None:
              array_class = FieldArray
          # get the names of fields needed for the given parameters
          possible_fields = self[self.samples_group].keys()
          loadfields = array_class.parse_parameters(parameters, possible_fields)
          samples = self.read_raw_samples(loadfields, **kwargs)
          # convert to FieldArray
          samples = array_class.from_kwargs(**samples)
          # add the static params and attributes
          addatrs = (self.static_params.items() +
                     self[self.samples_group].attrs.items())
          for (p, val) in addatrs:
              setattr(samples, p, val)
          return samples
docs: Reads samples for the given parameter(s).
  
          The ``parameters`` can be the name of any dataset in ``samples_group``,
          a virtual field or method of ``FieldArray`` (as long as the file
          contains the necessary fields to derive the virtual field or method),
          and/or any numpy function of these.
  
          The ``parameters`` are parsed to figure out what datasets are needed.
          Only those datasets will be loaded, and will be the base-level fields
          of the returned ``FieldArray``.
  
          The ``static_params`` are also added as attributes of the returned
          ``FieldArray``.
  
          Parameters
          -----------
          fp : InferenceFile
              An open file handler to read the samples from.
          parameters : (list of) strings
              The parameter(s) to retrieve.
          array_class : FieldArray-like class, optional
              The type of array to return. The class must have ``from_kwargs``
              and ``parse_parameters`` methods. If None, will return a
              ``FieldArray``.
          \**kwargs :
              All other keyword arguments are passed to ``read_raw_samples``.
  
          Returns
          -------
          FieldArray :
              The samples as a ``FieldArray``.