Coder Social home page Coder Social logo

Comments (7)

julianblue avatar julianblue commented on June 4, 2024 1

@davemlz I believe this has to do with some returned indices not having the same coordinates. Problematic coordinates seem to be "gsd", "common_name", "band" and some others. As of my understanding XR.concat should avoid this issue with the compat= "no_conflicts" statement, which is default. Might adding a coordinate check help to ensure all calculated indices contain the same coordinates ?

from spyndex.

davemlz avatar davemlz commented on June 4, 2024 1

Yes. You're totally right, @julianblue! I'm on it and I hope to have it done later :) For now and until then, [@Raziehgithub, @julianblue], if you want, a workaround for this problem is to set returnOrigin=False. With this the indices are not concatenated and are returned as a list :)

from spyndex.

Raziehgithub avatar Raziehgithub commented on June 4, 2024 1

from spyndex.

davemlz avatar davemlz commented on June 4, 2024

Hi, @Raziehgithub!

I wasn't able to reproduce the error you got. Could you please share the code here?

from spyndex.

Raziehgithub avatar Raziehgithub commented on June 4, 2024

import pandas as pd
from affine import Affine
import spyndex
import xarray as xr
import rasterio as ro
import os
import glob

tif_files = glob.glob('clipped*.tif')
da = xr.open_rasterio(tif_files[1])
idx_1 = spyndex.computeIndex(
index = ["ARVI", "BNDVI", "CIG", "CIRE", "CVI", "DVI", "GARI", "GNDVI", "MCARI",
"MNLI", "MSR", "NDYI", "NLI","OSAVI", "RDVI", "SAVI", "TGI", "NDVI", "NDREI",
"EVI", "GBNDVI", "GLI", "GRNDVI", "MSAVI", "MTVI2", "VARI"],
params = {
"B": da.sel(band = 1),
"G": da.sel(band = 2),
"R": da.sel(band = 3),
"RE1": da.sel(band = 4),
"N": da.sel(band = 5),
"L": 0.5,
"g": 2.5,
"C1": 6,
"C2": 7.5
}
)
idx_1

error

from spyndex.

davemlz avatar davemlz commented on June 4, 2024

The problem was solved! If you download the dev version it should work now :) pip install git+https://github.com/davemlz/spyndex.

Thank you for pointing this out!

from spyndex.

davemlz avatar davemlz commented on June 4, 2024

[@Raziehgithub, @julianblue], I have released v0.0.2 with the fix. Now you can download the new version with pip install -U spyndex :)

from spyndex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.