Example #1
0
 def __init__(self, **kwargs):
     super().__init__(dataset_id='L8SPARCS80', **kwargs)
     self.filefinder = filefinders.FileFinderBySubStrings(self.in_path)
     self.bandloader = loaders.SingleFileBandLoader(self.dataset_metadata)
     self.maskloader = loaders.ImageLoader(self.dataset_metadata)
     self.metadataloader = loaders.LandsatMTLLoader()
     self.normaliser = normalisers.Landsat8Normaliser(self.dataset_metadata)
     self.encoder = encoders.MapByColourEncoder(self.dataset_metadata)
     self.descriptorloader = loaders.SimpleSpectralDescriptorsLoader(
                                                     self.dataset_metadata
                                                     )
     self.descriptors = self.descriptorloader(
                                             band_ids=self.selected_band_ids
                                             )
     self.resizer = resizers.BandsMaskResizer(
                                             self.dataset_metadata,
                                             to_array=True
                                             )
     self.splitter = splitters.SlidingWindowSplitter(
                                                 self.patch_size,
                                                 self.stride
                                                 )
     self.outputmetadatawriter = writers.LandsatMetadataWriter(
                                                     self.dataset_metadata,
                                                     sun_elevation=True
                                                     )
     self.outputorganiser = misc.BySceneAndPatchOrganiser()
     self.datasaver = savers.ImageMaskDescriptorNumpySaver(overwrite=True)
     self.metadatasaver = savers.MetadataJsonSaver(overwrite=True)
Example #2
0
 def __init__(self, **kwargs):
     super().__init__(dataset_id='S2CESBIO38', **kwargs)
     self.bandregisterfinder = filefinders.BandRegisterFinder(
         self.dataset_metadata, self.in_path)
     self.filefinder = filefinders.FileFinderBySubStrings(self.in_path)
     self.bandloader = loaders.MultiFileBandLoader(self.dataset_metadata,
                                                   imread=self._band_imread)
     self.maskloader = loaders.ImageLoader(self.dataset_metadata,
                                           imread=tif.imread)
     self.normaliser = normalisers.Landsat8Normaliser(self.dataset_metadata)
     self.encoder = encoders.MapByValueEncoder(self.dataset_metadata)
     self.descriptorloader = loaders.SimpleSpectralDescriptorsLoader(
         self.dataset_metadata)
     self.descriptors = self.descriptorloader(
         band_ids=self.selected_band_ids)
     self.resizer = resizers.BandsMaskResizer(self.dataset_metadata,
                                              to_array=True,
                                              strict=False)
     self.splitter = splitters.SlidingWindowSplitter(
         self.patch_size,
         self.stride,
         filters=[
             filters.FilterByMaskClass(threshold=self.nodata_threshold,
                                       target_index=0)
         ])
     self.outputmetadatawriter = writers.LandsatMetadataWriter(
         self.dataset_metadata, sun_elevation=False)
     self.outputorganiser = misc.BySceneAndPatchOrganiser()
     self.datasaver = savers.ImageMaskDescriptorNumpySaver(overwrite=True)
     self.metadatasaver = savers.MetadataJsonSaver(overwrite=True)
     self.sensat_username = None
     self.sensat_passwd = None
     self.download_scenes()
Example #3
0
    def __init__(self, **kwargs):
        super().__init__(dataset_id='S2IRIS513', **kwargs)

        self.filefinder = filefinders.FileFinderBySubStrings(self.in_path)
        self.bandloader = loaders.SingleFileBandLoader(
                                                    self.dataset_metadata,
                                                    imread=np.load
                                                    )
        self.maskloader = loaders.ImageLoader(
                                            self.dataset_metadata,
                                            imread=np.load
                                            )

        self.descriptorloader = loaders.SimpleSpectralDescriptorsLoader(
                                                        self.dataset_metadata
                                                        )
        self.descriptors = self.descriptorloader(
                                                band_ids=self.selected_band_ids
                                                )

        self.resizer = resizers.BandsMaskResizer(
                                                self.dataset_metadata,
                                                to_array=True,
                                                strict=False
                                                )

        self.splitter = splitters.SlidingWindowSplitter(
                                        self.patch_size,
                                        self.stride,
                                        filters=[filters.FilterByMaskClass(
                                            threshold=self.nodata_threshold,
                                            target_index=0
                                            )]
                                        )

        self.outputmetadatawriter = writers.LandsatMetadataWriter(
                                                        self.dataset_metadata,
                                                        sun_elevation=False
                                                        )
        self.outputorganiser = misc.BySceneAndPatchOrganiser()
        self.datasaver = savers.ImageMaskDescriptorNumpySaver(overwrite=True)
        self.metadatasaver = savers.MetadataJsonSaver(overwrite=True)