hectornieto / pyTSEB

A python Two Source Energy Balance model for estimation of evapotranspiration with remote sensing data
GNU General Public License v3.0
137 stars 62 forks source link

TypeError: 'numpy.float64' object does not support item assignment #14

Closed houserck closed 6 years ago

houserck commented 6 years ago

I am trying to run the low-level TSEB_PT function. I am running into this error. Line 667

--> 677 flag != 255)] = n_iterations 678 679 # Inner loop to iterativelly reduce alpha_PT in case latent heat flux

hectornieto commented 6 years ago

Dear houserck, could you provide more details about your problem? i.e. what type of input you are using? 2D/1D array or single floating point? what version of numpy you are using?

Cheers!

houserck commented 6 years ago

Hi Hector,

I am using Numpy version 1.13.1 and I was using single floating points as inputs.

Your comment gave me an idea to add square brackets which fixed the issue.

For instance, I was originally doing this something like this TSEB.TSEB_PT(Tr_K=X[0]. ... ) but it needs to be TSEB.TSEB_PT(Tr_K=[X[0]], ..).

Thank you for your response! I am newish to python (coming from R) so array issues still trip me up quite a bit.

Also, thanks for this awesome library!

Best,

Cameron

On Fri, Feb 2, 2018 at 2:45 AM, Héctor Nieto notifications@github.com wrote:

Dear houserck, could you provide more details about your problem? i.e. what type of input you are using? 2D/1D array or single floating point? what version of numpy you are using?

Cheers!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hectornieto/pyTSEB/issues/14#issuecomment-362510641, or mute the thread https://github.com/notifications/unsubscribe-auth/AZX-aI2Vr5VcE_N8A55sA-n0rMFNoV5gks5tQr0VgaJpZM4R2Ne2 .

hectornieto commented 6 years ago

Happy to hear that you managed to solve the problem. After that issue I will try to publish a fix for it

Cheers!

Hector Nieto. Sent from my Android mobile... apologies for eventual typos

On Feb 2, 2018 18:45, houserck notifications@github.com wrote: Hi Hector,

I am using Numpy version 1.13.1 and I was using single floating points as inputs.

Your comment gave me an idea to add square brackets which fixed the issue.

For instance, I was originally doing this something like this TSEB.TSEB_PT(Tr_K=X[0]. ... ) but it needs to be TSEB.TSEB_PT(Tr_K=[X[0]], ..).

Thank you for your response! I am newish to python (coming from R) so array issues still trip me up quite a bit.

Also, thanks for this awesome library!

Best,

Cameron

On Fri, Feb 2, 2018 at 2:45 AM, Héctor Nieto notifications@github.com wrote:

Dear houserck, could you provide more details about your problem? i.e. what type of input you are using? 2D/1D array or single floating point? what version of numpy you are using?

Cheers!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hectornieto/pyTSEB/issues/14#issuecomment-362510641, or mute the thread https://github.com/notifications/unsubscribe-auth/AZX-aI2Vr5VcE_N8A55sA-n0rMFNoV5gks5tQr0VgaJpZM4R2Ne2 .

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/hectornieto/pyTSEB/issues/14#issuecomment-362637140, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AG9uzi4ipS_E_rdrercA31uLtjEy3Q9Sks5tQzoMgaJpZM4R2Ne2.