piv2hdf

Tool for the conversion of PIV measurements into HDF5 files

https://github.com/matthiasprobst/piv2hdf

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.0%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Tool for the conversion of PIV measurements into HDF5 files

Basic Info
  • Host: GitHub
  • Owner: matthiasprobst
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 1.7 MB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Created about 1 year ago · Last pushed 9 months ago
Metadata Files
Readme License Citation Codemeta

README.md

piv2hdf

Tool for the conversion of PIV measurements into HDF5 files

Tests codecov pyvers

Installation

pip install piv2hdf

or for development:

pip install -e piv2hdf

The conversion of davis files requires the package lvpyio. This can be installed by running: pip install piv2hdf[davis] Note, that Davis files cannot be converted on MacOS!

TL;DR

Examples are provided as Jupyter Notebooks in the examples/ directory: - Converting snapshot data

Introduction and Documentation

This package provides a simple interface to convert PIV data into HDF5 files. It is designed to be easily extendable for other PIV software. Currently, the following software is supported:

Workflow: You have processed your PIV images with one of the above software. Then you use piv2hdf to convert the result files into a single HDF5 file.

This file can then be used for further processing, sharing or archiving.

Click on the above links to jump to the individual README-files of the respective software, which give additional information, remarks and example codes.

Nomenclature:

Depending on the provided data, we distinguish between three PIV data cases, which all can be written into a single : HDF5 file:

  • Snapshot: A single PIV result (of an image pair)
  • Plane: A list of multiple snapshots, i.e. a PIV result for a time series at one z-coordinate
  • MultiPlane: A list of planes, i.e. the flow was traversed and the operation condition and PIV settings kept constant

Note, that in order to write a multiple planes into a single HDF file, the planes must have the grid and the time vectors must identical or similar within a given tolerance. This is checked automatically.

Examples

Say, your PIV files are located in "data/". The files are result files created by your favorite PIV-software. Say, they were generated by the commercial software PIVview. Then the file format is .nc. For this case, the following lines will convert those files into a single very handy HDF5 file:

```python from piv2hdf import PIVPlane from piv2hdf.pivview import PIVViewStereoNcFile from datetime import datetime

time info can be either a list of datetime objects corresponding

to the files or

the start datetime and the recording frequency in Hz can be provided:

time_info = (datetime(2023, 11, 6, 12, 13, 4), 4000)

planedatadir = 'data' plane = PIVPlane.fromplane(planedirectory=planedatadir, timeinfo=timeinfo, pivfile=PIVViewStereoNcFile) plane.to_hdf() ```

The class PIVPlane is the interface class for PIV plane data. You have to provide the implemented PIV software class, in this case PIVViewStereoNcFile. Also, the time vector or the recording frequency must be provided (recording_time_or_frequency).

The module pivview provides the class PIVViewNcFile and PIVViewStereoNcFile which allows working with nc files either containing 2D2C or 3D3C (stereo) data.

Note: Single files (so-called snapshot files) can be converted using piv2hdf.PIVSnapshot. Multiple planes can be converted into a single HDF file by using piv2hdf.PIVMultiPlane.

Note: Currently, only the software PIVview (commercial), Davis (commercial) and OpenPIV (opensource) are supported.

Configuration

Configurations are associated with PIVSnaphsot, PIVPlane and PIVMultiPlane:

```python

Set the compression level to 9

plane.config['compression'] = 9

print(plane.config) ```

PIV Flags

Every software uses different flags. This package uses the following flags, which are taken from PIVview (PIVTec GmbH). For each software the flags must be converted which these flags:

| Name | Flag | Description | |:--------------:|:----:|--------------------------------------------------------------------------| | INACTIVE | 0 | The data is not valid, e.g. because it is outside the interrogation area | | ACTIVE | 1 | The data is unmodified | | MASKED | 2 | The data is masked out | | NORESULT | 4 | No result is available even after calculation | | DISABLED | 8 | The data is disabled manually or by outlier detection | | FILTERED | 16 | The data is modified through a filter operation | | INTERPOLATED | 32 | The data is interpolated from neighboring data | | REPLACED | 64 | The data is replaced by another correlation peak | | MANUALEDIT | 128 | The data is manually modified |

Troubleshooting

  • netCDF4-1.6.0 and pytest-7.1.3 don't work together! Raises bizarre error including "frozen_import..."
  • netCDF4-1.6.0 only works up to python 3.8 (info from 20.10.2022)

Owner

  • Name: MatthiasProbst
  • Login: matthiasprobst
  • Kind: user
  • Location: Karlsruhe
  • Company: Karlsruhe Institute of Technology

I have fun programming with Python, whether it is for scientific or private projects. Most of my repos are related to fluid mechanics or data management.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: "Probst"
    given-names: "Matthias"
    orcid: "https://orcid.org/0000-0001-8729-0482"
title: "piv2hdf"
version: 2.0.0a2
doi: 10.5281/zenodo.14496848
date-released: 2025-02-25
url: "https://github.com/matthiasprobst/piv2hdf"

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "license": "https://spdx.org/licenses/MIT",
  "codeRepository": "git+https://github.com/matthiasprobst/piv2hdf",
  "name": "piv2hdf",
  "version": "2.0.0a2",
  "description": "Tool for the conversion of PIV measurements into HDF5 files",
  "applicationCategory": "Engineering",
  "programmingLanguage": [
    "Python 3",
    "Python 3.9",
    "Python 3.10",
    "Python 3.11"
  ],
  "operatingSystem": [
    "Linux",
    "Windows",
    "macOS"
  ],
  "author": [
    {
      "@type": "Person",
      "@id": "https://orcid.org/0000-0001-8729-0482",
      "givenName": "Matthias",
      "familyName": "Probst",
      "email": "matth.probst@gmail.com",
      "affiliation": {
        "@type": "Organization",
        "name": "Karlsruhe Institute of Technology, Institute of Thermal Turbomachinery"
      }
    }
  ]
}

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 45
  • Pull request event: 7
  • Create event: 8
Last Year
  • Release event: 1
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 45
  • Pull request event: 7
  • Create event: 8

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • matthiasprobst (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 10 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: piv2hdf

Tool for the conversion of PIV measurements into HDF5 files

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 10 Last month
Rankings
Dependent packages count: 9.7%
Average: 32.2%
Dependent repos count: 54.6%
Maintainers (1)
Last synced: 7 months ago