Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>astre.fitsNew to Visual Studio Code? Get it now.
astre.fits

astre.fits

Renhao Ye

|
461 installs
| (1) | Free
A Simple FITS File Viewer VSCode Extension
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

astre.fits

A read-only FITS image, cube, table and spectrum viewer for VS Code desktop and desktop remote workspaces. Chinese guide.

Version 0.2.0 replaces the original parsing and rendering paths with bounded random access, document-owned workers, explicit numeric types and one rendering/input owner per webview. Opening a FITS file selects the first usable HDU. All HDUs, including empty and unsupported ones, remain available in the HDU selector and Header panel.

Version 0.2.1 adds a collapsible inspector, interactive black/midtones/white histogram handles, automatic MTF, percentile/window presets, two-axis display adjustment and transaction-based undo/redo. Scientific source values and the FITS file remain unchanged. See 0.2.1 design and acceptance guide.

Version 0.2.2 brings concise English throughout the interface, common stretch controls above the fold, a resizable inspector, live adjustment values and context-specific toolbars. See layout and verification.

Version 0.2.3 starts new views with Low = Min, High = Max and Percentile = 100. Both cutoffs offer 25 percentile choices plus custom P-value entry. The main histogram supports independent X/Y zoom, horizontal pan and reset. Release verification.

Features

  • Images with BITPIX 8, 16, 32, 64, -32 and -64; BSCALE/BZERO/BLANK, invalid masks, N-dimensional slicing and arbitrary image-axis pairs.
  • Exact source-pixel queries independent of display interpolation and stretch; stored and physical values, full FITS coordinates (1-based in the UI), units, copy and coordinate jump. Int64 values retain their decimal digits. Large integers with fractional scaling are marked approximate.
  • Min/max, ZScale, percentile and manual windows; linear, MTF, sqrt, log, power, squared, asinh, sinh and histogram scales; bias, contrast, six palettes, inversion and locked windows across slices.
  • Viewport image tiles with an overview fallback, pan, fit, 1:1, nearest/smoothed display, ROI statistics and PNG export. Large previews and ROI statistics explicitly identify approximation. Invalid pixels are magenta.
  • Binary/ASCII tables, source-row identity, bounded paging, scalar sorting, filtering, complete vector/complex cells, P/Q heaps and current-page CSV export.
  • 1D primary/extension images and table spectra; manual columns, vector source-row selection, complex components, physical units, pixel-axis fallback, peak-preserving envelope, gap preservation, plot zoom and CSV export.
  • Linear WCS and standard-pole TAN/SIN/ARC/STG/ZEA, including TAN-SIP, sparse CD/PC, swapped axes, radians and CROTA. Unsupported transformations are identified explicitly.
  • Per-HDU state restoration, reload on external changes, cancellation, diagnostic copy and the astre.fits: Show Diagnostic Log command. Source files are never edited by the viewer.

Installation and use

Install the supplied astre-fits-0.2.3.vsix using Extensions → … → Install from VSIX, then open a .fits, .fit or .fts file. Choose Reopen Editor With → FITS Viewer if necessary. Use the HDU selector to inspect extensions; a 1D image opens as a plot. Focus the canvas for F (fit), 1 (image 1:1), +/- (zoom) and left/right arrows (cube slice).

Choose Auto MTF or a percentile preset to start. Drag the B/M/W histogram handles for black point, midtones and white point; moving M selects MTF. Numeric entries and quantile presets remain available. Log Y changes count visibility; Focus shows the input histogram within the current cuts. The optional output histogram uses normalized brightness before palette/inversion.

Low/High P inputs accept a number, P12.345, 87.655%, Min or Max; press Enter or leave the field to apply. A P cut converts a sampled percentile into a physical manual endpoint and preserves the other endpoint. Invalid or crossing cuts keep the previous window. Percentile is the retained percentage with equal tails: 98% uses P1 and P99. Its presets and numeric input are both visible. Fractional ranks use linear interpolation. Min, Max and 100% retention use the full available distribution endpoints; large-file statistics remain sampled as marked. Existing saved display settings are restored; Reset applies the new defaults.

Use the histogram's X/Y minus/plus buttons, scroll to zoom X, or Shift-scroll to zoom Y counts. Drag to pan X. With the histogram focused, Left/Right pans, Up/Down changes Y, and Home resets both axes; double-click or Reset also resets. The transfer curve keeps its normalized brightness scale. Zoomed physical coordinates stay fixed when display cuts change. Chart navigation does not alter image pixels or undo history and resets when loading another slice. Horizontal navigation reuses the worker's distribution and returns chart data only; vertical navigation redraws locally.

Right-drag or Shift-left-drag on the image changes bias horizontally and contrast vertically; hold Alt for finer control. The adjustment tool enables the same operation with an ordinary left drag. Undo/redo buttons or Ctrl+Z / Ctrl+Shift+Z (Cmd on macOS) restore a complete gesture. Text inputs keep their native editing shortcuts. History is isolated by HDU/slice, capped at 50 steps per context and not persisted across editor disposal. Display settings and inspector/histogram preferences are persisted. Narrow windows use a toggleable overlay inspector.

Drag the inspector divider to resize it. Focus the divider for arrow-key adjustment; Shift uses larger steps, Home/End choose the bounds, and Enter or double-click resets the width. Undo stays visible while the inspector scrolls. Range settings, appearance, parameters/slices and pixel tools expand on demand.

Deliberate limits

This is a viewer, not a universal FITS reduction package. Tiled-compressed images, random groups and unknown extension layouts expose their headers and an unsupported diagnostic. Gzip containers, nonlinear spectral WCS, nonstandard celestial poles and additional distortion conventions are not decoded. Web-only VS Code is unsupported because the data engine uses Node workers.

Each image preview/tile is limited to 1,048,576 pixels. Large overview images use nearest subsampling; periodic structures can alias visually until zoomed to a step-1 tile. Automatic windows use an independent stratified sample (up to 1,024 source pixels for large regions); sampled ranges are not guaranteed global extrema. Full-resolution hover always reads the requested source pixel. Int64 display uses a relative exact integer offset; numbers more than 2^53 apart can exceed display precision. Raw values remain available.

Tables use 25–200 rows per page and an 8 MiB text budget. Global sort/filter and scalar spectra are limited to 1,000,000 rows, sort keys to 32 MiB, vectors to 1,048,576 elements and 1D images to 1,000,000 points. Vector/complex sorting is intentionally disabled. CSV exports the current table page or the selected spectrum, not an implicit whole table. PNG exports the visible canvas, including overlays. Non-file URI providers use workspace.fs with a configurable 64 MiB default buffer cap. Local files use an 8 MiB default byte-page cache per document.

Development and verification

Use Node.js 22+ for development, then npm ci and npm test (clean build, strict type checks, lint, numerical/data/lifecycle tests). Runtime has no npm or Python dependencies.

Additional checks:

python -m pip install -r tests/requirements.txt
npm run test:browser
npm run test:host
npm run test:performance
npm run test:compatibility
npm run package
python tests/package-check.py astre-fits-0.2.3.vsix

The browser test uses installed Chrome; set CHROME_EXECUTABLE when it is not at the Windows default path. Host tests use installed VS Code; set VSCODE_EXECUTABLE on other systems. Test profiles are isolated under test-results/. The checked-in generated FITS and reference JSON make npm test independent of Python and network. npm run samples:download retrieves six NASA samples and records SHA-256 hashes. See sample matrix, design and verification and historical audit.

GPL-3.0-only. The Viridis lookup data is attributed in THIRD_PARTY_NOTICES.txt. No telemetry or runtime network requests are made by the extension.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft