Comments (2)
Hi @seguj,
You have diagnosed the issue correctly, each Peak
object must be associated with a unique identifier. When you load from a .max
file that unique identifier is the start time of the associated time window. As you have processed your data twice, once with RTBF and once with FK and loaded the two associated .max
files into two PeakSuite
objects both contain the same identifiers and therefore cannot be merged into a single PeakSuite
object.
In regards to a solution, I would suggest simply renaming the identifier so that each Peak
in the PeakSuite
will be unique. A clear and easy way to do this would be to loop across all the Peak
objects in the PeakSuite
and append an "rtbf"
or "fk"
to the end of each of the current identifiers to ensure they are unique. Once you have done this, you can merge the two PeakSuites
together into a single PeakSuite
.
All the best,
Joe
from swprocess.
Dear, Joseph
Thanks for the fast reply!
As you recommended, I simply modified 'from_json' in 'PeaksSuite.'
I'm attaching that code for anyone facing the same issue.
def from_json(cls, fnames, label):
if isinstance(fnames, str):
fnames = [fnames]
try:
iter(fnames)
except TypeError:
fnames = [str(fnames)]
dicts = []
print(fnames)
for fname in fnames):
with open(fname, "r") as f:
_data = json.load(f)
_keys = [key for key in _data]
_keys_label = [f'{key}.{label}' for key in _data]
for _key, _key_label in zip(_keys, _keys_label):
_data[_key_label] = _data.pop(_key)
dicts.append(_data)
# dicts.append(json.load(f))
return cls.from_dict(dicts)
Best regards,
Youngjun
from swprocess.
Related Issues (20)
- TypeError: Unknown format for file data/wghs/6.dat for MASW module HOT 5
- empty csv for extract example HOT 1
- processing already stacked MASW data HOT 3
- Installing on Mac M1 HOT 2
- Set a condition to deal with STACK not being present in sg2 files HOT 6
- Allow for multiples of offsets HOT 1
- Error running the stats notebook HOT 3
- Stats Notebook Running Time HOT 2
- apply MASW to ndarray data instead of file HOT 2
- 2D Section inquiry HOT 2
- run masw.ipynb but it returns an error
- Name error - swprocess HOT 2
- Converting .csv file to SEG2 format .dat files) HOT 1
- Preparing DAS data HOT 1
- Error in running the code create_su.ipynb HOT 1
- Generating dispersion image using .xlsx file HOT 1
- Number of output dispersion points HOT 3
- Error in running the code vis_model_0.ipynb HOT 1
- Error in running the code vis_model_0.ipynb HOT 1
- Extraction of the picked dispersion curve data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swprocess.