'reading from tem-file, separating into header - data-blocks and normalizing columns

Working on a project, where I need to read a TEM file, extract its content into two blocks (header + data), where the header is a dictionary.

Following I need to normalize the data e.g. [V/A]->[V/m^2] by the values of the dictionary. and save the normalized values into a DataFrame.

So far I haven't been able to find any snippet that helps me.

This is what I've been able to do so far:

fid_data='measurements.tem'
raw_columns=["f1","f2","f3","f4","f5","f6","f7","f8"]
raw=pd.read_csv(fid_data,names=raw_columns,sep='\\t',engine="python")
header=raw.iloc[:7,:]
data=raw.iloc[7:,:]
header.head()
sounding_properties={
'sounding_name':'foo',
'tx_loop':25.000,
'rx_loop':25.000,
'time-range':5,
'stacks':7,
'current':4.1
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source