The macOS quicklook plugin for FITS files.
SwiftAA • AA.js • QLFits • FITSImporter • ObjCFITSIO
Install with Homebrew:
brew cask install qlfits
QLFits is a macOS Quicklook plugin for FITS (Flexible Image Transport System) files, used by astronomers worldwide to store and share their data. It is for macOS 10.8 and up.
QLFits 3 is an entirely new implementation of QLFits, using the open-source projects ObjCFITSIO and AstroCocoaKit written by yours truly.
QLFits3 reads the following extensions: fits, fit, fts, ft, mt, imfits, imfit, uvfits, uvfit, pha, rmf, arf, rsp, pi. If your FITS file is not recognized, let me know (cedric at onekiloparsec.dev), the dynamic macOS type of your file might not be included in the list. See below to see what dynamic types QLFits3 recognises.
QLFits3 show all HDU headers, and draw (when possible) all 2D images and 1D spectra.
Et voilà! Enjoy seeing the content of your FITS files in the Finder:
It is released open source under the GNU General Public Licence.
Put the QLFits3.qlgenerator bundle either in /Library/QuickLook
or in ~/Library/QuickLook
(but only if your are an a system older than macOS 10.10 Yosemite for the latter) and run the (safe and instantaneous) command: qlmanage -r
to reset the quicklook daemon.
If you want to contibute, you need:
Then,
carthage update
to grab the ObjectFITSIO framework. See this page if you don't know Carthage.~/Library/QuickLook
qlmanage -p[-t] <path/to/fits/file>
to test previews (vs thumbnails) from the Terminal.Note: What follows is supposed to work, but a bug in macOS prevents it, and I never found a real workaround. (The error message being the following: "*** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xaf03, name = 'com.apple.CFPasteboardClient'")
The idea is first to locate the qlmanage
binary file, and include it as the "Executable" in the "Run" section of the "QLFits3" scheme. To do so:
open -a Finder /user/bin/
in a Terminal and locate the qlmanage
alias.qlmanage
executable from the Finder anywhere in the Open Dialog.Now one can "Run" the QLFits3 project from within Xcode. But we haven't yet told it what to do exactly at run. So go back to the QLFits3 scheme, and choose the 'Arguments' tab of the same "Run" section. In the section "Arguments Passed On Launch" add -p <path/to/any/of/your/fits/file>
Use -t
to create thrumbnails instead of previews. You can put multiple entries here, but only the first selected one will be used once qlmanage runs.
Note that you can use FITSImporter, the macOS Spotlight plugin for FITS file as good companion.
There is a Copy Files build phase that puts the Debug build of Provisioning.qlgenerator in your /Library/QuickLook folder.
QuickLook plug-ins sometimes don't like to install. Learn to use "qlmanage -r" to reset the daemon. Using "qlmanage -m plugins" will tell you if the plug-in has been recognized. Sometimes you have to login and out before the plug-in is recognized.
For custom or special file extensions, macOS assign dynamic types. QLFits3 contains a list of such types to allow it to recognize them (in addition to the filename extensions). See Info.plist file inside QLFits3.qlgenerator in case of doubt. To check the dynamic type of your FITS file, open a Terminal and type the following command mdls <path/to/your/file> | grep kMDItemContentType
. You shluld obtain something like kMDItemContentType = "dyn.ah62d4rv4ge80q4pysq"
.
List of known extensions:
Cédric Foellmi (@onekiloparsec)
QLFits is licensed under the MIT license and hosted on GitHub at https://github.com/onekiloparsec/QLFits/ Fork the project and feel free to send pull requests with your changes!