看到这个问题,发现国外还真有人做过对比,主要在于语言特点方面,并没有详细的定量对比,贴过来大家一起乐呵乐呵。
其实大体上就是之前几位答主所说的那样,主要区别在于:
1.资料的多少。python资料较多
2.现成的分析函数多少。IDL的遥感图像分析功能更丰富
3.开源还是闭源。
4.计算速度。
5.与其他语言的交互。
Why would I switch from IDL to Python (or not)?
by Greenfield and Jedrzejewski
We do not claim that all, or even most, current IDL users should switch to using Python now. IDL suits many people’s needs very well and we recognize that there must be a strong motivation for starting to use Python over IDL. This appendix will present the pros and cons of each so that users can make a better informed decision about whether they should consider using Python. At the end we give a few cases where we feel users should give serious consideration to using Python over IDL.
Pros and Cons are addressed below in a comparative sense. Attributes that both share, e.g., that they are interpreted and relatively slow for very simple operations, are not listed.
Pros of IDL
Mature many numerical and astronomical libraries available
Wide astronomical user base
Numerical aspect well integrated with language itself
Many local users with deep experience
Faster for small arrays
Easier installation
Good, unified documentation
Standard GUI run/debug tool (IDLDE)
Single widget system (no angst(焦虑) about which to choose or learn)
SAVE/RESTORE capability
Use of keyword arguments as flags more convenient
Cons of IDL
Narrow applicability(适用性), not well suited to general programming
Slower for large arrays
Array functionality less powerful
Table support poor
Limited ability to extend using C or Fortran, such extensions hard to distribute and support
Expensive, sometimes problem collaborating with others that don’t have or can’t afford licenses.
Closed source (only RSI can fix bugs)
Very awkward to integrate with IRAF tasks
Memory management more awkward
Single widget system (useless if working within another framework)
Plotting:Awkward support for symbols and math text
Many font systems, portability(可移植性) issues (v5.1 alleviates(减轻) somewhat)
not as flexible or as extensible(可延长的)
plot windows not intrinsically(本质地) interactive (e.g., pan & zoom)
Pros of Python
Very general and powerful programming language, yet easy to learn. Strong, but optional, Object Oriented programming support
Very large user and developer community, very extensive and broad library base
Very extensible(可延长的) with C, C++, or Fortran, portable distribution mechanisms available
Free; non-restrictive license; Open Source
Becoming the standard scripting language for astronomy
Easy to use with IRAF tasks
Basis of STScI application efforts
More general array capabilities
Faster for large arrays, better support for memory mapping
Many books and on-line documentation resources available (for the language and its libraries)
Better support for table structures
Plottingframework (matplotlib) more extensible and general
Better font support and portability(可移植性) (only one way to do it too)
Usable within many windowing(开窗口) frameworks (GTK, Tk, WX, Qt…)
Standard plotting functionality independent of framework used
plots are embeddable(可嵌入) within other GUIs
more powerful image handling (multiple simultaneous LUTS, optional resampling(重采样)/rescaling(重新调节), alpha blending, etc)
Support for many widget systems
Strong local influence over capabilities being developed for Python
Cons of Python
More items to install separately
Not as well accepted in astronomical community (but support clearly growing)
Scientific libraries not as mature:Documentation not as complete, not as unified
Not as deep in astronomical libraries and utilities
Not all IDL numerical library functions have corresponding functionality in Python
Some numeric constructs not quite as consistent with language (or slightly less convenient than IDL)
Array indexing convention “backwards”
Small array performance slower
No standard GUI run/debug tool
Support for many widget systems (angst(焦虑) regarding which to choose)
Current lack of function equivalent to SAVE/RESTORE in IDL
matplotlib does not yet have equivalents for all IDL 2-D plotting capability (e.g., surface plots)
Use of keyword arguments used as flags less convenient
Plotting:comparatively immature(不成熟的), still much development going on
missing some plot type (e.g., surface)
3-d capability requires VTK (though matplotlib has some basic 3-d capability)
Specific cases where using Python provides strong advantages over IDL
Your processing needs depend on running a few hard-to-replicate IRAF tasks, but you don’t want to do most of your data manipulation in IRAF, but would rather write your own IDL-style programs to do so (and soon other systems will be accessible from Python, e.g., MIDAS, ALMA, slang, etc)
You have algorithms that cannot be efficiently coded in IDL. They likely won’t be efficiently coded in Python either, but you will find interfacing t(界面连接)he needed C or Fortran code easier, more flexible, more portable, and distributable. (可分配的)(Question: how many distributed IDL libraries developed by 3rd parties include C or Fortran code?) Or you need to wrap existing C libraries (Python has many tools to make this easier to do).
You do work on algorithms that may migrate into STSDAS packages. Using Python means that your work will be more easily adapted as a distributed and supported tool.
You wish to integrate data processing with other significant non-numerical processing such as databases, web page generation, web services, text processing, process control, etc.
You want to learn object-oriented programming and use it with your data analysis. (But you don’t need to learn object-oriented programming to do data analysis in Python.)
You want to be able to use the same language you use for data analysis for most of your other scripting and programming tasks.
Your boss makes you.
You want to be a cool, with-it person.
You are honked off at ITT Space Systems/RSI.
Obviously using a new language and libraries entails(限定继承) time spent learning. Despite what people say, it’s never that easy, especially if one has a lot of experience and code invested in an existing language. If you don’t have any strong motivations to switch, you should probably wait.
Reproduced with permission. Copyright 2007, Association of Universities for Research in Astronomy, Inc (AURA).