MTgeophysics / mtpy

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

Issues into build Occam2d code input #130

Open kashkoulimohammad opened 3 years ago

kashkoulimohammad commented 3 years ago

Dear Dr. Kirkby,

For creating input files for the Occam2d code there is a problem with the TM mode data error(error for each mode is equal and 10 percent) where errors are higher than data values.

  1     1     1      0.6868   0.0434
  1     1     2     41.8356   2.7128
  1     1     5      0.5807   2.7128
  1     1     6     46.1604   3.0655
  1     2     1      0.7210   0.0434
  1     2     2     45.7241   1.4250
  1     2     5      0.6522   1.4250
  1     2     6     48.3196   1.4250
  1     3     1      0.7946   0.0434
  1     3     2     44.1462   1.4250
  1     3     5      0.7193   1.4250
  1     3     6     48.2373   1.4250

Furthermore, number 6 for creating TM mode data does not work.

Traceback (most recent call last):

  File "C:\mtpywin\mtpy\examples\scripts\occam2d_buildinputfiles1.py", line 47, in <module>
    ocd.write_data_file()

  File "C:\Users\mamali\anaconda3\envs\mtpy\lib\site-packages\mtpy\modeling\occam2d_rewrite.py", line 2776, in write_data_file
    self._get_data_list()

  File "C:\Users\mamali\anaconda3\envs\mtpy\lib\site-packages\mtpy\modeling\occam2d_rewrite.py", line 2673, in _get_data_list
    derrstr = '{0:.4f}'.format(derror)

UnboundLocalError: local variable 'derror' referenced before assignment
alkirkby commented 3 years ago

Hi @kashkoulimohammad, I think the import is incorrect and you should be importing occam2d not occam2d_rewrite. I have updated the example script and tested it, works for me. Could you please confirm if this fixes the problem?

@zhang01GA, @brenmous and @kujaku11, do you think we can deprecate occam2d_rewrite?

kashkoulimohammad commented 3 years ago

Hi @alkirkby,

The script works well.

Michelle-12v commented 3 years ago

hello i would like to know what the terms type , datum, error refer to on occam 2D data file and how to arrange the data on this file.