Metadata-Version: 2.4
Name: dales-tile-combiner
Version: 0.1.0
Summary: Combine DALES MPI-split NetCDF tiles into an HDF5 virtual dataset (VDS).
Author-email: André van Ginkel <a.vanginkel@tudelft.nl>
License: MIT License
        
        Copyright (c) 2025 André van Ginkel
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/Xetalim/dales_combine_script
Project-URL: Source, https://github.com/Xetalim/dales_combine_script
Keywords: DALES,netcdf,hdf5,vds,tiles
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: h5py~=3.14.0
Requires-Dist: netCDF4~=1.7.2
Requires-Dist: numpy
Dynamic: license-file

# DALES tile combiner
This script combines [DALES](https://github.com/dalesteam/dales) MPI-split NetCDF (.nc) files into a single HDF5 Virtual Dataset (VDS) file.
This HDF5 file is made in such a way as to appear like a netCDF file, so most readers I've tried don't even know it's a VDS.

The resultant file can be read with any of your usual netCDF tools, and all attributes in the original files should be preserved.
# Installation
Install dependencies via requirements.txt:
```
pip install -r requirements.txt
```
# Usage
```
python dales_tile_combiner.py <data_directory>
```
given the directory
```
<data_directory>
    fielddump.000.000.001.nc
    fielddump.000.001.001.nc
    fielddump.000.002.001.nc
    fielddump.000.003.001.nc
```
yields
```
fielddump.nc # is an in-file relative symbolic link to <data_directory>
<data_directory> 
    fielddump.000.000.001.nc
    fielddump.000.001.001.nc
    fielddump.000.002.001.nc
    fielddump.000.003.001.nc
```
yields
The script automatically detects known file types (fielddump, cape, surfcross, slrbcross, crossxy, crossxz, crossyz) and generates combined VDS files in the current directory (e.g., fielddump.nc).

## Crosssections
Crosssections made with modcrossection (crossxy, crossxz, crossyz) are all combined into a single file. They are combined along dimension (zt/zm, yt/ym, xt/xm) respectively and given coordinate (zt/zm, yt/ym, xt/xm) corresponding to their INDEX. (not their actual coordinate as that information is not available within the crosssection file)
# Limitations
- There is no support yet for LSM crosssections like lsmcrossyz and lxmcrossxz.
- The resultant file does not contain the actual data, merely (relative) links to the data files. Moving the datafiles thus breaks the VDS file.

# Bugs?
Please raise an issue and let me know if I can do anything.
