Mac Software Hints

The following have been revised to version Ventura (13.5).


 

Setting up a New Mac or Upgrading to Ventura!

I procrastenated for several years, but I've finally abandoned Mojave 10.14) and with it, 32-bit support for IRAF. It's taken a while for things to become convenient again, but I'm a believer--- come on in, the water's fine! Here's what I've done to make things good for myself; of course, YMMV.

  1. Turn off Syste Integrety Protection (SIP). Starting many O/S versions ago, Apple introduced System Integrity Protection (SIP), which made it more difficult to put directories where you might want them. I'm sure it was well intentioned. They were kind enough to provide a way to turn this off. Note: on my new M2 laptop this step actually wasn't necessary. /usr/local/bin seems to exist, and default locations for a lot of things are /opt. See below.
  2. Do a software update
  3. However...you probably want to do system settings-->security-->Full Disk Access-->Terminal on. How else are you going to have fun?
  4. Set up vpn access if this is a laptop. At lowell, this has gotten pretty insane. See https://confluence.lowell.edu/display/PUB/VPN.
  5. Go to the app store and download the latest XCODE. Once it's installed, do a xcode-select --install. At some point it will ask you to accept the license agreement. If this hasn't popped up to the front, eventually you'll have trouble, so look around for it.
  6. Associate MAC address with name [This is a local Lowell thing]
  7. Settings->General-->Show scroll bars "always". Jeez. (Is this still a thing? Check! Answer: sadly, yes)
  8. Install or update XQUARTZ: https://www.xquartz.org
  9. Change the default shell to tcsh. Obviously this is a personal choice, but I don't like bash. (Why? Because I learned csh when I came to Unix from VMS.) To do this go to sys pref--->accounts; do a CNTL-click on the name (after unlocking) and change the login shell to tcsh. Copy over a working .tcshrc from somewhere.
  10. Change some things. Again, some of these are personal preferences but not the emulate three button one.
  11. Install ds9
  12. Install homebrew: see https://brew.sh/
  13. Install source-extractor: "brew install sextractor"
  14. Install Super Mongo
  15. Install TeXShop and TeX. Yes, I know a lot of the kids these days are using overleaf. But not the **cool** kids. If you're simply updating, ignore the next thing and just update TeXShop.
  16. If you want to do the whole aasTeX thing and have LaTeX find them no matter where you are....
  17. Do some brewing:
  18. Now fix the path issues: /opt/homebrew/bin/brew bundle dump and add /opt/homebrew/bin to your path.
  19. To keep astrometry-net happy, you'll need to do a ln -s sex source-extractor in the bin directory.
  20. Install IRAF

 

Installing IRAF

As of January 7, 2024 this has gotten a whole better!


 

Installing the Astrometry.net software

The astrometry.net software is pretty neat! You run it, and it blindly finds the wcs for a frame, if you're lucky. So far, in 3 out of 3 frames (one from the Lowell 31-inch, one from the 4.3-meter DCT and LMI, and one from the Swope of a very croweded field in the LMC) it's worked beautifully.

