An extension to explore the metadata of scientific data files within your IDE, including NetCDF, Zarr, HDF5, GRIB, GeoTIFF and JPEG-2000.
Current Version: v0.5.0 โข Release Notes
Available on: VSCode Marketplace โข Open VSX Registry
- Multi-format Support:
| Format | File Extension |
|---|---|
| NetCDF | .nc, .netcdf, .nc4, .cdf |
| Zarr | .zarr |
| HDF5 | .h5, .hdf5 |
| GRIB | .grib, .grib2, .grb |
| GeoTIFF | .tif, .tiff, .geotiff |
| JPEG-2000 | .jp2, .jpeg2000 |
- Python Integration: Automatic Python environment detection and management
- File Tree Integration: Right-click on supported files in the explorer to open them
- Custom Editors: Direct file opening with dedicated editors
- Interactive Data Explorer: Browse file structure, dimensions, variables, and attributes
- Browse Variable Information: View variable dimension names, data types, shapes, and memory usage
- Basic Data Visualization: Create plots and visualizations directly in VSCode (experimental, best effort)
- Enhanced GeoTIFF Support: Multi-band GeoTIFF files automatically convert bands to separate variables for improved readability and plotting
- HTML Report Export: Export complete data viewer content as self-contained HTML reports for sharing and documentation
- Command Palette Integration: Multiple commands for data viewer operations
- Status Bar Integration: Shows current Python interpreter status
- Human-readable File Sizes: Display file and variable sizes in appropriate units (B, kB, MB, GB, TB)
- Easy Settings Access: Ctrl+Shift+P โ Scientific Data Viewer: Show Settings
- Error Handling: Robust error handling with user-friendly messages
- Experimental Features: Configurable experimental features with clear warnings
Data Visualization and Plotting
Data Structure Exploration
-
Install from VSCode Marketplace:
- Open VSCode
- Go to Extensions view (
Ctrl+Shift+X) - Search for "Scientific Data Viewer"
- Click Install
-
Install required Python dependencies: (prompted by extension)
pip install xarray matplotlib
-
Install optional Python dependencies: (prompted by extension)
pip install netCDF4 h5py rioxarray cfgrib zarr
-
Open a supported file ๐
Before using this extension, you need either Python 3.13 or uv installed on your system.
With Python 3.13:
The extension will prompt you to install the following packages if they are not available:
- Required Python packages:
- xarray
- matplotlib
- Optional Python packages:
- netCDF4
- h5py
- rioxarray
- cfgrib
- zarr
Note: Former Python versions may work, but it is not guaranteed nor supported.
With uv, the extension will create and manage its own python environment, indluding the Python version 3.13. The environment wil be stored in the extension dedicated storage, provided by VSCode or Cursor.
The extension supports multiple ways to configure your Python environment:
-
Python Extension Integration (Default behaviour):
- This mode delegates most of the work to the Python extension. Its installation is a requirement.
- For VSCode users: ๐ Python extension (VSCode Marketplace)
- For Cursor users: ๐ Python extension (Open VSX Registry)
- Press Ctrl+Shift+P (open command palette)
- Type "Python: Select Interpreter"
- Choose your preferred Python environment
- The extension will automatically detect it and use it
- This mode delegates most of the work to the Python extension. Its installation is a requirement.
-
Extension Virtual Environment (Semi-Standalone):
- Opt-in setting:
- Press Ctrl+Shift+P (open command palette)
- Type "Scientific Data Viewer: Show Settings"
- Check "Scientific Data Viewer > Python > Use Extension Own Environment"
- uv Required:
- Consult the documentation: uv installation
- If uv is installed and found: The extension creates its own isolated environment once the setting enabled, including Python 3.13 installation
- If uv is not available, falls back to Python extension default behavior
- Manage Extension Environment:
- Press Ctrl+Shift+P (open command palette)
- Type "Scientific Data Viewer: Manage Extension Virtual Environment"
- Choose a command: create, update, delete, view information
- Benefits of this approach:
- Python 3.13: Uses uv to install and use Python 3.13 for optimal performance
- Self-Contained: Works without external Python environment setup
- Isolated: Won't interfere with your other projects
- Storage: Stored in VSCode's extension storage space
- Opt-in setting:
-
Click on file from File Explorer:
- Click on any supported file in the File Explorer
- File opens directly in the Scientific Data Viewer
- Command "View: Split Editor" is supported
-
Drag and drop from File Explorer
- Drag and drop any supported file (or folder)
- File (or folder) opens directly in the Scientific Data Viewer
- Multiple files (or folders) can be opened at once if they are selected
- Command "View: Split Editor" is supported
-
Context menu from File Explorer:
- Right-click on any supported file (or folder)
- Select "Open Scientific Data Viewer" for single file or folder
- Select "Open Scientific Data Viewer for Selection" to open multiple selected multiple files or folders
- Command "View: Split Editor" is NOT supported
-
From command palette:
- Press Ctrl+Shift+P
- Type "Open Scientific Data Viewer" (or "Open Scientific Data Viewer (Folder)")
- Select a file (or folder) from the file picker
- Multiple files (or folders) can be opened at once if they are selected
- Command "View: Split Editor" is NOT supported
Note: the only current way to get access to the split editor for Zarr folders is drag and drop.
You can explore the data via the editor itself, or via the Data Structure tree view displayed on the VSCode's left pane.
The data viewer editor shows:
- File Information: Path, size, format, and basic metadata
- Xarray HTML and Text Representations: Users that are used to xarray will be happy to see the well-known views. Uses DataTree or Dataset representation, depending on the file format.
- Xarray HTML and Text Representations (for each group): Relevant for multi-group datasets. Nested groups are flattened (using a sorted
DataTree.to_dict()). Dataset representations are always used for groups. - Global Plot Controls (:warning: EXPERIMENTAL): Use at your own risk. It will trigger plotting operations for all available variables. It is not optimized at all, and usage is not really recommended.
- Groups: The extension's data representation proposal. The view is inspired by the xarray HTML representation, with additional plotting controls. Feature parity is not reached yet as no sample data is currently displayed.
- Dimensions: Dataset dimensions and their sizes
- Coordinates: All coordinates with their types, shapes, dimension names, and memory usage. Attributes can be revealed when clicking on a coordinate..
- Variables: All data variables with their types, shapes, dimension names, and memory usage. Attributes can be revealed when clicking on a variable.
- Plot Controls (:warning: EXPERIMENTAL): "Create Plot" button for a variable, that tries the best effort to produce a plot of the variable using matplotlib. Currently, only an "auto" (best effort) plot mode is supported.
- Attributes: Show group's attributes.
Access these commands via the Command Palette (Ctrl+Shift+P):
| Command | Description |
|---|---|
Scientific Data Viewer: Open Scientific Data Viewer |
Opens the Scientific Data Viewer for a file |
Scientific Data Viewer: Open Scientific Data Viewer (folder) |
Opens the Scientific Data Viewer for a folder (eg for Zarr) |
Scientific Data Viewer: Refresh Python Environment |
Refreshes the Python environment used by the extension |
Scientific Data Viewer: Show Extension Logs |
Opens the extension's log output for debugging |
Scientific Data Viewer: Show Settings |
Opens the extension settings |
Scientific Data Viewer: Open Developer Tools |
Opens the developer tools for the webview |
Scientific Data Viewer: Manage Extension Virtual Environment |
View status and manage the extension environment (create, update, delete, info) |
Scientific Data Viewer: Export Webview Content |
Export the active Scientific Data Viewer as a self-contained HTML report |
Scientific Data Viewer: Toggle Dev Mode |
Quickly enable/disable dev mode without navigating settings |
Right-click on supported file types in the Explorer to access:
- Open in Data Viewer - Opens the file in the Scientific Data Viewer
The extension allows you to export complete data viewer content as self-contained HTML reports:
-
Using the Export Button:
- Open a scientific data file in the Scientific Data Viewer
- Click the export button (๐ผ๏ธ) in the header controls
- Choose a location and filename for the HTML report
- The report will be generated and you can choose to open it or reveal it in explorer
-
Using the Command Palette:
- Press Ctrl+Shift+P (open command palette)
- Type "Scientific Data Viewer: Export Webview Content"
- Choose a location and filename for the HTML report
Report Contents:
- Complete file information (path, size, format, engines)
- Xarray HTML and text representations
- Data structure (dimensions, coordinates, variables, attributes)
- Technical information (Python path, extension configuration, versions)
- All content is self-contained with embedded CSS and JavaScript
- Professional layout with copy buttons for easy data extraction
Use Cases:
- Share data analysis results with colleagues
- Create documentation for datasets
- Archive data viewer sessions
- Generate reports for presentations or publications
The extension can be configured through VSCode settings:
General Settings
scientificDataViewer.maxFileSize- (type:
number, default:1000000000000) - Maximum file size in MB to load
- (type:
scientificDataViewer.defaultView- (type:
string, default:"default") - Default view mode for data display.
- (type:
scientificDataViewer.matplotlibStyle- (type:
string, default:""(empty string)) - Matplotlib plot style for data visualizations. If empty, automatically detects VSCode theme and applies appropriate style (light theme โ
default, dark theme โdark_background). If set, overrides automatic detection. Examples:default,dark_background,seaborn,ggplot, or any valid matplotlib style name.
- (type:
๐ Virtual Environment Settings
The extension includes specific settings for virtual environment management:
scientificDataViewer.python.overridePythonInterpreter- (string, default:
"") - Override the Python interpreter path (takes precedence over all other options). If set, this will take precedence over the extension's own virtual environment, Python extension's interpreter, and any auto-detected environments.
- (string, default:
scientificDataViewer.python.useExtensionOwnEnvironment- (boolean, default:
false) - Use the extension's own virtual environment instead of the Python extension's interpreter. When enabled, the extension will create and use its own isolated virtual environment stored in VSCode's extension storage. Requires
uvto be installed - if uv is not available, the extension will fall back to using the Python extension's interpreter. The extension will automatically useuvto install Python 3.13 and create the environment with all required packages.
- (boolean, default:
๐ฉ Feature Flags
The extension includes configuration options that act as feature flags to control specific behaviors:
scientificDataViewer.allowMultipleTabsForSameFile- (type:
boolean, default:false) โ ๏ธ Experimental - Allow opening multiple tabs for the same file. When enabled, each 'Open in Data Viewer' action creates a new tab. When disabled (default), focuses on existing tab if file is already open.
- (type:
scientificDataViewer.devMode- (type:
boolean, default:false) - Enable development mode. When enabled, automatically runs 'Show Extension Logs' and 'Open Developer Tools' commands when a scientific data file is opened. Also reloads the webview script and CSS for faster development feedback loops.
- (type:
scientificDataViewer.convertBandsToVariables- (type:
boolean, default:true) - Convert bands of GeoTIFF rasters to variables for better readability. When enabled, multi-band GeoTIFF files (.tif, .tiff, .geotiff) will have their bands converted to separate variables instead of a single 3D DataArray. This improves plotting capabilities and data structure visualization by treating each band as an individual variable.
- (type:
-
Python not found:
- Ensure Python is installed and in your PATH
- Use the "Python: Select Interpreter" command to manually set the path
- Consider using the extension's own virtual environment for a self-contained solution
-
uv not available:
- Consult the documentation: uv installation
- Install uv manually:
pip install uvorcurl -LsSf https://astral.sh/uv/install.sh | sh - If uv is not installed, the extension will fall back to using the Python extension's interpreter
-
Missing packages:
- Install required packages:
pip install xarray matplotlib - Install per-format packages:
pip install netCDF4 zarr h5py numpy rioxarray - Or let the extension install them automatically (prompt when opening a file)
- Install required packages:
-
Large files not loading:
- Increase the
maxFileSizesetting - Consider using data slicing for very large datasets
- Increase the
-
Permission errors:
- Ensure the extension has permission to read your data files
- Check file permissions and VSCode workspace settings
- Consult the Troubleshooting section: Available at the end of the opened file. Copy buttons are present to help creating an issue.
- Check the logs: Ctrl+Shift+P (Command Palette) then type "Scientific Data Viewer: Show Extension Logs"
- Report issues: Create an issue (๐ Bug Report) on the GitHub repository
- Ask questions: Create an issue (โ Question / Discussion) on the GitHub repository
- I would like a specific feature: Create an issue (โจ Feature Request) on the GitHub repository to suggest a new feature or enhancement for the Scientific Data Viewer extension
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
See the Development Guide
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the NetCDF Viewer extension
- Built with xarray for scientific data processing
- Uses VSCode Extension API for integration
Disclaimer: The information below is provided for reference purposes only and may be outdated. Please refer to actual source code for the most current information.
scientific-data-viewer/
โโโ src/ # TypeScript source code
โ โโโ extension.ts # Main extension entry point and command registration
โ โโโ dataProcessor.ts # Python integration and data processing
โ โโโ dataViewerPanel.ts # Webview panel for data visualization
โ โโโ pythonManager.ts # Advanced Python environment management
โ โโโ logger.ts # Comprehensive logging utilities
โ โโโ communication/ # Message passing system
โ โ โโโ MessageBus.ts # Message bus for communication
โ โ โโโ MessageTypes.ts # Type definitions for messages
โ โโโ error/ # Error handling
โ โ โโโ ErrorBoundary.ts # Error boundary component
โ โโโ state/ # Application state management
โ โ โโโ AppState.ts # Global application state
โ โโโ events/ # Event handling (empty)
โ โโโ ui/ # User interface components
โ โโโ CSSGenerator.ts # CSS generation utilities
โ โโโ HTMLGenerator.ts # HTML generation utilities
โ โโโ JavaScriptGenerator.ts # JavaScript generation utilities
โ โโโ UIController.ts # UI controller logic
โ โโโ webview/ # Webview assets
โ โโโ styles.css # Webview styles
โ โโโ webview-script.js # Webview JavaScript
โโโ python/ # Python scripts for data processing
โ โโโ get_data_info.py # Extract file metadata and variable info
โ โโโ create_sample_data.py # Generate sample data files
โ โโโ tests.ipynb # Jupyter notebook for testing
โโโ test/ # Test files
โ โโโ runTest.ts # Test runner
โ โโโ suite/ # Test suites
โโโ sample-data/ # Sample data files for testing
โ โโโ sample_data.nc # NetCDF sample file
โ โโโ sample_data.h5 # HDF5 sample file
โ โโโ sample_data.grib # GRIB sample file
โ โโโ sample_data.jp2 # JPEG2000 sample file
โ โโโ sample_data.tif # GeoTIFF sample file
โ โโโ sample_data.zarr/ # Zarr sample datasets
โ โ โโโ sample_zarr_arborescence.zarr/
โ โ โโโ sample_zarr_inherited_coords.zarr/
โ โ โโโ sample_zarr_nested_groups_from_datatree.zarr/
โ โ โโโ sample_zarr_nested_groups_from_zarr.zarr/
โ โ โโโ sample_zarr_single_group_from_dataset.zarr/
โ โโโ broken_file.* # Test files for error handling
โ โโโ sdv-plots/ # Generated plot outputs
โโโ docs/ # Documentation
โ โโโ ARCHITECTURE_IMPROVEMENTS.md
โ โโโ DEVELOPMENT.md # Development guide
โ โโโ PUBLISHING.md # Publishing guide
โ โโโ QUICKSTART.md # Quick start guide
โ โโโ TECHNICAL_ARCHITECTURE.md # Technical architecture docs
โ โโโ test-extension.md # Extension testing guide
โ โโโ rfc/ # Request for Comments
โ โโโ README.md
โ โโโ 001-033-*.md # RFC documents
โโโ media/ # Media assets
โ โโโ icon.png # Extension icon
โ โโโ icon.svg # SVG icon
โ โโโ icon_orig.svg # Original icon
โ โโโ Screenshot*.png # Screenshots
โโโ out/ # Compiled JavaScript output
โ โโโ src/ # Compiled TypeScript
โ โโโ test/ # Compiled tests
โโโ node_modules/ # Node.js dependencies
โโโ package.json # Extension manifest and dependencies
โโโ package-lock.json # Dependency lock file
โโโ tsconfig.json # TypeScript configuration
โโโ .eslintrc.json # ESLint configuration
โโโ language-configuration.json # Language configuration
โโโ scientific-data-viewer-0.3.0.vsix # Packaged extension
โโโ test-publication-readiness.js # Publication readiness test
โโโ setup.sh # Setup script
โโโ README.md # Main documentation
โโโ CONTRIBUTING.md # Contribution guidelines
โโโ CHANGELOG.md # Version history