split NetCDF file handling from header parsing