Coder Social home page Coder Social logo

Comments (3)

kkappler avatar kkappler commented on June 26, 2024

Hint on error 2:
On a file that does read in fine, when we hit the function _read_element in metadata_helpers.py, the value of element dict is:
element_dict
Out[3]:
{'orientation': OrderedDict([('angle_to_geographic_north', '0.000'),
('value', 'orthogonal')])}

But in the failing case, we have:
element_dict
Out[6]: {'orientation': 'sitelayout'}, and since the value of orienation is not a dict, we get the error, since the string has no items() method.

So, starting from emtfxml.py, when element == site (around line 306),
the attr is ______ and this goes into attr.read_dict()

read_dict loops over site keys, and when it gets to orientation, for the workng case in site.py,
lines ~95-110 we have this output

element
Out[3]: 'orientation'
attr
Out[4]:
{
"orientation": {
"angle_to_geographic_north": 0.0,
"layout": "orthogonal"
}
}

But in the broken case I also see (and cut and paste):

element
Out[6]: 'orientation'
attr
Out[7]:
{
"orientation": {
"angle_to_geographic_north": 0.0,
"layout": "orthogonal"
}
}

from mt_metadata.

kkappler avatar kkappler commented on June 26, 2024

In orientation.py, in the read_dict method in the working case, we have:

input_dict
Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.0 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 8.12.0
Out[1]:
OrderedDict([('project', 'USMTArray'),
('survey', 'CONUS SoCal'),
('year_collected', '2019'),
('country', 'USA'),
('id', 'CAR04'),
('name', 'The Meadows Slough, CA, USA'),
('location',
OrderedDict([('latitude', '38.245768'),
('longitude', '-121.489255'),
('elevation', '0.000'),
('declination',
OrderedDict([('epoch', '1995.0'),
('value', '13.200')])),
('datum', 'WGS84')])),
('orientation',
OrderedDict([('angle_to_geographic_north', '0.000'),
('value', 'orthogonal')])),
('acquired_by', 'National Geoelectromagnetic Facility'),
('start', '2019-05-03T22:29:40'),
('end', '2019-05-09T00:25:42'),
('run_list', 'CAR04a'),
('data_quality_notes',
OrderedDict([('rating', '1'),
('good_from_period', '20.000'),
('good_to_period', '400.000'),
('comments',
OrderedDict([('author',
'Adam Schultz and Esteban Bowles-Martinez'),
('value',
'Very poor data quality will require careful removal of large frequency bands before inverting.')]))])),
('data_quality_warnings',
OrderedDict([('flag', '1'),
('comments',
OrderedDict([('author',
'Adam Schultz and Esteban Bowles-Martinez')]))]))])

but in the broken case we have:

input_dict
Out[2]:
OrderedDict([('project', 'USMTArray'),
('survey', 'CONUS SoCal'),
('year_collected', '2019'),
('country', 'USA'),
('id', 'CAS03'),
('name', 'Pleasanton Ridge, CA, USA'),
('location',
OrderedDict([('latitude', '37.658830'),
('longitude', '-121.959752'),
('elevation', '484.050'),
('declination',
OrderedDict([('epoch', '1995.0'),
('value', '15.000')])),
('datum', 'WGS84')])),
('orientation', 'sitelayout'),
('acquired_by', 'National Geoelectromagnetic Facility'),
('start', '2019-10-24T22:07:08'),
('end', '2019-11-08T00:49:32'),
('run_list', 'CAS03a CAS03b'),
('data_quality_notes',
OrderedDict([('rating', '1'),
('good_from_period', '30.000'),
('good_to_period', '100.000'),
('comments',
OrderedDict([('author',
'Adam Schultz and Esteban Bowles-Martinez'),
('value',
'Signal overwhelmed by cultural noise near electric train in San Francisco Bay Area. Very poor data quality that will require careful removal of large frequency bands before inverting.')]))])),
('data_quality_warnings',
OrderedDict([('flag', '1'),
('comments',
OrderedDict([('author',
'Adam Schultz and Esteban Bowles-Martinez')]))]))])

from mt_metadata.

kujaku11 avatar kujaku11 commented on June 26, 2024

Both now pass with commit cd25167

from mt_metadata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.