write

write(path, obj1[, obj2, ...])
write(filehandler, obj1[, obj2, ...])

Writes output to a file specified by path or filehandler.

Parameters
  • path (str) – output file path

  • filehandler (Metview filehandler object) – Metview filehandler of the output file (has to be created with file())

  • obj (Metview data object (see below)) – data objects to be written into the output

Return type

None

The output file format depends on the object type that is being written:

Object

Output format

Fieldset

GRIB

Geopoints

Geopoints

Bufr

BUFR

NetCDF

NetCDF

Odb

ODB

other types

text

If you use write() sequentially, note that it will overwrite any previous output if called with a path, but will add to previous output if called with a filehandler.

Note that special characters such as newline and tab can be written to text files.

Note

See also write().

Notebooks using metview.write