View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum ↗

iraf-v216 · Code · Issues (50) · Pull requests (81)

iraf.net Issue #21

Clarify status of the code taken from Numerical Recipes

closed closed olebole opened this issue on 2017-05-01 · 2 comments


olebole commented on 2017-05-01

IRAF contains a number of files that contain code from the book “Numerical Recipes” (NR). It seems that IRAF is allowed to “use” this code as long as the following lines are included:

# Based on Numerical Recipes by Press, Flannery, Teukolsky, and Vetterling.  
# Used by permission of the authors.  
# Copyright(c) 1986 Numerical Recipes Software.  

This looks however questionable here: First it says “use” and not “distribute” or “modify”, which makes these files unsuitable for an Open Source project. The FAQ of the NR book about licensing says:

  • […] Can you include Numerical Recipes routines as part of that source code, including a notice that they are only allowed to be used with your application?
    • Sorry, no. We never give permission for Numerical Recipes source code to be posted on any public server, or distributed with any freeware or shareware package […]
  • You want to translate some (or all) the Numerical Recipes routines to a different computer language, and then redistribute the resulting translations.
    • […] However, you can’t redistribute the translations in any manner, since they are “derivative works” and still subject to our copyright.

There are the following files that contain a copyright statement from Numerical Recipes:

The following common procedures from NR are used here, that can probably easily replaced from other sources:

The following routines are used only in the noao/rv package.

The only non-trivial one here is four1(); the two others just call four1().

Then we have LU decomposition functions, used in pkg/utilities/stxtools/xtwcs.x:

And Levenberg-Marquardt nonlinear chi square minimization, used quite commonly

Maybe this could be replaced by cminpack?

Funnily, several of these functions are defined several times over the code… However it seems that much NR code could be replaced by free code without too much effort, or removed without losing too much functionality.

There are also a number of files which dont have the required copyright statement:

Interestingly, many of them use copies of the same functions (mr_fit and such) as above, so by solving the problems above many of these files can be legalized as well. Until then, they should at least get the required copyright (was aleardy promised three years ago, but then forgotten).

The cfitsio versions included in IRAF also have copies from NR code; namely the files

Again, the required copyright statement is not there. This can however be solved by updating cfitsio – their authors were very cooperative here when they were asked to remove NR code.


olebole commented on 2017-05-02

I’t want to point out another aspect here: the NR License allows redistribution only for non-wrapping code (important phrase emphasized by me):

You want to distribute an executable (.exe) file that has some Numerical Recipes routines bound inside. The NR routines are not separable from the executable file, and they are not visible to the user of the executable as separately invokable entities. (In particular, your executable is not a wrapper for the NR routines to be used in a workbench or mix-and-match environment.)

  • For noncommercial use, we grant automatic permission for this kind of redistribution.
  • For commercial use, you must have an institutional subscription (see here) and are subject to its applicable terms. There is generally no additional fee associated with redistribution.

IRAF is, however, exactly that: a wrapper (also) for the NR routines to be used in a workbench, and they are visible to the user. So, at least this license does not apply here. It should be clarified what other license exactly is meant here.


olebole commented on 2017-11-01

For MR_SOLVE, see this comment.
There is also some other code that is copied from text books:


Fixed in #37


Last updated on 2017-11-01