Giter Site home page Giter Site logo

r4lv / idlwrap Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 70 KB

interface to scipy/numpy for quick porting of Harris Geospatial's IDL (Interactive Data Language) code to python

Home Page: https://r4lv.github.io/idlwrap/

License: MIT License

Python 100.00%
python porting interactive-data-language idl

idlwrap's Introduction

idlwrap

idlwrap is a python package which provides many functions known from Harris Geospatial's IDL (Interactive Data Language), all implemented in scipy/numpy.

No IDL is required to run idlwrap, as it is pure python!

With numpy and scipy, there are powerful and open-source tools available for scientific computing in python. Currently, still lots of scientific projects โ€” especially in astrophysics โ€” rely on the proprietary and expensive IDL instead of moving foward to open and reproducible science. There are many reasons for chosing python over IDL, but transition is not that easy. At least it was until now!

This package aims to abstract away all differences in IDL and python and provide the interface and functions you know from IDL, but using scipy and numpy under the hood.

Installation

Install idlwrap with pip:

pip install idlwrap

Usage

One of the main differences between IDL and python is how arrays and indices are handled. Let's create an array:

IDL> a = INDGEN(3, 4)
IDL> a
       0       1       2
       3       4       5
       6       7       8
       9      10      11

That is easy in idlwrap:

>>> a = idlwrap.indgen(3,4)
>>> a
array([[ 0,  1,  2],
       [ 3,  4,  5],
       [ 6,  7,  8],
       [ 9, 10, 11]])

In IDL, array-indices are inclusive:

IDL> a[1:2, 1:2]
       4       5
       7       8

while they are exclusive in python:

>>> a[1:2, 1:2]
array([[4]])

idlwrap can help here too, by making IDL subsetting available as a function:

>>> idlwrap.subset_(a, "[1:2, 1:2]") 
array([[4, 5],
       [7, 8]])

idlwrap provides many more functions. Make sure you check the documentation, which is filled with many examples on how to use idlwrap, but also provides general information on how to port existing IDL code to python!

idlwrap's People

Contributors

r4lv avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.