Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RasterDataset with RBG Tif #517

Closed
graceebc9 opened this issue Apr 26, 2022 · 4 comments
Closed

RasterDataset with RBG Tif #517

graceebc9 opened this issue Apr 26, 2022 · 4 comments
Labels
datasets Geospatial or benchmark datasets

Comments

@graceebc9
Copy link

graceebc9 commented Apr 26, 2022

Hello, I'm creating a new RasterDataset class for the NOAA high res RGB satellite imagery (https://storms.ngs.noaa.gov/)

but struggling to get the sampler to work, think it may be an issue with the TIF being multi-channel/ not sure how to extract the RGB bands from a single TIF thats not labelled.

The data comes in TIF tiles of 2.5km, 3 x 9415 x 9415, and looks like this in XARRAY
image

This is my current class , for tiles with names like '20210830aC0932315w294800n.tif'

class NOAA(RasterDataset):
    filename_glob = "*n.tif"
    filename_regex = "^(?P<date>\d{8})a.*$" 
    date_format = "%Y%m%d"
    
    seperate_files= False
    
    def __init__(
            self,
            root: str = "data",
            crs: Optional[CRS] = None,
            res: Optional[float] = None,
            # run: Sequence[str] = [],
            # bands: Optional[str] = [],
            transforms: Optional[Callable[[Dict[str, Any]], Dict[str, Any]]] = None,
            cache: bool = True,
        ) -> None:
            """Initialize a new Dataset instance.

            """
            # self.bands = bands if bands else self.all_bands

            super().__init__(root, crs, res, transforms, cache,)

Thanks

@adamjstewart adamjstewart added the datasets Geospatial or benchmark datasets label Apr 26, 2022
@adamjstewart
Copy link
Collaborator

Could this be the same issue as #466 (comment)?

@weiji14
Copy link
Contributor

weiji14 commented Apr 27, 2022

Could you point to a download link for the GeoTiff file (somehow can't get the download working on my browser)? Or maybe post the output of gdalinfo 20210830aC0932315w294800n.tif

My guess is that you'll need to read the RGB tif using rasterio's color interpretation, see https://rasterio.readthedocs.io/en/latest/topics/color.html. Note that xarray can't read the colorinterp properly, though I've been trying to get it to work via rioxarray (see corteva/rioxarray#414).

@adamjstewart
Copy link
Collaborator

@graceebc9 does #466 (comment) solve your issue?

@adamjstewart
Copy link
Collaborator

Assuming that this issue has been resolved, but if not feel free to reopen this issue.

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2022
@adamjstewart adamjstewart converted this issue into discussion #598 Jun 18, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
datasets Geospatial or benchmark datasets
Projects
None yet
Development

No branches or pull requests

3 participants