I need to set a logical expression in the box of the GDAL's Raster Calculator using Numpy. My knowledge in Numpy and python is extremely limited (I'm not a Developer just a simple Geographer!). I've seen on this post (Using variable in graphical modeler for raster calculation? (QGIS 3.8)) an example of how to append 2 parts in that box, the part using the letters (A, B, C...) and the other from other inputs like numbers. In that example is easy ('a + ' || @numberinput). My question is about logical statements. I tried 'a >=' || @numberinput and the result is wrong. I checked the numpy documentation and all is about arrays which is notice is kind of complex, I don't need to do too much, just get those A values less or greater than the result from a formula expressed as string getting one variable number from the @numberinput. I'm attaching the images of what I'm doing for you to help me. Threshold set using String concatenation, the output will be used in GDAL Raster Calculator
Then inside GDAL Raster Calculator you can see my issue:
Finally, you can see what I'm trying to do inside the Expression window.
I think this is an easy question for python experts.
'A < ((-25) * @DayOfYear) + 7225 + 0'
string to the calculator, when it must be'A < ((-25) *' || @DayOfYear || ') + 7225 + 0'
. Maybe you can do it improving the string concatenation, I don't know if you can put the ' symbol inside the string to concatenate, like((-25) *' || @DayOfYear || ') + 7225
instead of((-25) * @DayOfYear) + 7225
.'A < (' || @HighThreshold_CONCATENATION || ')'
. Do not worry about numpy, this is a strings concatenation question.