<p>As an observational astronomer, most of your programming will be to perform data analysis, data exploration, and possibly image manipulation.  Previously much of this was done with IDL, and the analysis pipelines for several/many/all(?) telescopes still rely on IDL.  As <a href="https://astronomy.stackexchange.com/a/10518/6672">GreenMatt</a> points out though, IDL is on its way out.  Since you have to buy a license to use it, you can only share code with other IDL users, it's not open source, etc.</p>

<p>The community is in the process of switching to Python, which is absolutely what I would recommend first for a new entry into the field.  Python is free, open source, etc, etc.  Since you'll be using python for data analysis and numerics, it is <em>vital</em> that you learn the <a href="http://www.numpy.org" rel="noreferrer">NumPy</a> package as well.  With NumPy array operations in python are almost as fast as C or Fortran.  <a href="http://www.scipy.org" rel="noreferrer">SciPy</a> and <a href="http://matplotlib.org" rel="noreferrer">MatPlotLib</a> are also incredibly useful, you don't need to learn the entire library, but you should be familiar with the basics.</p>

<p>The astronomy community is collaborating on some python packages to make more analysis techniques common.  These are the <a href="http://www.astropy.org" rel="noreferrer">AstroPy</a> and <a href="http://www.astroml.org" rel="noreferrer">AstroML</a> packages.  Once you get a handle on things, both would be good to be familiar with.</p>

<p>C is great to know, but not vital for day-to-day observational astronomy.  We use it a lot in theoretical astronomy to write numerical simulations.  Mainly I see C codes used in observational either for one-off calculations from a large dataset, or used to write fast modules for Python :)  If that sounds up your alley, you should give it a shot too!</p>

CC BY-SA 3.0
2015-04-19T17:37:50.040Z
2015-04-19T17:37:50.040Z
2017-04-13T12:59:06.910Z
Geoff Ryan
<p>While I'm not doing so now, for a significant part of my career I worked as a programmer supporting scientists in in some fields that the general public would consider branches of astronomy.  In that time I worked with (chronologically ordered in the sequence in which I first worked with them):</p>

<ul>
<li><a href="https://en.wikipedia.org/wiki/Fortran" rel="nofollow noreferrer">Fortran</a> - still useful because of its speed and existing code base</li>
<li><a href="https://en.wikipedia.org/wiki/C_%28programming_language%29" rel="nofollow noreferrer">C</a> and <a href="https://en.wikipedia.org/wiki/C%2B%2B" rel="nofollow noreferrer">C++</a> - useful for commanding instrumentation, as well as being a good - albeit a sometimes difficult - general purpose language </li>
<li><a href="http://www.perl.org/" rel="nofollow noreferrer">Perl</a> - general purpose "glue" language</li>
<li><a href="https://www.python.org/" rel="nofollow noreferrer">Python</a> - good general purpose language which is easy to learn and understand.  See <a href="https://astronomy.stackexchange.com/questions/10513/what-are-the-most-popular-computer-programming-languages-in-observational-astron/10514#10514">mmh's answer</a></li>
<li><a href="https://www.oracle.com/java/index.html" rel="nofollow noreferrer">Java</a> - general purpose language</li>
<li><a href="http://exelisvis.com/ProductsServices/IDL.aspx?utm_source=bing&amp;utm_medium=cpc&amp;utm_campaign=idl" rel="nofollow noreferrer">IDL</a> - useful for imaging and array manipulation</li>
<li><a href="http://php.net/" rel="nofollow noreferrer">PHP</a> - for websites </li>
</ul>

