MTgeophysics / mtpy

Python toolbox for standard Magnetotelluric (MT) data analysis
GNU General Public License v3.0
145 stars 66 forks source link

Bug during parsing .edi file #97

Closed qliang88 closed 4 years ago

qliang88 commented 4 years ago

Dear all, there are typos in line 233 and line 235 in file mtpy/core/edi.py. The hxr in the c_list should be rhx. The mistyped hxr will trigger line 794 self.rhx = self.hx which means channel rhx will never be used in computing impedences and tippers.

        if self.Data_sect.data_type == 'spectra':
            self._logger.info('Converting Spectra to Impedance and Tipper')
            self._logger.info('Check to make sure input channel list is correct if the data looks incorrect')
            if self.Data_sect.nchan == 5:
                c_list = ['hx', 'hy', 'hz', 'ex', 'ey']
            elif self.Data_sect.nchan == 4:
                c_list = ['hx', 'hy', 'ex', 'ey']
            elif self.Data_sect.nchan == 6:
                c_list = ['hx', 'hy', 'ex', 'ey', 'hxr', 'rhy']  # <-- here!
            elif self.Data_sect.nchan == 7:
                c_list = ['hx', 'hy', 'hz', 'ex', 'ey', 'hxr', 'rhy'] # <-- here!
            self._read_spectra(lines, comp_list=c_list)