apps & software

HEAsoft install on a Mac

Updated Feb 1, 2021

Here are my instructions for how to get HEAsoft, the NASA High Energy Astrophysics Software, set up on a Mac with macOS Catalina (v10.15.7). I learned most of this from HEAsoft’s own documentation (and a lot of trial and error over the years). I work in bash, so adapt as needed if you use c-shell or zsh. Disclaimer: I’m not a HEAsoft developer or maintainer, so follow this advice at your own risk. Actual HEAsoft maintainers should be your first point of contact if something goes wrong.

Step 0

Make a full backup of your machine as-is.

Step 1

Install these things:

Anaconda
Xcode from the App Store
Command Line Tools for Xcode by typing xcode-select –install
homebrew (or another package manager like MacPorts or Fink)

prompted to run these by homebrew:

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch –unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch –unshallow

Step 2

Using the package manager, install the following (and their dependencies). Some of these are brew upgrade Thing instead of brew install Thing (it will complain and tell you).

brew install gcc@10
brew install x11vnc
brew install perl
brew install wget
brew install automake
brew install mawk
brew install flex
brew install wcslib
brew install lzip
brew install slang
brew install imagemagick
brew install gnuplot
brew install ncurses
brew install pgplot
brew install cfitsio

Step 3

Download the HEAsoft source tarball. The first bullet point, above Step 1 on that page, should have everything you need (and you probably don’t need the extra old XSPEC stuff). This download takes like 30 minutes! I then put it in the directory ~/opt/ and unzip the HEAsoft tarball in there (tar -xvzf). This is a different location than what I’ve previously done! It seems that the new macOS really hates letting the user install things as su.

As it’s downloading, navigate to your old HEADAS directory and rename it to, e.g., old-heasoft6.26. This way there won’t be weird crosstalk. You can also delete your previous old-heasoft and tarball if you still have it. If you’ve never ever installed HEAsoft on your computer, you can skip this part.

Step 4

Follow the instructions for remote CALDB: https://heasarc.gsfc.nasa.gov/docs/heasarc/caldb/caldb_remote_access.html. Remember to save the files in /usr/local/src and put the appropriate export lines in ~/.bashrc!

Step 5

Copy/paste into ~/.bashrc (using homebrew installations of the compilers and the anaconda distribution of python 3):

export CC=/usr/local/bin/gcc-10
export CXX=/usr/local/bin/g++-10
export FC=/usr/local/bin/gfortran-10
export PERL=/usr/local/bin/perl
export PYTHON=/Users/YourUserName/opt/anaconda3/bin/python
unset CFLAGS CXXFLAGS FFLAGS LDFLAGS

Step 6

In the ~/.bash_profile file, be sure that /usr/bin and /usr/local/bin are at the beginning of your PATH environment variable.

Step 7

Restart your computer. I don’t know how necessary this is, but it’s one of the few things that changed in the few days between the install not working and working.

Step 8

To configure, make, and install (your HEAsoft version number might be different when you reference this blog post):

cd ~/opt/heasoft-6.28/BUILD_DIR/
./configure
make > build.log 2>&1
make install > install.log 2>&1

Note that I’m no longer passing the X11 include and library directories to the configure script, as I’ve had to do in previous installs. You should be able to open build.log and install.log as those things are going (from a different terminal window) to see their progress. You can also use tail build.log and tail install.log to view the last 10 lines of the files (though this won’t update, so this is more for occasional checks).

The make line with build.log takes a particularly long amount of time (like 20ish minutes). Since it’ll use a lot of memory and you’ll hear the fans going as it’s makeing, I don’t recommend playing videogames on your computer in the downtime.

Step 9

Copy/paste into ~/.bashrc for general use (again, your HEAsoft version number and system architecture might be different. If you ls in the HEAsoft directory you’ll see what to put for the system architecture thing):

export HEADAS=/Users/YourUserName/opt/heasoft-6.28/x86_64-apple-darwin19.6.0
alias heainit=”. $HEADAS/headas-init.sh”

To start up XSPEC, in a bash terminal session type

heainit
xspec

and it should start up an XSPEC environment! Happy analysis!

Step 10

Once I get PyXSPEC working, I’ll put the steps here.

Hack Together Day at EWASS 2017

We are pleased to announce a hack day to accompany the special session on astronomy research software at EWASS 2017!!

Hack Together Day is a day to work intensively on projects, individually or in small groups, of interest to the astronomical community. A wide variety of projects will be undertaken, spanning everything from software development to community outreach to scientific research to trying out new analysis tools. We’ll also ask the contributors for SS16 (Developments and Practices in Astronomy Research Software) block 3 to be at the hack day, to help participants install, configure, and use the featured software packages. This information will be shared here once the talk schedule is confirmed.

Hack day or programming experience is not required; newcomers are extremely welcome! Project ideas and participants will be solicited before and during the meeting. Participants can lead or join a project, and should plan on focusing on only one thing.

Hack Together Day will take place on Thursday June 29th from 9:00 to 17:30, with the usual breaks for the plenary session, coffee and lunch.

Please register your attendance using this form so we can ensure enough resources for everyone. You do not need to be contributing an oral or poster presentation to the software session in order to participate in the hack day! For more information, see the EWASS 2017 Hack Together Day page on the AstroBetter wiki.

Get in touch if you have any comments/questions/concerns. We look forward to seeing you in Prague this June!

EWASS 2017: Developments & Practices in Astronomy Research Software!!

