def METHOD_NAME(self, add_data=True):
    """
    Calculate the moment map
    Parameters
    ----------
    add_data : bool
        Whether to add the resulting data object to the app according to ``add_results``.
    """
    # Retrieve the data cube and slice out desired region, if specified
    cube = self.dataset.get_object(cls=Spectrum1D, statistic=None)
    spec_min, spec_max = self.spectral_subset.selected_min_max(cube)
    slab = manipulation.spectral_slab(cube, spec_min, spec_max)
    # Calculate the moment and convert to CCDData to add to the viewers
    try:
        n_moment = int(self.n_moment)
        if n_moment < 0:
            raise ValueError("Moment must be a positive integer")
    except ValueError:
        raise ValueError("Moment must be a positive integer")
    # Need transpose to align JWST mirror shape: This is because specutils
    # arrange the array shape to be (nx, ny, nz) but 2D visualization
    # assumes (ny, nx) as per row-major convention.
    data_wcs = getattr(cube.wcs, 'celestial', None)
    if data_wcs:
        data_wcs = data_wcs.swapaxes(0, 1)  # We also transpose WCS to match.
    self.moment = CCDData(analysis.moment(slab, order=n_moment).T, wcs=data_wcs)
    fname_label = self.dataset_selected.replace("[", "_").replace("]", "")
    self.filename = f"moment{n_moment}_{fname_label}.fits"
    if add_data:
        self.add_results.add_results_from_plugin(self.moment)
        msg = SnackbarMessage("{} added to data collection".format(self.results_label),
                              sender=self, color="success")
        self.hub.broadcast(msg)
    self.moment_available = True
    return self.moment