The predecessor versions of IDL were developed in the 1970s at the Laboratory for Atmospheric and Space Physics (LASP) at the University of Colorado at Boulder. Hence part of the art of using IDL (or any other array programming language, for that matter) for numerically heavy computations is to make use of the inbuilt vector operations. The NaN is excluded from the visualisation generated by the plot command.Īs with most other array programming languages, IDL is very fast doing vector operations (sometimes as fast as a well-coded custom loop in FORTRAN or C) but quite slow if elements need processing individually. This example contains a divide by zero IDL will report an arithmetic overflow, and store a NaN value in the corresponding element of the y array (the first one), but the other array elements will be finite. Note that the operation in the second line applies in a vectorized manner to the whole 100-element array created in the first line, analogous to the way general-purpose array programming languages (such as APL or J) would do it. (The findgen function in the above example returns a one-dimensional array of floating point numbers, with values equal to a series of integers starting at 0.)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |