Skip to content
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

Error in calcAnchors(image = image.TOAr, Ts = Ts, LAI = LAI, plots = T, : Not enough pixels with the conditions for anchor pixels. I found 0 cold pixels and 0 hot pixels. #54

Open
Omar87senjar opened this issue Feb 15, 2023 · 6 comments

Comments

@Omar87senjar
Copy link

I have challenges with the Energy Balance calculation of the water package, following the example code found on: https://cran.rproject.org/web/packages/water/vignettes/Landsat8.html. Using my own data, I read my original landsat image and the surface reflectance image with my area of interests (aoi). But, I get the following error when I use this code.

Energy.Balance <- METRIC.EB(image.DN = image_band, image.SR = image_SR_band,
plain = TRUE, aoi = aoi, n = 5,
WeatherStation = WeatherStation, ETp.coef = 1.2, sat = "L8",
alb.coeff = "Olmedo", LST.method = "SW",
LAI.method = "metric2010", thermalband=image.DN$thermal.low,
Z.om.ws = 0.03, anchors.method = "flexible", MTL = MTLfile)

Error in calcAnchors(image = image.TOAr, Ts = Ts, LAI = LAI, plots = T, :
Not enough pixels with the conditions for anchor pixels. I
found 0 cold pixels and 0 hot pixels.
In addition: Warning messages:
1: PROJ support is provided by the sf and terra packages among others
2: In calcAnchors(image = image.TOAr, Ts = Ts, LAI = LAI, plots = T, :
anchor method names has changed. Old names (CITRA-MCBx) are
deprecated. Options now include 'best', 'random' and 'flexible'
3: In max(Ts[albedo >= 0.13 & albedo <= 0.15 & NDVI >= 0.1 & NDVI <= :
no non-missing arguments to max; returning -Inf

@raushal1
Copy link

I also ran into a similar problem. Mine says, "found 0 cold pixels and 14 hot pixels". Please let me know if you figured it out somehow.
image

@raushal1
Copy link

@midraed Can you please take a look at this, sir? What do you think might have caused this error?

@Omar87senjar
Copy link
Author

if i solve the problem, i will inform you.

@raushal1
Copy link

raushal1 commented Feb 28, 2023

Thanks a lot.
Also, sir, is there a way to get in touch with you? Maybe your linkedin? I would like to discuss some issues that I am facing with the code and see if you are facing similar issues?

@Omar87senjar
Copy link
Author

Ok no problem. https://www.linkedin.com/in/omar-alsenjar-6431aaa0/. You can send me message to my account.
With all respect

@ishwar97
Copy link

ishwar97 commented Apr 20, 2023

Hey @Omar87senjar and @raushal1,
I also faced similar issue when I was working with water package. It is necessary for algorithm to find at least one hot and cold pixel per scene to run successfully. Sometimes, it is not possible to find one pixel each for hot and cold conditions as per the criteria cited in https://journal.r-project.org/archive/2016/RJ-2016-051/RJ-2016-051.pdf.
I found a work around to it by changing the script of function calcAnchors and manipulating the flexibility limits to find at least one hot and cold pixel.
Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants