Skip to content

Other types of mean using volume_average #307

Description

@shashwat97

Hi,

I want to calculate the harmonic mean for a tree mesh based on an input tensor mesh. Just like the volume_average function, just a different kind of average.

I am doing it like this:

avg_df = pd.DataFrame([tree_mesh.point2index(fine_mesh.gridCC), df[prop].values]).T
harmonic_means = avg_df.groupby(0)[1].apply(hmean)

The problem is, this is much slower than the volume_average. Is there any way to use the volume_average code to find the harmonic average of the overlapping cells?

Thanks for your assistance!
@jcapriot

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions