src/pys5p/l1b_patch.py
def close(self) -> None:
        """
        Before closing the product, we make sure that the output product
        describes what has been altered by the S/W. To keep any change
        traceable.

        In case the L1b product is altered, the attributes listed below are
        added to the group: '/METADATA/SRON_METADATA':
             - dateStamp ('now')
             - Git-version of S/W
             - list of patched datasets
             - auxiliary datasets used by patch-routines
        """
        if not self.l1b_patched.is_file():
            return

        if not self.__patched_msm:
            return

        with h5py.File(self.l1b_patched, 'r+') as fid:
            sgrp = fid.require_group('/METADATA/SRON_METADATA')
            sgrp.attrs['dateStamp'] = datetime.utcnow().isoformat()
            sgrp.attrs['git_tag'] = get_version(root='..',
                                                relative_to=__file__)
            if 'patched_datasets' not in sgrp:
                dtype = h5py.special_dtype(vlen=str)
                dset = sgrp.create_dataset('patched_datasets',
                                           (len(self.__patched_msm),),
                                           maxshape=(None,), dtype=dtype)
                dset[:] = np.asarray(self.__patched_msm)
            else:
                dset = sgrp['patched_datasets']
                dset.resize(dset.shape[0] + len(self.__patched_msm), axis=0)
                dset[dset.shape[0]-1:] = np.asarray(self.__patched_msm)

        Before closing the product, we make sure that the output product
        describes what has been altered by the S/W. To keep any change
        traceable.

        In case the L1b product is altered, the attributes listed below are
        added to the group: '/METADATA/SRON_METADATA':
             - dateStamp ('now')
             - Git-version of S/W
             - list of patched datasets
             - auxiliary datasets used by patch-routines
        
Before closing the product, we make sure that the output product
describes what has been altered by the S/W. To keep any change
traceable.

In case the L1b product is altered, the attributes listed below are
added to the group: '/METADATA/SRON_METADATA':
dateStamp ('now')
Git-version of S/W
list of patched datasets
auxiliary datasets used by patch-routines
Before closing the product we make sure that the output product describes what has been altered by the S / W . To keep any change traceable . In case the L1b product is altered the attributes listed below are added to the group : ' / METADATA / SRON_METADATA ' : dateStamp ( ' now ' ) Git - version of S / W list of patched datasets auxiliary datasets used by patch - routines
def close(self) -> None:
        if not self.l1b_patched.is_file():
            return
        if not self.__patched_msm:
            return
        with h5py.File(self.l1b_patched, 'r+') as fid:
            sgrp = fid.require_group('/METADATA/SRON_METADATA')
            sgrp.attrs['dateStamp'] = datetime.utcnow().isoformat()
            sgrp.attrs['git_tag'] = get_version(root='..',
                                                relative_to=__file__)
            if 'patched_datasets' not in sgrp:
                dtype = h5py.special_dtype(vlen=str)
                dset = sgrp.create_dataset('patched_datasets',
                                           (len(self.__patched_msm),),
                                           maxshape=(None,), dtype=dtype)
                dset[:] = np.asarray(self.__patched_msm)
            else:
                dset = sgrp['patched_datasets']
                dset.resize(dset.shape[0] + len(self.__patched_msm), axis=0)
                dset[dset.shape[0]-1:] = np.asarray(self.__patched_msm)
def close ( self ) -> None : if not self . l1b_patched . is_file ( ) : return if not self . __patched_msm : return with h5py . File ( self . l1b_patched , 'r+' ) as fid : sgrp = fid . require_group ( '/METADATA/SRON_METADATA' ) sgrp . attrs [ 'dateStamp' ] = datetime . utcnow ( ) . isoformat ( ) sgrp . attrs [ 'git_tag' ] = get_version ( root = '..' , relative_to = __file__ ) if 'patched_datasets' not in sgrp : dtype = h5py . special_dtype ( vlen = str ) dset = sgrp . create_dataset ( 'patched_datasets' , ( len ( self . __patched_msm ) , ) , maxshape = ( None , ) , dtype = dtype ) dset [ : ] = np . asarray ( self . __patched_msm ) else : dset = sgrp [ 'patched_datasets' ] dset . resize ( dset . shape [ 0 ] + len ( self . __patched_msm ) , axis = 0 ) dset [ dset . shape [ 0 ] - 1 : ] = np . asarray ( self . __patched_msm )
Before closing the product, we make sure that the output product
describes what has been altered by the S/W.
Before closing the product we make sure that the output product describes what has been altered by the S / W .
"""
        Before closing the product, we make sure that the output product
        describes what has been altered by the S/W. To keep any change
        traceable.

        In case the L1b product is altered, the attributes listed below are
        added to the group: '/METADATA/SRON_METADATA':
             - dateStamp ('now')
             - Git-version of S/W
             - list of patched datasets
             - auxiliary datasets used by patch-routines
        """
self