Код: Выделить всё
import scipy.io as spio
on2file = 'ON2_2015_112m_220415.sav'
on2data = spio.readsav(on2file, python_dict=True, verbose=True)
Код: Выделить всё
IDL Save file is compressed
-> expanding to /var/folders/z4/r3844ql123jgkq1ztdr4jxrm0000gn/T/tmpVE_Iz6.sav
--------------------------------------------------
Date: Mon Feb 15 20:41:02 2016
User: zhangy1
Host: augur
--------------------------------------------------
Format: 9
Architecture: x86_64
Operating System: linux
IDL Version: 7.0
--------------------------------------------------
Successfully read 11 records of which:
- 7 are of type VARIABLE
- 1 are of type TIMESTAMP
- 1 are of type NOTICE
- 1 are of type VERSION
--------------------------------------------------
Available variables:
- saved_data []
- on2_grid_smooth []
- d_lat []
- on2_grid []
- doy []
- year []
- d_lon []
--------------------------------------------------
Я хотите записать переменные (year, doy, d_lon, d_lat, on2_grid, on2_grid_smooth) в файл CSV или ASCII, который должен выглядеть следующим образом:
Код: Выделить всё
longitude, latitude, on2_grid, on2_grid_smooth # header
0.0,0.0,0.0,0.0
0.0,0.0,0.0,0.0
0.0,0.0,0.0,0.0
0.0,0.0,0.0,0.0
.....
Подробнее здесь: https://stackoverflow.com/questions/425 ... -in-python