plugins:
  source:
    - module: intake_xarray
sources:
  esgf:
    description: CREATE sample
    driver: opendap
    #cache:
    #  - argkey: urlpath
    #    regex: ''
    #    type: file
    args:
      urlpath: 'http://esgf.nccs.nasa.gov/thredds/dodsC/CREATE-IP/reanalysis/ECMWF/IFS-Cy31r2/day/atmos/pr/pr_day_reanalysis_IFS-Cy31r2_19790101-19791231.nc'
      chunks: {}
      xarray_kwargs:
        decode_times: False
        
  geotiff:
    description: Geotiff image of Landsat Surface Reflectance Level-2 Science Product L5.
    driver: rasterio
    cache:
      - argkey: urlpath
        regex: 'earth-data/landsat'
        type: file
    args:
      urlpath: 's3://earth-data/landsat/small/LT05_L1TP_042033_{collection_date:%Y%m%d}_{processing_date:%Y%m%d}_01_T1_sr_band{band:1d}.tif'
      chunks:
        band: 1
        x: 50
        y: 50
      concat_dim: band
      storage_options: {'anon': True}
    metadata:
      plots:
        band_image:
          kind: 'image'
          x: 'x'
          y: 'y'
          groupby: 'band'
          rasterize: True
  
  image:
    description: Labeled images from UCMerced_LandUse/Images
    origin: http://weegee.vision.ucmerced.edu/datasets/landuse.html
    driver: xarray_image
    cache:
      - argkey: urlpath
        regex: 'earth-data/UCMerced_LandUse'
        type: file
    parameters:
      landuse:
        description: one landuse to gather
        type: str
        default: 'airplane'
      id:
        description: one id to gather
        type: int
        default: 0
    args:
      urlpath: "s3://earth-data/UCMerced_LandUse/Images/{{ landuse }}/{{ landuse }}{{ '%02d' % id }}.tif"
      storage_options: {'anon': True}
  
  images_labelled:
    description: All the labeled images from UCMerced_LandUse/Images for one id
    origin: http://weegee.vision.ucmerced.edu/datasets/landuse.html
    driver: xarray_image
    cache:
      - argkey: urlpath
        regex: 'earth-data/UCMerced_LandUse'
        type: file
    parameters:
      id:
        description: one id to gather
        type: int
        default: 0
    args:
      urlpath: "s3://earth-data/UCMerced_LandUse/Images/*/*{{ '%02d' % id }}.tif"
      path_as_pattern: "Images/{landuse}/{boo}{id:2d}.tif"
      storage_options: {'anon': True}
      concat_dim: [id, landuse]
      
  images_unlabelled:
    description: All the labeled images from UCMerced_LandUse/Images for one id
    origin: http://weegee.vision.ucmerced.edu/datasets/landuse.html
    driver: xarray_image
    cache:
      - argkey: urlpath
        regex: 'earth-data/UCMerced_LandUse'
        type: file
    parameters:
      id:
        description: one id to gather
        type: int
        default: 0
    args:
      urlpath: "s3://earth-data/UCMerced_LandUse/Images/*/*{{ '%02d' % id }}.tif"
      storage_options: {'anon': True}
      
  grib_thredds:
    description: Publicly available grib data available on thredds via opendap protocol
    driver: netcdf
    args:
      urlpath: 'http://thredds.ucar.edu/thredds/dodsC/grib/FNMOC/WW3/Global_1p0deg/Best'
      chunks: {}
