netCDF4 file access via h5py with hierarchical and legacy APIs for scientific computing
69
Build a climate data processing utility that creates, reads, and manages netCDF files for storing temperature measurements from multiple weather stations.
Create netCDF files with:
Read existing netCDF files to:
Append data to existing files:
@generates
def create_climate_file(filepath, num_stations):
"""
Create a new netCDF file for climate data storage.
Args:
filepath: Path where the netCDF file should be created
num_stations: Number of weather stations (fixed dimension size)
Returns:
None (file is created and closed)
"""
pass
def read_file_metadata(filepath):
"""
Read metadata from an existing netCDF file.
Args:
filepath: Path to the netCDF file
Returns:
dict: Dictionary containing:
- 'title': Global title attribute
- 'time_size': Current size of time dimension
- 'station_size': Size of station dimension
"""
pass
def append_measurements(filepath, temperature_data):
"""
Append new temperature measurements to an existing file.
Args:
filepath: Path to the netCDF file
temperature_data: List or array of temperature values to append
Returns:
int: New size of the time dimension after append
"""
passProvides netCDF4 file format access via h5py.
Install with Tessl CLI
npx tessl i tessl/pypi-h5netcdfdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10