On Mon, Nov 11, 2024 at 06:37:41PM +0000, Smith, Justin wrote:
> I wrote a simple standalone Pygwy script which applies align_rows, fix_zero,
> and grain_wshed in the same order and with the same settings (per the log
> window) as in interactive mode. However, some (but not all—26 of the 47
> GrainQuantity value sets do match) of the value columns obtained from the
> script do not match the values obtained from interactive mode.

There is a simple mistake in the script. You need to do

    height_field.grains_get_values(...)

not

    mask_field.grains_get_values(...)

The mask defines where the grains are (which is then captured by the
numbering – grains_arr in your case). But their properties are
calculated using the actual topography.

If you pass the mask field instead, area-related quantities will be OK
because they are defined entirely by the xy coordinates and the heights
do not matter. But any quantities related to heights will be wrong
because you are now processing the 0s and 1s in the mask field.

Regards,

Yeti



_______________________________________________
Gwyddion-users mailing list
Gwyddion-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gwyddion-users

Reply via email to