MTgeophysics / mtpy

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

Warning :Data:unable to set relative locations form 'mt_obj' #162

Open wilsonweijun opened 2 years ago

wilsonweijun commented 2 years ago

In making data input file , the warning statement " WARNING:Data: Unable to set relative locations from 'mt_obj' - not yet implemented" always exist. Does it afffect the projection results?

Expected Behavior

The Warning statment is to be fixed.

Current Behavior

D:\mtpywin\mtpy\mtpy\utils\calculator.py:371: RuntimeWarning: invalid value encountered in double_scalars z_rel_err = error/z_amp WARNING:Data: Unable to set relative locations from 'mt_obj' - not yet implemented WARNING:Data: Unable to set relative locations from 'mt_obj' - not yet implemented WARNING:Data: Unable to set relative locations from 'mt_obj' - not yet implemented WARNING:Data: Unable to set relative locations from 'mt_obj' - not yet implemented WARNING:Data: Unable to set relative locations from 'mt_obj' - not yet implemented WARNING:Data: Unable to set relative locations from 'mt_obj' - not yet implemented

Possible Solution

I did not install GDAL software. The pypoj is used to process coordinate projection problems.

Steps to Reproduce (for bugs)

1. 2. 3. 4.


# Paste your code here
#
#
import os
from mtpy.modeling.modem import Data
from mtpy.core.edi import Edi
from mtpy.utils.calculator import get_period_list
import numpy as np

#Creat a data input file

workdir='D:/Manuscripts/Manuscript2020/ModemInv'

if not os.path.exists(workdir):
    os.mkdir(workdir)

edipath='D:/mtpywin/mtpy/HeiheEDIwithRot12deg'
edi_list=[os.path.join(edipath,ff) for ff in os.listdir(edipath) if(ff.endswith('.edi'))]

period_list=get_period_list(1.e-4,0.2,10)
do=Data(edi_list=edi_list,
        inv_mode='2',
        save_path=workdir,
        period_list=period_list,
        period_buffer=2,
        error_type_z=np.array([['floor_egbert','floor_egbert'], ['floor_egbert','floor_egbert']]), # add floor to apply it as an error floor

        error_value_z=np.array([[1,4.5], [4.5,1]]), # can supply a 2 x 2 array for each component or a single value
        model_epsg=4530)

do.write_data_file()

np.savetxt(os.path.join(workdir,'center_position.txt'),
           np.array([do.center_point['east'], do.center_point['north']]))

np.savetxt(os.path.join(workdir,'epsg.txt'),[do.model_epsg])

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
  * Operating system: windows 10
  * MtPy version: Ver. 1.0 downloaded in 2020
  * Python version: 3.7.10
<!---if it is data visualization related, also provide-->
  * Matplotlib version: 
  * Matplotlib backend (`print(matplotlib.get_backend())`):
<!---if it is graphical user interface (GUI) related-->
  * QT version:

**Installed Python Packages:**
use `pip freeze` or `conda list [-n ENVIRONMENT_NAME]` to list all the installed libraries.