0
$\begingroup$

I have a 2D data array indicating a chemical percentage content (PC) in a chemical droplet. I am trying to calculate the average PC in the droplet. The image of one of these arrays is shown below (the colour bar represents the PC):

enter image description here

The droplet, is naturally a 3D (almost hemispherical) structure, so I must calculate a weighted average, as the volume in the centre of the droplet is higher than at its edges.

How can I calculate this weighted average? What weight do I give to a pixel at the centre compared to a pixel at the edges?

Would this require me to know the actual height of each pixel, or could that be theorised?

$\endgroup$
6
  • 1
    $\begingroup$ It really depends on what you need this for. But as a gut reaction, I would say that the droplet height in each box should indeed be included, and that you should include some idea of this height. The result will be quite different if your droplet is essentially a cylinder, or a hemisphere, or a cylinder topped with a hemisphere, or some other rotational figure. $\endgroup$ Commented Mar 13, 2024 at 13:52
  • $\begingroup$ The 3D scan of the sample is not perfect, but after some denoising it seems relatively hemispherical, with the z-direction radius being slightly longer than the x and y radii. So maybe I could just use the hemisphere model to do this. But I am not sure how to do a weighted average of such a sample. If it was based on volume I could do $w_{av} = \frac{\sum_i^n V_i PC_i}{V_{total}}$ , but can I apply the same formula substituting V by height? $\endgroup$ Commented Mar 13, 2024 at 14:08
  • 1
    $\begingroup$ Yes, that makes sense. For fixed base area (which you can assume here, right?), volume is proportional to height. So just weight by height. Note that in a weighted average, scaling all (!) the weights by the same amount leaves the weighted average unchanged, because the denominator gets scaled by the exact same number. So it's quite enough to get the height up to some constant factor. $\endgroup$ Commented Mar 13, 2024 at 14:15
  • $\begingroup$ When you mean to a constant factor, you are referring to the denominator in the equation above, am I correct? $\endgroup$ Commented Mar 13, 2024 at 14:23
  • 1
    $\begingroup$ Both. If you scale all heights by a constant factor, replacing each $h_i$ by $ch_i$ for a constant $c$, then each volume will be scaled by the same number, $V_i\to cV_i$ (because bases are of equal size), and so will the total volume, $V_{\text{total}} \to cV_{\text{total}}$, so you can cancel the $c$ in calculating the weighted average. $\endgroup$ Commented Mar 13, 2024 at 14:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.