src/pys5p/s5p_msm.py
def concatenate(self, msm, axis=0):
        """
        Concatenate two measurement datasets, the current with another.

        Parameters
        ----------
        msm   :  pys5p.S5Pmsm
           an S5Pmsm object
        axis  : int, optional
           The axis for which the array will be joined. Default is 0.

        Returns
        -------
        The data of the new dataset is concatenated to the existing data along
        an existing axis. The affected coordinate is also extended.

        Note:
         - The arrays must have the same shape, except in the dimension
        corresponding to axis (the first, by default).
        """
        if self.name != PurePath(msm.name).name:
            raise TypeError('combining dataset with different name')

        if self.error is None and msm.error is None:
            datapoint = False
        elif self.error is not None and msm.error is not None:
            datapoint = True
        else:
            raise RuntimeError("S5Pmsm: combining non-datapoint and datapoint")

        # all but the last 2 dimensions have to be equal
        if self.value.shape[:-2] != msm.value.shape[:-2]:
            raise TypeError('all but the last 2 dimensions should be equal')

        if axis == 0:
            self.value = np.concatenate((self.value, msm.value), axis=axis)
            if datapoint:
                self.error = np.concatenate((self.error, msm.error),
                                            axis=axis)
        elif axis == 1:
            if self.value.shape[0] == msm.value.shape[0]:
                self.value = np.concatenate((self.value, msm.value), axis=axis)
                if datapoint:
                    self.error = np.concatenate((self.error, msm.error),
                                                axis=axis)
            else:
                self.value = np.concatenate(pad_rows(self.value, msm.value),
                                            axis=axis)
                if datapoint:
                    self.error = np.concatenate(
                        pad_rows(self.error, msm.error), axis=axis)
        elif axis == 2:
            if self.value.shape[1] == msm.value.shape[1]:
                self.value = np.concatenate((self.value, msm.value), axis=axis)
                if datapoint:
                    self.error = np.concatenate((self.error, msm.error),
                                                axis=axis)
            else:
                self.value = np.concatenate(pad_rows(self.value, msm.value),
                                            axis=axis)
                if datapoint:
                    self.error = np.concatenate(
                        pad_rows(self.error, msm.error), axis=axis)
        else:
            raise ValueError("S5Pmsm: implemented for ndim <= 3")

        # now extent coordinate of the fastest axis
        key = self.coords._fields[axis]
        if msm.coords[axis][0] == 0:
            dims = np.concatenate((self.coords[axis],
                                   len(self.coords[axis]) + msm.coords[axis]))
        else:
            dims = np.concatenate((self.coords[axis], msm.coords[axis]))
        self.coords = self.coords._replace(**{key: dims})
        return self

        Concatenate two measurement datasets, the current with another.

        Parameters
        ----------
        msm   :  pys5p.S5Pmsm
           an S5Pmsm object
        axis  : int, optional
           The axis for which the array will be joined. Default is 0.

        Returns
        -------
        The data of the new dataset is concatenated to the existing data along
        an existing axis. The affected coordinate is also extended.

        Note:
         - The arrays must have the same shape, except in the dimension
        corresponding to axis (the first, by default).
        
Concatenate two measurement datasets, the current with another.
Parameters

msm   :  pys5p.S5Pmsm
an S5Pmsm object
axis  : int, optional
The axis for which the array will be joined. Default is 0.

Returns

The data of the new dataset is concatenated to the existing data along
an existing axis. The affected coordinate is also extended.

