Previous topic

asciiread

Next topic

binread

This Page

asciiwrite

mipylib.dataset.midata.asciiwrite(fn, data, colnum=80, format=None, delimiter=None)

Write array data into a ASCII data file.

Parameters:
  • fn – (string) Path needed to locate ASCII file.
  • data – (array_like) A numeric array variable of any dimensionality.
  • colnum – (int) Column number of each line.
  • format – (string) Number format.
  • delimiter – (string) Delimiter string.

Examples

f = addfile('D:/Temp/GrADS/model.ctl')
data = f['PS'][0,:,:]
asciiwrite('C:/Temp/test/test_asciisave.txt', data, format='%-10.2f')