write_ndarray_to_yanny¶
-
pydl.pydlutils.yanny.write_ndarray_to_yanny(filename, datatables, structnames=None, enums=None, hdr=None, comments=None)[source]¶ Converts a NumPy record array into a new FTCL/yanny file.
Returns a new yanny object corresponding to the file.
Parameters: filename :
strThe name of a parameter file.
datatables :
numpy.ndarray,numpy.recarrayorlistof these.A NumPy record array containing data that can be copied into a
yannyobject.structnames :
strorlistofstr, optionalThe name(s) to give the structure(s) in the yanny file. Defaults to ‘MYSTRUCT0’.
enums :
dict, optionalA dictionary containing enum information. See the documentation for the
dtype_to_struct()method of the yanny object.hdr :
dict, optionalA dictionary containing keyword/value pairs for the ‘header’ of the yanny file.
comments :
strorlistofstr, optionalA string containing comments that will be added to the start of the new file.
Returns: The
yannyobject resulting from writing the file.Raises: PydlutilsException
If
filenamealready exists, or if the metadata are incorrect.