obspy.sac.sacio.SacIO.SetHvalueInFile

SacIO.SetHvalueInFile(thePath, theItem, theValue)[source]

Quick access to change a specific header item in a specified file.

Parameters:
  • f filename (SAC binary)
  • hn (str) header variable name
  • hv (str, float or int) header variable value (numeric or string value to be assigned to hn)
Returns:

None

>>> from obspy.sac import SacIO 
>>> t = SacIO() 
>>> t.GetHvalueFromFile('test.sac','kstnm').rstrip() 
'STA'
>>> t.SetHvalueInFile('test.sac','kstnm','blub') 
>>> t.GetHvalueFromFile('test.sac','kstnm').rstrip() 
'blub'