davidfrantz / force-udf

User-Defined Functions for FORCE
GNU General Public License v3.0
13 stars 8 forks source link

Inarray has different shapes when running script with TSA vs UDF #11

Closed vudongpham closed 1 year ago

vudongpham commented 1 year ago

FORCE 3.9.7 I have two parameter files, one was generated by TSA module, the other was generated with UDF module. Both have the same specs, and point to the same python script. I specified the INDEX=NDVI, SENSOR = LND5,7,8 in both parameter files.

When I ran the python script with TSA prm file, the inarray (PIXEL) has shape (nDates, 1, 1, 1) which is expected However, when I ran the same script with UDF prm file, the inarray has shape (nDates, 6, 1, 1) which I think 6 here is the 6 bands from Landsat data, which I did not want. Also, no matter what I specified in the INDEX, it always returns exactly 6 bands

Is this intended to have different behaviours for running UDF from different modules?

davidfrantz commented 1 year ago

Hi @vudongpham,

yes, this is intended. Please see the two entry points in this tutorial: https://force-eo.readthedocs.io/en/latest/howto/udf_py.html

Also, there is no parameter INDEX in the UDF submodule, only in TSA.

Best, David

vudongpham commented 1 year ago

Oh I see

Thanks, @davidfrantz

Cheer!