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.
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 onekilopars.ec), 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:
- A recent Mac
- A copy of Xcode (Xcode 8, as of now, December 2016, but Xcode 7 should also work)
- Some knowledge of Objective-C and C... and FITS!
- Simply fork this project on GitHub,
carthage updateto grab the ObjectFITSIO framework. See this page if you don't know Carthage.
- Open QLFits3.xcodeproj and make your modifications (I can help),
- Test – see Debug below (I can also help, if time permits, business as usual),
- Submit a pull request (via GitHub)!
How to debug (manually)
- Build your (modified) QLFits3. Now, a new version is being put in
- Navigate in the Finder to look for a FITS file, and press .
- Or run the command
qlmanage -p[-t] <path/to/fits/file>to test previews (vs thumbnails) from the Terminal.
How to debug (advanced)
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:
- Edit the "QLFits3" scheme in Xcode, select the "Run" section, "Info" tab.
- Choose "Other..." in the drop "Executable" down menu, a 'Open Dialog' will open.
open -a Finder /user/bin/in a Terminal and locate the
- Drag & Drop the
qlmanageexecutable from the Finder anywhere in the Open Dialog.
- Click "Choose" and close the 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
-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.
Project Notes For Developers
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.
macOS dynamic types
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:
LICENSE & NOTES
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!