SciCoder Recap

Words

Given an infinite number of astronomers with an infinite number of Macs, somebody will eventually get a PhD.

Last week, I attended the annual SciCoder workshop with fellow Astrobite author Adele Plunkett and about 30 other students and postdocs. SciCoder is an annual workshop in New York City for early-career astronomers with the tagline: How I Learned To Stop Hating Coding and Start Getting Things Done.

Our guide for the week was Demitri Muna. He told a story about when he began graduate school, and at that time he assumed his peers were just as obsessed with the inner workings of computers as he was. He was dismayed to learn that many graduate students were never formally taught proper computing techniques, and were essentially reinventing the wheel to perform basic tasks. Thus, SciCoder was born.

While SciCoder’s target audience is graduate students and postdocs, there were a couple of undergraduate attendees too. If you’re interested in diving deeper into astronomy research and want to get a head start, consider making SciCoder part of your summer next year.

Over the course of one week, we were inundated with tips and tricks for all manner of things related to computers and astronomy. We had several opportunities to practice our new skills with research-inspired problems. Here are some of the main lessons I took away.

Python

  • The Python programming language is your friend for almost any problem you can imagine. Your most valuable resource is your time, and Python is both easy to learn and intuitive to use. It is a very “high-level” language, which means you don’t have to worry about how arrays work or write a sorting algorithm, and instead you can get on with solving research problems. This is not the case with IDL, C, or many other programming languages. Switching to Python now will save you time in the long run.
  • Many tools exist to make Python even more useful for astronomy purposes: packages like NumPy, SciPy, Matplotlib, and Astropy, just to name a few. They are all well-documented, and you can find answers for many basic questions just with google. IPython is a more interactive way to use Python. For example, you can create IPython Notebooks that combine text, code, and figures into a single interactive website.
  • Astropy in particular is an excellent resource. We had a visit from Erik Tollerud, one of the Astropy project coordinators. He talked us through the coordinates, units, and FITS file handling features.

Macs

  • Most astronomers who don’t feel at home in unix or Linux use a Mac. This is because Macs are user-friendly, efficient, and reliable while having many Linux-like capabilities. The ratio of Mac to Linux at SciCoder was about 4:1. (No Windows allowed! All participants were required to bring a laptop with OS X or Linux installed along with a suite of software we used throughout the week.) I’m glad I took the leap into Mac-land two years ago.
  • We learned how to customize our computers for everyday tasks in astronomy. Many of these are Mac-specific, but some are OS agnostic. This included new ways to ssh into a remote machine, customize your terminal appearance, write README files with Markdown, synchronize a research notebook with Evernote, decipher and use regular expressions, and write and run programs with TextWrangler.

Miscellaneous

  • Do you back up your work? Of course you do! SciCoder had us take it one step further with GitHub. In a nutshell, GitHub is an online tool that uses the git version control system to synchronize your files between local copies and an online copy. It is commonly used for collaborations so that multiple contributors can access and work on a project simultaneously, and then merge their work at certain intervals, so it’s more sophisticated than services like Dropbox. Confused? Yeah, I was too. This article explains it more clearly. Once you start using GitHub, you really do get the hang of it.
  • Databases are a powerful way to organize and access large amounts of information. We all wrote a Python program to access data from a massive FITS file—real SDSS data for some 1,800,000 stars—and create a database with SQLite. (Before SciCoder, that sentence would have terrified me!) We also learned some basic commands with SQLite to retrieve subsets of information from a database on the fly.
  • The R Project is an excellent way to make publication-ready plots if you don’t already have a favorite tool. The default settings actually make pretty figures. R understands columns of data, and so it works nicely with databases and all manner of text files. One could even go so far to say that a quick histogram is R’s equivalent of “hello, world.
  • Rainbow color schemes are a terrible choice. Use a tool like ColorBrewer to make much better choices.

Curious to know more details about what we learned at SciCoder? Feel free to get in touch via twitter, or leave a comment below.

About Meredith Rawls

Meredith received her PhD in Astronomy from New Mexico State University in 2016. She was a regular astrobites author from 2013–2016 and assisted with the website and social media from 2015–2018.

1 Comment

Leave a Reply