2
このスクリプトでは、出力が正しいことが確認されています。しかし、それは私のためにCSVファイルを入力していません。しかし、ループの最後の反復のみを実装します。 IDLを初めて知ったので、このキーワードの概念を理解する必要があります。CSVファイルに完全に書き込むためのキーワードを設定する方法
私はキーワードが必要だと信じていますが、これを挿入しようとする試みはすべて失敗しました。 csvファイルが完全に入力されるようにスクリプトを修正することができます。
PRO Lat_Lon_Alt_Array
; This program is the extract the Latitute, Longigitude & Altitute
; with the Site name and file code.
; The purpose is to output the above dimensions from the station files
; into a csv file.
COMPILE_OPt IDL2
the_file_list = file_search('D:/Rwork/Project/25_Files/','*.nc')
FOR filein = 0, N_ElEMENTS (the_file_list)-1 DO BEGIN
station = NCDF_OPEN(the_file_list[filein])
NCDF_VARGET, station, 'station_name', St_Name
NCDF_VARGET, station, 'lat', latitude
NCDF_VARGET, station, 'lon', longitude
NCDF_VARGET, station, 'alt', height
latitude=REFORM(latitude,1)
longitude=REFORM(longitude,1)
height=REFORM(height,1)
Print,the_file_list[filein]
Print, 'name'
Print, St_Name
Print,'lat'
Print,latitude
Print,'lon'
print,longitude
Print,'alt'
Print,height
; Add each station data to the file
WRITE_CSV, 'LatLon.csv', the_file_list[filein],latitude,longitude,height
ENDFOR
RETURN
END
ありがとうございますshouston –