The arrays must have the same shape, except in the dimension
corresponding to axis (the first, by default).
Concatenate two measurement datasets the current with another . Parameters msm : pys5p . S5Pmsm an S5Pmsm object axis : int optional The axis for which the array will be joined . Default is 0 . Returns The data of the new dataset is concatenated to the existing data along an existing axis . The affected coordinate is also extended . The arrays must have the same shape except in the dimension corresponding to axis ( the first by default ) .
def concatenate(self, msm, axis=0):
        if self.name != PurePath(msm.name).name:
            raise TypeError('combining dataset with different name')
        if self.error is None and msm.error is None:
            datapoint = False
        elif self.error is not None and msm.error is not None:
            datapoint = True
        else:
            raise RuntimeError("S5Pmsm: combining non-datapoint and datapoint")
        if self.value.shape[:-2] != msm.value.shape[:-2]:
            raise TypeError('all but the last 2 dimensions should be equal')
        if axis == 0:
            self.value = np.concatenate((self.value, msm.value), axis=axis)
            if datapoint:
                self.error = np.concatenate((self.error, msm.error),
                                            axis=axis)
        elif axis == 1:
            if self.value.shape[0] == msm.value.shape[0]:
                self.value = np.concatenate((self.value, msm.value), axis=axis)
                if datapoint:
                    self.error = np.concatenate((self.error, msm.error),
                                                axis=axis)
            else:
                self.value = np.concatenate(pad_rows(self.value, msm.value),
                                            axis=axis)
                if datapoint:
                    self.error = np.concatenate(
                        pad_rows(self.error, msm.error), axis=axis)
        elif axis == 2:
            if self.value.shape[1] == msm.value.shape[1]:
                self.value = np.concatenate((self.value, msm.value), axis=axis)
                if datapoint:
                    self.error = np.concatenate((self.error, msm.error),
                                                axis=axis)
            else:
                self.value = np.concatenate(pad_rows(self.value, msm.value),
                                            axis=axis)
                if datapoint:
                    self.error = np.concatenate(
                        pad_rows(self.error, msm.error), axis=axis)
        else:
            raise ValueError("S5Pmsm: implemented for ndim <= 3")
        key = self.coords._fields[axis]
        if msm.coords[axis][0] == 0:
            dims = np.concatenate((self.coords[axis],
                                   len(self.coords[axis]) + msm.coords[axis]))
        else:
            dims = np.concatenate((self.coords[axis], msm.coords[axis]))
        self.coords = self.coords._replace(**{key: dims})
        return self
def concatenate ( self , msm , axis = 0 ) : if self . name != PurePath ( msm . name ) . name : raise TypeError ( 'combining dataset with different name' ) if self . error is None and msm . error is None : datapoint = False elif self . error is not None and msm . error is not None : datapoint = True else : raise RuntimeError ( "S5Pmsm: combining non-datapoint and datapoint" ) if self . value . shape [ : - 2 ] != msm . value . shape [ : - 2 ] : raise TypeError ( 'all but the last 2 dimensions should be equal' ) if axis == 0 : self . value = np . concatenate ( ( self . value , msm . value ) , axis = axis ) if datapoint : self . error = np . concatenate ( ( self . error , msm . error ) , axis = axis ) elif axis == 1 : if self . value . shape [ 0 ] == msm . value . shape [ 0 ] : self . value = np . concatenate ( ( self . value , msm . value ) , axis = axis ) if datapoint : self . error = np . concatenate ( ( self . error , msm . error ) , axis = axis ) else : self . value = np . concatenate ( pad_rows ( self . value , msm . value ) , axis = axis ) if datapoint : self . error = np . concatenate ( pad_rows ( self . error , msm . error ) , axis = axis ) elif axis == 2 : if self . value . shape [ 1 ] == msm . value . shape [ 1 ] : self . value = np . concatenate ( ( self . value , msm . value ) , axis = axis ) if datapoint : self . error = np . concatenate ( ( self . error , msm . error ) , axis = axis ) else : self . value = np . concatenate ( pad_rows ( self . value , msm . value ) , axis = axis ) if datapoint : self . error = np . concatenate ( pad_rows ( self . error , msm . error ) , axis = axis ) else : raise ValueError ( "S5Pmsm: implemented for ndim <= 3" ) key = self . coords . _fields [ axis ] if msm . coords [ axis ] [ 0 ] == 0 : dims = np . concatenate ( ( self . coords [ axis ] , len ( self . coords [ axis ] ) + msm . coords [ axis ] ) ) else : dims = np . concatenate ( ( self . coords [ axis ] , msm . coords [ axis ] ) ) self . coords = self . coords . _replace ( ** { key : dims } ) return self
Concatenate two measurement datasets, the current with another.
Concatenate two measurement datasets the current with another .
"""
        Concatenate two measurement datasets, the current with another.

        Parameters
        ----------
        msm   :  pys5p.S5Pmsm
           an S5Pmsm object
        axis  : int, optional
           The axis for which the array will be joined. Default is 0.

        Returns
        -------
        The data of the new dataset is concatenated to the existing data along
        an existing axis. The affected coordinate is also extended.

        Note:
         - The arrays must have the same shape, except in the dimension
        corresponding to axis (the first, by default).
        """ # all but the last 2 dimensions have to be equal # now extent coordinate of the fastest axis
self
msm
axis