input($geotiff)
# the GeoTIFF is in log units, so convert to non-log space.
-> select({ *, exp(value) as geotiff_value })
# by default sampling the HDF5 will return the PGA mean (*not* in log units)
-> select({ *, sample_centroid(centroid(geom), $hdf5) as hdf5_value })
-> select({ hdf5_value, geotiff_value, centroid(geom) as geom, round(abs(geotiff_value - hdf5_value), 4) as diff })
-> group({ count(diff > 0) as count })
-> save('differences', format: 'csv')

