luke-a-brown / hemipy

A Python module for automated estimation of forest biophysical variables and uncertainties from digital hemispherical photographs
MIT License
4 stars 1 forks source link

processing NEON fails at line 321 #2

Open bmcnellis opened 6 months ago

bmcnellis commented 6 months ago

I'm trying to use hemipy to process NEON hemispherical photos using a modified example of the script in the README. Some modification to the script was necessary, but the package itself fails at line 321 (mean_miller_gf=np.nanmean(mean_miller_gf_each_image, axis = 0)) . The error is a ZeroDivisionError: division by zero error, and it looks like it is caused by the mean_miller_gf_each_image object, which has columns with all NaN.

I uploaded the code to github.com/bmcnellis/hemipyPUUM to help with debugging. Any assistance is appreciated!

luke-a-brown commented 5 months ago

Some of the parameters in https://github.com/bmcnellis/hemipyPUUM/blob/master/process_dhp.py don't look right to me. From data I've got to hand, I would expect images from PUUM to have dimensions of [4032,6032], giving an optical centre of [2016,3016]. The lens projection function should be [0,0,0.024809], i.e. 180/√(4032^2+6032^2). Can you try with these updated parameters and see if that resolves the issue?

ceciliawang233 commented 1 week ago

My image size is [3264, 4928], then optical centre should be [1632, 2464], calibration function coefficients should be [0, 0, 0.030452], but the code can not be work, it always report "ValueError: math domain error". If I use the same lens projection function with yours (0.0548543),it can work. I don't know if there are other problems 0e369d42df68ecb624d2a4fa022dbe8a