Things have gotten a lot easier to install. I found once I brought up Homebrew, I could install with only minimal head-bashing:

  1. Download and install Homebrew as above: https://docs.brew.sh/Installation
  2. Okay, hold on. On Apple Silicon machines (M1, M2) brew winds up in /opt/Homebrew/bin/brew. This is fine, but guess what--when you brew things they no longer have a link added to /usr/local/bin. Instead, they exist in their own little world, like /opt/homebrew/Cellar/astrometry-net/0.94_3/bin/solve-field. Nothing inconvenient about THAT. But there is a solution. When you're done with brewing a bunch of stuff, do a /opt/Homebrew/bin/brew bundle dump. This at least puts links in /opt/Homebrew/bin. So, you can add THAT to your path.
  3. brew install astrometry-net
  4. Install the indicies.
  5. Add /usr/local/astrometry/bin to your path
  6. Try it on a test image:
    • solve-field --overwrite --scale-units arcsecperpix --scale-low 0.44 --scale-high 0.46 --ra 23.33 --dec 29.27 --radius 0.5 121028-987.fits
    • solve-field --overwrite --scale-units arcsecperpix --scale-low 0.43 --scale-high 0.44 --ra 84.0 --dec -69.2 --radius 0.5 n2044test.fits
    • solve-field --overwrite --scale-units arcsecperpix --scale-low 0.23 --scale-high 0.25 --ra 179.8 --dec 12.3 --radius 0.1 lmi.0079.fits
    • solve-field --overwrite --scale-units arcsecperpix --scale-low 0.43 --scale-high 0.44 --ra 92.08 --dec -71.96 --radius 0.3 --tweak-order 1 --no-plots --use-sextractor -N LMC000iCIIt1.fits LMC000iCII.fits
    • Can add:
      • --use-sextractor (newer versions: --use-source-extrator)
      • --no-tweak or --tweak-order 1
      • --no-remove-lines (very useful when it won't solve). Should probably be the default.

 

Source Extractor

  1. brew install sextrator


 

CMFGEN

CMFGEN is John Hillier's wonderful radiative transfer code for hot stars with stellar winds. The care and feeding of the code is beyond the scope of the current notes. Hese are some hints that should help in getting in getting the code up and running.

In the olden days, it was best to use the PGF95 compiler on a Mac. However, NVIDA bought out the Portland Group and they no longer support Macs, and the latest (final) version of PGF95 nominally won't work on any O/S later than Mojave. So, I have revised the instructions here for getting it going on my new M2 (Apple Silicon) Macbook Air. I've retained the PGF95 instructions below as I'm still maintaining a machine or two with these.

Ventura and Apple M2 (works on Intel as well)

Compiling pgplot

Back to compiling cmfgen

  • There is only one file we have to change before we compile:
  • Well, that should do it. Do a make clean follwed by a make all. Don't worry about minor warning messages.

    A few more things to do:


    Old Instructions for compiling cmfgen with PGF95 and Mojave

    1. You will seriously need to buy the PGF95 compiler.
      • Hints in getting the damn license server to work:
        • You **may** be able to just get by doing a "lmreread"
        • In getting the permanet license, first do a "lmutil lmhostid" to see which MAC address the damn thing is picking up.
        • Starting up the license daemon:
          • sudo bash
          • cd /opt/bin/osx86-64/2018/bin
          • sudo cp com.pgroup.flexlm.plist /Library/LaunchDaemons
          • sudo chown root:wheel /Library/LaunchDaemons/com.pgroup.flexlm.plist
          • sudo chmod 0644 /Library/LaunchDaemons/com.pgroup.flexlm.plist
          • sudo launchctl load /Library/LaunchDaemons/com.pgroup.flexlm.plist.
          • When that fails, just do a /opt/pgi/osx86-64/18.3/bin/lmgrd
          • Recently I've been trying this and getting a message about not being able to open a port. Turns out that here was some conflict with the idl83 lmgrd. Do a ps -ax | grep lmgrd. Now...if you just kill it, it will restart. So, I did something more draconian and did a mv of the executible in the IDL directory to lmgrdold. I then rebooted. At that point the 2018 PGI version came to life, and it read my license file fine and I could compile again. Lord knows what's going to happen when I go to run IDL though...
        • Strongly recommend downloading latest xcode and trying to open it (so that you install the other stuff) before doing much else.
        • For the pgfortran compiler to work, you need to do a sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/crt1.o /usr/lib/crt1.o
        • For Yosemite you will also need a
          • sudo ln -s /opt/X11 /usr/X11R6
          • sudo ln -s /opt/X11 /usr/X11
        • For El Capitan/Sierra, one needs to find an older version of stdint.h and put it in /usr/include. Here is a copy This is needed for compiling pgplot.
      • In the .tcshrc put
        • setenv PGI /opt/pgi
        • setenv LM_LICENSE_FILE $PGI/license.dat
        • source /Volumes/strax/cmfgen/cur_cmf/com/aliases_for_cmfgen.sh
        • set path = ($PGI/osx8-64/15.3/bin/ $path)
        • setenv PGPLOT_DEV /xserve
        • setenv PGPLOT_DIR /Volumes/strax/pgplotorig/pgplot/pgplot (pretty sure this line does NOTHING)
        • setenv PGPLOT_FONT /Volumes/strax/pgplotorig/pgplot/pgplot/grfont.dat
        • setenv NCPUS 4
        • limit stacksize unlimited
    2. One needs the "special" Mac version of pgplot. Here it is. cd to pgplot/pgplot (not pgplotsrc!), "fix" the directory names at the top in Makefile, and then do a "make clean" and a "make all". It will bomb with an error message when it tries to create the cpgdemo stuff (Undefined symbols in MAIN) but you will find to your surprise that libpgplot.a has been created! Joy!
    3. Download the CMFGEN source files from the above link. Create a subdirectory cur_cmf_date and stick the stuff there. Create a symbolic link ln -s cur_cmf_date cur_cmf.
    4. Download the latest and great atomic data as well from the above link.
    5. Edit cmfgen/cur_cmf/Makefile_definitions so it looks something like this.
    6. If you update the version of the compiler, make sure you change the library location in the Makefile_definitions.
    7. NO LONGER NEEDED: Modify the Makefile definitions in "subs" and "plane" to invoke FZ rather than whatever flag it users. This gets around a bug with 14.10 that affects subs/fg_j_cmf_v9.f and plane/fg_j_cmf_v12.f.
    8. edit cur_cmf/com/aliases_for_cmfgen.sh to contain the right paths
    9. make clean
    10. make all
    11. So, you think you're all set, don't you? Well, you're not. You're going to have so start the server: /Volumes/strax/PGPLOTOrig/pgplot11.0/pgplot/pgxwin_server &
    12. While how to use CMFGEN is way beyond the scope of this little note, Kathryn's CMFGENGuide is invaluable.

     

    Michael's photometry routines (Thanks to NickM)

    This section is now outdated.
     

    Miscellanous


     

    FIRE

    Rob Simcoe (MIT) provides some excellent reduction software for his amazing Magellan instrument FIRE. I did find some of the installation and usage instructions a bit confusing. The following instructions were constructed with some help from Jane Rigby.


     

    Running Larry's astrometry code

    The Buie/Wasserman IDL package produces excellent results on LMI images, but the naming conventions are idiocentric.
     

    GMOS Software

    Designing a slitlet mask