ewass_prague_2017_logo
EXCITING NEWS!! There will be a special session at the European Week of Astronomy and Space Science (EWASS) 2017 on developments and practices in astronomy research software and a hack day!! I’m co-organizing the hack day and a block on different astronomy software packages, where we will have a variety of speakers (invited and contributed) share open-source software packages of interest to a broad portion of the astronomical and space science community.

EWASS is the general meeting for the European Astronomical Society that will be held in Prague, Czech Republic on 26-30 June 2017, hosted this year in partnership with the Czech Astronomical Society. There will be many symposia and special sessions on a variety of research topics, and registration for the meeting will open in December.

UPDATE (25 Jan):

Abstract submission is open for all EWASS 2017 sessions, and here’s a blog post on the hack day with links for registration and more info. The talks will be on June 28 and Hack Together Day #hackEWASS will be on June 29.

New page: Coding resources

Remember kids, the only difference between screwing around and science is writing it down. --Adam Savage, Mythbusters
I’ve put together a long list of coding and computing resources. Since it’s so important, it doesn’t just get a blog post, it gets its own page! Check it out and let me know if your favourite is on there.

EDIT: I’ll (slowly) add my list to the AstroBetter wiki so future generations of students can have a more centralized repository of resources.

Apps I love

I spend an inordinate amount of time on my computer and smartphone. I’m the kind of person who sets an alarm on my phone so that I know when to go to bed, because otherwise I’d be adrift in the internet ’till the wee hours of the night. In my techy adventure time, I’ve discovered some apps that are so great I tell EVERYONE about them. When people 50 years ago were dreaming of what modern computers would be able to do, these apps are probably what they were dreaming of. “Streamlining my daily life” and “boosting my productivity” might not sound terribly exciting, but these apps help me do just that, and I love them for it.

Dropbox

Dropbox


I paid for this one, although a free version is available with less storage space. The program installs a folder on your computer so that any file you put into that folder gets backed up onto The Cloud (dun dun duuun) and automatically placed in the Dropbox folder of any linked devices. For example, I have Dropbox on my laptop, work desktop, and smartphone, so I can transfer files between the three. Lately I’ve been saving and running my code in Dropbox so that it effortlessly ports from desktop to laptop. Dropbox sub-folders are also an easy way to share photos after a trip or event. It’s brilliant.

Evernote

Evernote


I like Evernote so much and use it so much that I paid for it too (a free version is available with fewer features). I save and store EVERYTHING on this: articles I loved and want to save, recipes, lists of all flavours (I love making lists), drafts of conference abstracts, items on my shopping wishlist, links and pictures of well-designed homes, teaching rubrics, etc. Evernote makes it easy to collaborate with folks who also have the app, and you can organize and tag entries to your heart’s content. And there’s an app for your phone too!

Feedly

Feedly


Blogs are one of my favourite things about the internet, and I read tons of them. Feedly lets me sort and organize the RSS feeds from the blogs I read, so that the latest blog posts are all in one place. It lets me sort the blogs by category so that if I’m in a webcomic mood I can read through just those posts, or I can browse all the recent posts for all categories. I love how Feedly has a cleaner layout than Google Reader (R.I.P.); its visual format is beautiful.

F.lux

F.lux


I’m guilty of spending time staring at digital screens right before going to bed. This is a problem, because the bright lights are signaling for your brain not to produce melatonin, so you don’t feel sleepy and can stay up later than intended and/or take longer to fall asleep. F.lux is an app that changes the “colour temperature” of your screen (i.e., it makes a white screen look more orange than white-blue) to decrease your eyes’ sensitivity to the screen, since our eyes are less sensitive to red light than blue light. Coupled with turning the brightness of the screen as low as it can go, anecdotally I’ve found that overall I have an easier time falling asleep since I started using F.lux. It also has this neat feature where it can change the colour temperature gradually over the period of an hour, so it’s never an obvious transition, and if you tell it your latitude and longitude it will time this to coincide with local sunset. On my Android I use a similar app called SunFilter.

Pocket

Pocket


Often I see an article I want to read on Feedly or facebook, but it’s inconvenient for me to read the article right then. I use Pocket to save these articles and read them later (usually on my phone). Under the ‘share article’ menu on my phone there’s almost always an ‘Add to Pocket’ option, and on my laptop I have an ‘Add to Pocket’ browser toolbar button. The best part is that it downloads the articles so you can read them without a data or wifi connection! With Pocket I can get up-to-date and consume information in my own time and on my own terms, which lessens distractions throughout the day.

TripIt

TripIt


I love traveling, and now that I live in Europe I have an unprecedented opportunity to see parts of the world without breaking the bank. TripIt is great for planning and organizing trips. Once you have an account set up, you just forward all of your confirmation emails to TripIt and it automatically creates an itinerary for you! So easy. Be forewarned though, it’s only in English, so you have to forward English emails. Otherwise it gets confused and doesn’t know what to do and then you have to type in everything by hand which mostly negates the point of this service. Also, you should charge your phone before travelling, or the app won’t do you much good. That last point is rather obvious, but it needs to be said.

Did you notice how many times I used derivatives of the word “easy”? (Now you will. And that’s after some editing.) It’s because these apps make life a little easier. There are many other apps that I use and enjoy (like Skype and WhatsApp), but these ones have made a huge impact on my day-to-day life. Did I mention that they’re free, too?

Let me know if I missed your favourite app or software!