python和idl_在Python中调用IDL脚本

本文探讨如何在Python代码中运行IDL脚本进行数据分析。IDL 8.5版本开始提供了内置的双向桥接功能,使得从Python调用IDL变得简单。示例代码展示了使用idlpy模块来执行IDL的findgen、sin、cos和plot函数,并保存图形到PNG文件。
摘要由CSDN通过智能技术生成

I would like to run an IDL script in a python code, since I need to analyse the results of IDL code later in the python script but I have no idea how it works.

I want to call this IDL script for example in a python code:

pro plotgaussian, center, sigma, X=x, Y=y

x = findgen(1000) / 999; numbers running 0 to 1 in steps of 0.001

x = x * 6 * sigma - 3 * sigma; widen x to range over 6 sigma

x = x + center; center the x range on the bell curve center

arg = ((x – center)/sigma)^2

y = exp(-arg)

plot, x, y

end

How could I do it?

解决方案

The newest version of IDL (8.5) supports this natively, they provide their own bidirectional bridge for calling Python from IDL, and IDL from Python. Their docs are here:

http://www.exelisvis.com/docs/pythontoidl.html

Some exampl

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值