Module convert

Tools used in converting a pickled station database file to comma-separated value (.csv) file. These functions are used in most scripts bundled with this package.

stdb.convert.tocsv(stel=<class 'stdb.classes.StDbElement'>)

Subroutine to output an StDbElement to a csv formatted string

Parameters

stel (StDbElement) – Instance of StDbElement to convert to .csv

Returns

csvstr – String representation of the csv content

Return type

str

stdb.convert.fromcsv(line='', lkey=False)

Subroutine to convert a csv format string into an StDbElement

Parameters
  • line (str) – Line to read as csv

  • lkey (bool) – Parameter controlling the length of the key (with or without CHANNEL info)

Returns

  • key (str) – Key associated with each entry in database

  • entry (StDbElement) – Instance of StDbElement class