FITS Browser
A compact viewer for filesystem FIT files that displays a directory tree and per-file metadata and statistics. Only files with extensions .fit, .fits and .fz are shown.
Key Features
- Browse the filesystem in a TreeTable (directory structure + file rows).
- Configurable FIT header-based naming / display strings (placeholders and preformatted keys).
- Per-file statistics (Mean, Median, Sigma, avgDev, MAD, Robust Sigma).
- Basic file operations: copy, move, drag & drop, rename, delete, clipboard copy of rows.
- Real-time updates for displayed directories (watcher for expanded nodes).
- Double-click opens a file in the system default application.
- Context menu, toolbar and status bar integrated (menu and toolbar actions such as Refresh, Home, Select).
TreeView Columns
1. File / Directory (first column)
The first column shows the hierarchical directory tree and FIT files. Directories can be expanded/collapsed. Icons distinguish folders and files; the icon must be set on the first column for multi-column TreeView.
2. FIT Header Column (second column)
The second column renders configurable strings built from FIT header keywords. The format supports placeholders in curly braces and special preformatted keys (prefixed with #) for nicer display.
Formatting placeholders
Use placeholders in the template string. Examples:
• Plain placeholders
{KEY}
are replaced with the raw header value for
KEY
. Text outside braces is preserved as-is.
• Preformatted placeholders
{#KEY}
insert specially formatted values (see list below).
Preformatted keys (
#KEY
)
These keys are generated by the formatter and provide canonical, human-friendly values.
| Preformatted Key | Meaning / Format | Example |
|---|---|---|
| #DATE-OBS |
Observation date (from
DATE-OBS
) formatted as
yyyy-MM-dd
.
|
2025-11-17 |
| #TIME-OBS |
Observation time (from
TIME-OBS
or from
DATE-OBS
after "T") formatted as
HH:mm:ss.SSS
.
|
15:55:05.961 |
| #DATE-OBS_SAFE |
Digits-only date (first 8 digits), format
yyyyMMdd
.
|
20251117 |
| #TIME-OBS_SAFE |
Digits-only time string (no punctuation), e.g.
HHmmssSSS
style.
|
155505961 |
| #EXPTIME |
Exposure time from
EXPTIME
or
EXPOSURE
, rendered as seconds (integer ->
30s
, fractional -> compact format).
|
30s or 1.2345s |
| #CCD-TEMP |
CCD temperature rounded to 0.5°C steps, unit appended (
C
).
|
-10C or -10.5C |
| #BIN |
Binning info: either
BINNING
like
2x2
, or combined
XBINNINGxYBINNING
.
|
2x2 |
| #MODE |
Combined mode string from
LOWNOISE
,
FULLWELL
and
GAINMODE
, e.g.
LN-FW-HCG
.
|
LN-FW-HCG |
| #OBJECT |
Sanitized
OBJECT
header: invalid filesystem chars removed, spaces replaced with
-
.
|
M31-Region |
| #PROCESSING_STAGE |
Stage derived from
IMAGETYP
or stack counters: e.g.
CAL
,
REG
,
STACK3
,
PROC
.
|
STACK3 |
| #FILTER |
Normalized filter name: whitespace →
-
, special chars removed, uppercase.
|
L-ENHANCE |
| #GAIN_OFFSET |
Combined gain/offset string, e.g.
GAIN_100-OFFSET_300
.
|
GAIN_100-OFFSET_300 |
| #GAIN | Formatted gain value (rounded integer or compact scientific format). | 100 |
| #OFFSET | Formatted offset value (rounded or compact). | 300 |
Example combined template:
3. Statistics Column (third column)
The statistics column displays computed image metrics for each FIT file.
- Mean – arithmetic mean of pixel values.
- Median – median pixel value.
- Sigma – standard deviation.
- avgDev – average absolute deviation.
- MAD – median absolute deviation.
- Robust Sigma – robust dispersion estimate (useful for outlier-resistant analysis).
File Operations & Interaction
Drag & Drop
- External (from OS): files/folders dropped from the system are accepted as copy operations (most OSs only allow COPY into another process). Directories dropped are copied recursively.
- Internal (within the application): drag & drop between tree nodes supports both COPY and MOVE operations; internal MOVE is supported when both source and target are in the same application.
- Drop target resolves to the file node under cursor; only directory nodes accept dropped files.
Clipboard & Keyboard
- Selected row can be copied to system clipboard as a single tab-separated line (all visible columns).
- Ctrl+C keybinding can be wired to copy the selected row.
Context Menu & Toolbar
- Right-click context menu adapts to the selection (file vs directory) and can include actions: Open, Rename, Delete, Copy row, Refresh, etc.
- Toolbar provides actions such as Refresh, Home and a right-aligned Select action.
Rename / Delete
Rename and delete update the filesystem and then refresh the corresponding parent node in the tree. Deletion removes the node from the model and viewer. Renaming updates the node text and any dependent metadata columns.
Real-time Updates (Watcher)
The implementation includes a filesystem watcher that registers only the currently expanded (visible) directories.
- When a directory is expanded the watcher registers that path; when the directory is collapsed it may be unregistered to save resources.
- Watcher listens for create/delete (and optionally modify) events in expanded directories and updates the TreeViewer accordingly: add/remove specific nodes or update metadata.
- Modify events are debounced (batched) to avoid flooding the UI when a file produces many rapid updates.
Double-click behavior
Double-clicking a file opens it using the system default application
CLI Default Directory
The application can be launched with an optional initial directory argument. Syntax:
java -jar fits-browser.jar [<initial_directory>]
If the path is valid the tree automatically expands to and selects that directory on startup; if invalid the app falls back to the default root.