<p>My recommendation for two or three to learn, would be: Python, Fortran, and C.  Python seems to be rising in popularity in the community and has lots of add on modules for scientific applications (once you've got a handle on Python, I recommend learning <a href="http://www.numpy.org/" rel="nofollow noreferrer">NumPy</a> and maybe <a href="http://www.scipy.org/" rel="nofollow noreferrer">SciPy</a>).  C is an always useful language to know, and I think Fortran will continue to have its uses for a while. Perl is waning in popularity in general.  IDL was once very popular, but its expensive licenses are limiting its adoption for new projects now that free alternatives exist. </p>

CC BY-SA 3.0
2015-04-19T14:50:33.490Z
2015-04-19T14:50:33.490Z
2017-04-13T12:59:07.017Z
GreenMatt
<p>If you're looking for a replacement for IDL mentioned by Geoff and GreenMatt,
try PDL, <a href="http://pdl.perl.org/" rel="nofollow noreferrer">Perl Data Language</a>.  Its development started in the astronomy community as a free alternative to IDL (<a href="https://github.com/PDLPorters/pdl/wiki/PDL-for-IDL-users" rel="nofollow noreferrer">migration guide</a>), so it can read/write <a href="http://pdl.perl.org/?docs=IO/IDL&amp;title=PDL::IO::IDL" rel="nofollow noreferrer">IDL files</a>, <a href="http://pdl.perl.org/PDLdocs/IO/FITS.html" rel="nofollow noreferrer">FITS files</a>, etc. and the first example in the <a href="http://pdl.perl.org/?page=FirstSteps" rel="nofollow noreferrer">PDL Book</a> is image processing on M51.</p>

<p>It also has migration guides if you're coming from <a href="http://pdl.perl.org/?docs=MATLAB&amp;title=PDL::MATLAB" rel="nofollow noreferrer">MATLAB</a> or <a href="http://pdl.perl.org/?docs=Scilab&amp;title=PDL::Scilab" rel="nofollow noreferrer">Scilab</a> and it is still being developed today.</p>

CC BY-SA 4.0
2020-05-04T19:20:50.680Z
2020-05-04T19:20:50.680Z
Boyd
<p>Python is gaining popularity and replacing MATLAB in many fields of science as the tool for fast prototyping and writing research code.</p>
<p>For example, have a look at:</p>
<ul>
<li><a href="https://www.astropy.org/" rel="nofollow noreferrer">https://www.astropy.org/</a></li>
<li><a href="http://www.astropython.org/" rel="nofollow noreferrer">http://www.astropython.org/</a></li>
<li><a href="https://python4astronomers.github.io/" rel="nofollow noreferrer">https://python4astronomers.github.io/</a></li>
<li><a href="https://www.astroml.org/" rel="nofollow noreferrer">https://www.astroml.org/</a></li>
<li><a href="https://asteca.github.io/" rel="nofollow noreferrer">https://asteca.github.io/</a></li>
</ul>
<p>(I'm not working in astronomy as a researcher but in some other field.)</p>

CC BY-SA 3.0
2015-04-24T13:53:46.960Z
Definitely Python: it's open source and free, available almost in every platform by default, has countless available packages, the community is strong and active (and growing), very gradual learning curve (ie: easy to learn), its usage is expanding _very_ quickly in the field, etc.
Gabriel
CC BY-SA 4.0
2015-04-19T09:08:30.853Z
2020-06-18T16:40:13.230Z
2020-06-18T16:40:13.230Z
mmh
<p>I would like to work in the field of observational astronomy (not so much theoretical astronomy).</p>

<p>I currently know two computer programming languages: C# and MATLAB.</p>

<p>I have read that computer programming is absolutely essential to every astronomer, and that it takes a very significant part of the time of the work of most astronomers.</p>

<p>Therefore I would like to learn a few more programming languages. Hence my question:</p>

<p>What are the most common programming languages in observational astronomy?</p>

CC BY-SA 3.0
2015-04-19T17:29:49.287Z
Also, many people are still using IRAF.
pela
<software>
What are the most popular computer programming languages in observational astronomy?
ChronoParadox
# What are the most popular computer programming languages in observational astronomy?

(Asked by: username_0 on 2015-04-19)

I would like to work in the field of observational astronomy (not so much theoretical astronomy).

I currently know two computer programming languages: C# and MATLAB.

I have read that computer programming is absolutely essential to every astronomer, and that it takes a very significant part of the time of the work of most astronomers.

Therefore I would like to learn a few more programming languages. Hence my question:

What are the most common programming languages in observational astronomy?

**Tags:** software
> **Comments:**
> **username_1**: Also, many people are still using IRAF.  

---

## 4 answers

### Answer by username_5 on 2015-04-19. Score: 12 | Accepted answer

Python is gaining popularity and replacing MATLAB in many fields of science as the tool for fast prototyping and writing research code.

For example, have a look at:

* <https://www.astropy.org/>
* <http://www.astropython.org/>
* <https://python4astronomers.github.io/>
* <https://www.astroml.org/>
* <https://asteca.github.io/>

(I'm not working in astronomy as a researcher but in some other field.)

> **Comments:**
> **username_6**: Definitely Python: it's open source and free, available almost in every platform by default, has countless available packages, the community is strong and active (and growing), very gradual learning curve (ie: easy to learn), its usage is expanding _very_ quickly in the field, etc.  

---

### Answer by username_2 on 2015-04-19. Score: 7

As an observational astronomer, most of your programming will be to perform data analysis, data exploration, and possibly image manipulation. Previously much of this was done with IDL, and the analysis pipelines for several/many/all(?) telescopes still rely on IDL. As [GreenMatt](https://astronomy.stackexchange.com/a/10518/6672) points out though, IDL is on its way out. Since you have to buy a license to use it, you can only share code with other IDL users, it's not open source, etc.

The community is in the process of switching to Python, which is absolutely what I would recommend first for a new entry into the field. Python is free, open source, etc, etc. Since you'll be using python for data analysis and numerics, it is *vital* that you learn the [NumPy](http://www.numpy.org) package as well. With NumPy array operations in python are almost as fast as C or Fortran. [SciPy](http://www.scipy.org) and [MatPlotLib](http://matplotlib.org) are also incredibly useful, you don't need to learn the entire library, but you should be familiar with the basics.

The astronomy community is collaborating on some python packages to make more analysis techniques common. These are the [AstroPy](http://www.astropy.org) and [AstroML](http://www.astroml.org) packages. Once you get a handle on things, both would be good to be familiar with.

C is great to know, but not vital for day-to-day observational astronomy. We use it a lot in theoretical astronomy to write numerical simulations. Mainly I see C codes used in observational either for one-off calculations from a large dataset, or used to write fast modules for Python :) If that sounds up your alley, you should give it a shot too!


---

### Answer by username_3 on 2015-04-19. Score: 4

While I'm not doing so now, for a significant part of my career I worked as a programmer supporting scientists in in some fields that the general public would consider branches of astronomy. In that time I worked with (chronologically ordered in the sequence in which I first worked with them):

* [Fortran](https://en.wikipedia.org/wiki/Fortran) - still useful because of its speed and existing code base
* [C](https://en.wikipedia.org/wiki/C_%28programming_language%29) and [C++](https://en.wikipedia.org/wiki/C%2B%2B) - useful for commanding instrumentation, as well as being a good - albeit a sometimes difficult - general purpose language
* [Perl](http://www.perl.org/) - general purpose "glue" language
* [Python](https://www.python.org/) - good general purpose language which is easy to learn and understand. See [mmh's answer](https://astronomy.stackexchange.com/questions/10513/what-are-the-most-popular-computer-programming-languages-in-observational-astron/10514#10514)
* [Java](https://www.oracle.com/java/index.html) - general purpose language
* [IDL](http://exelisvis.com/ProductsServices/IDL.aspx?utm_source=bing&utm_medium=cpc&utm_campaign=idl) - useful for imaging and array manipulation
* [PHP](http://php.net/) - for websites

My recommendation for two or three to learn, would be: Python, Fortran, and C. Python seems to be rising in popularity in the community and has lots of add on modules for scientific applications (once you've got a handle on Python, I recommend learning [NumPy](http://www.numpy.org/) and maybe [SciPy](http://www.scipy.org/)). C is an always useful language to know, and I think Fortran will continue to have its uses for a while. Perl is waning in popularity in general. IDL was once very popular, but its expensive licenses are limiting its adoption for new projects now that free alternatives exist.


---

### Answer by username_4 on 2020-05-04. Score: 2

If you're looking for a replacement for IDL mentioned by Geoff and GreenMatt,
try PDL, [Perl Data Language](http://pdl.perl.org/). Its development started in the astronomy community as a free alternative to IDL ([migration guide](https://github.com/PDLPorters/pdl/wiki/PDL-for-IDL-users)), so it can read/write [IDL files](http://pdl.perl.org/?docs=IO/IDL&title=PDL::IO::IDL), [FITS files](http://pdl.perl.org/PDLdocs/IO/FITS.html), etc. and the first example in the [PDL Book](http://pdl.perl.org/?page=FirstSteps) is image processing on M51.

It also has migration guides if you're coming from [MATLAB](http://pdl.perl.org/?docs=MATLAB&title=PDL::MATLAB) or [Scilab](http://pdl.perl.org/?docs=Scilab&title=PDL::Scilab) and it is still being developed today.


---

