Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>MyFitsNew to Visual Studio Code? Get it now.
MyFits

MyFits

Mingyu Li

|
2,161 installs
| (4) | Free
A VSCode extension to preview .fits file.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MyFits

MyFits is a Visual Studio Code extension for previewing astronomical FITS files directly inside VS Code.

Install: Search MyFits in the VS Code Extension Marketplace.

Current Release

Version 0.5.0 adds the first interactive FITS DataCube preview workflow. Cube preview is still under heavy development, so behavior and UI may change quickly while the feature matures.

Supported Files

MyFits registers a custom editor for common FITS-related extensions, including:

  • .fits, .fit, .fts, .FITS, .FIT, .FTS
  • .arf, .rmf, .rsp, .rsp2
  • .pi, .pha, .evt, .img, .lc
  • .dph, .hk, .mkf, .cat

Features

HDU Browser and Headers

  • Inspect all HDUs in a file, including primary HDUs, image extensions, binary tables, and ASCII tables.
  • Search FITS header cards quickly.
  • Resize or collapse the HDU tree/header area.
  • Automatically collapse the HDU tree/header area when the file has only one HDU with data, while keeping the top header clickable for reopening.

2-D Image Preview

  • Preview image HDUs with a built-in VS Code-native viewer.
  • Zoom, pan, fit-to-view, and use pixel-preserving scale controls.
  • Switch colormaps, invert colors, and adjust stretch/scale modes.
  • Use ZScale, percentile presets, or Min/Max display scaling.
  • Read pixel coordinates and values from the status bar.
  • Show RA/Dec readout for supported linear celestial WCS pairs.

Image data:

FITS DataCube Preview

Cube preview is new in 0.5.0 and is still under heavy development.

Current cube support includes:

  • Preview 3-D and 4-D image HDUs.
  • Ignore singleton cube axes automatically, so dimensions with length 1 do not clutter the UI.
  • Prefer celestial display axes such as RA/Dec when available, and infer a spectral axis from common FITS CTYPE values.
  • Keep the image viewport focused on the selected 2-D slice.
  • Use a bottom spectrum panel inspired by QFitsView-style cube inspection.
  • Hover over the image to sample a spectrum at the cursor position.
  • Lock the spectrum position with L.
  • Set Aperture Radius; radius 0 is a single pixel, and larger radii sum the highlighted aperture pixels.
  • Highlight the sampled pixel/aperture on the image.
  • Display the spectrum as a histogram-style step plot.
  • Show spectral axis ticks using automatically selected units such as GHz, MHz, um, mm, or AA.
  • Toggle between frequency and wavelength display with the lambda/nu button when the axis metadata supports conversion.
  • Show the current spectral cursor value and the raw slice ID while hovering over the spectrum canvas.
  • Click the spectrum to switch the displayed image slice.
  • Use the right-side < and > buttons in the spectrum toolbar to scroll through slice IDs.
  • Enter Min/Max spectral-axis display bounds in the current display unit.
  • Hold C and drag on the spectrum to choose a spectral range and generate a sum-collapse image.

Limitations in the current cube preview:

  • Cube preview is still under heavy development and should be treated as experimental.
  • The UI currently focuses on inspection, not exporting or writing collapsed FITS products.
  • Collapse in the cube UI is currently sum-based.
  • Very large cubes may still hit preview limits or take time to sample, especially with large apertures.
  • WCS support is intentionally conservative; non-celestial display axes keep pixel/value readout rather than forcing incorrect RA/Dec.

Table Preview

  • Preview binary and ASCII table HDUs.
  • Show column name, unit, format, and inferred data type.
  • Search all rows using the global row search box.
  • Page through large tables without loading every rendered row into the DOM at once.
  • Change page size.
  • Sort by clicking table column headers.
  • Keep the table header fixed while scrolling.

Table data:

Performance and Loading Model

  • Scan the FITS manifest first, then load image, table, and spectrum payloads on demand.
  • Cache recent image payloads for responsive cube slice navigation.
  • Use chunked reads for cube slices and spectrum sampling instead of loading entire cubes into memory.
  • Return friendly preview errors when a file is too large or unsupported for the current preview path.

Known Issues

  • FITS DataCube preview is under heavy development. Expect rapid UI and behavior changes in upcoming releases.
  • Extremely large image, table, or cube HDUs can exceed VS Code memory or preview limits.
  • Highly custom FITS table descriptors are normalized into string previews and may not preserve every low-level formatting detail.
  • WCS handling is limited to preview-safe cases and does not replace a dedicated scientific FITS/WCS analysis workflow.

Release Notes

See CHANGELOG.md for the full release history.

Feedback

This extension is actively developed as part of AstroMy. Please open issues or share ideas if a FITS workflow does not preview correctly.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft