-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converting .csv file to SEG2 format .dat files) #26
Comments
Hi @jaisinghverma, |
Respected Sir,
I am receiving the following error after executing the code which says, "
OverflowError: cannot convert float infinity to integer".
I tried different options but received the same error again and again.
Here is the complete error message:
C:\Users\Dell\miniconda3\lib\site-packages\swprocess\sensor1c.py:182:
RuntimeWarning: divide by zero encountered in log10
x = round(x, -np.sign(scaleco) * int(np.log10(abs(scaleco))))
…---------------------------------------------------------------------------OverflowError
Traceback (most recent call last)
Input In [65], in <cell line: 17>() 16 wavefieldtransforms = []
17 for fnames in fnames_set: ---> 18
wavefieldtransforms.append(swprocess.Masw.run(fnames=fnames,
settings=settings)) 19 end = time.perf_counter() 20
print(f"Elapsed Time (s): {round(end-start,2)}")
File ~\miniconda3\lib\site-packages\swprocess\masw.py:87, in
Masw.run(fnames, settings, map_x, map_y) 83 workflow =
Workflow(fnames=fnames, settings=settings, 84
map_x=map_x, map_y=map_y) 86 # Run and return.---> 87 return
workflow.run()
File ~\miniconda3\lib\site-packages\swprocess\maswworkflows.py:136, in
TimeDomainWorkflow.run(self) 135 def run(self):--> 136
self.array = Array1D.from_files(self.fnames, map_x=self.map_x, 137
map_y=self.map_y) 138
self.check() 139 self.trim_offsets()
File ~\miniconda3\lib\site-packages\swprocess\array1d.py:657, in
Array1D.from_files(cls, fnames, map_x, map_y) 655 sensors = []
656 for trace in stream.traces:--> 657 sensor =
Sensor1C.from_trace(trace, map_x=map_x, map_y=map_y) 658
sensors.append(sensor) 660 # Define source
File ~\miniconda3\lib\site-packages\swprocess\sensor1c.py:120, in
Sensor1C.from_trace(cls, trace, read_header, map_x, map_y, nstacks,
delay, x, y, z) 118 return cls._from_trace_seg2(trace,
map_x=map_x, map_y=map_y) 119 elif _format == "SU":--> 120
return cls._from_trace_su(trace, map_x=map_x, map_y=map_y) 121 elif
_format == "SEGY": 122 return cls._from_trace_segy(trace,
map_x=map_x, map_y=map_y)
File ~\miniconda3\lib\site-packages\swprocess\sensor1c.py:182, in
Sensor1C._from_trace_su(cls, trace, map_x, map_y) 180 int_x =
int(header["group_coordinate_x"]) 181 x = int_x / abs(scaleco) if
scaleco < 0 else int_x * scaleco--> 182 x = round(x, -np.sign(scaleco)
* int(np.log10(abs(scaleco)))) 184 int_y =
int(header["group_coordinate_y"]) 185 y = int_y / abs(scaleco) if
scaleco < 0 else int_x * scaleco
OverflowError: cannot convert float infinity to integer
On Thu, Aug 15, 2024 at 7:50 PM Joseph Vantassel ***@***.***> wrote:
Hi @jaisinghverma <https://github.com/jaisinghverma>,
I do not know of an open-source SEG2 writer, but *swprocess* can read a
variety of formats (SEG2, SEGY, SU). What I would recommend is to use
*obspy* to write your data to SU format. Some information on that is
provided here
<https://docs.obspy.org/packages/autogen/obspy.core.stream.Stream.write.html>
.
—
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZY6RAMUR5KMP4Y4EC45CX3ZRS2JBAVCNFSM6AAAAABMMFOEFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGM2TMNZSGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Thanks & Regards,
|
Hi @jaisinghverma, This issue is caused by a bad value in your file's header. What version of |
Respected Sir,
I was using the older version earlier.
Now, I am using the latest version. The earlier issue regarding value error
has been resolved. However, I am getting another error which reads
"*ValueError:
Sensors must have unique x positions*."
The complete error is as follows:
C:\Users\Dell\miniconda3\lib\site-packages\swprocess\sensor1c.py:199:
UserWarning: Resetting nstacks from zero to one.
warnings.warn(msg)
C:\Users\Dell\miniconda3\lib\site-packages\swprocess\sensor1c.py:205:
UserWarning: Resetting scale to be applied to all coordinates from zero to
one.
warnings.warn(msg)
C:\Users\Dell\miniconda3\lib\site-packages\swprocess\array1d.py:676:
UserWarning: Coordinate units is unset, assuming length in meters and not
degrees minutes seconds.
warnings.warn(msg)
C:\Users\Dell\miniconda3\lib\site-packages\swprocess\array1d.py:684:
UserWarning: Resetting scale to be applied to all coordinates from zero to
one.
warnings.warn(msg)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [8], in <cell line: 17>()
16 wavefieldtransforms = []
17 for fnames in fnames_set:
---> 18 wavefieldtransforms.append(swprocess.Masw.run(fnames=fnames,
settings=settings))
19 end = time.perf_counter()
20 print(f"Elapsed Time (s): {round(end-start,2)}")
File ~\miniconda3\lib\site-packages\swprocess\masw.py:87, in
Masw.run(fnames, settings, map_x, map_y)
83 workflow = Workflow(fnames=fnames, settings=settings,
84 map_x=map_x, map_y=map_y)
86 # Run and return.
---> 87 return workflow.run()
File ~\miniconda3\lib\site-packages\swprocess\maswworkflows.py:136, in
TimeDomainWorkflow.run(self)
135 def run(self):
--> 136 self.array = Array1D.from_files(self.fnames, map_x=self.map_x,
137 map_y=self.map_y)
138 self.check()
139 self.trim_offsets()
File ~\miniconda3\lib\site-packages\swprocess\array1d.py:720, in
Array1D.from_files(cls, fnames, map_x, map_y, obspy_read_kwargs)
717 return Source(x=map_x(x), y=map_y(y), z=0)
719 source = parse_source(trace.stats)
--> 720 obj = cls(sensors, source)
722 # Stack additional traces, if necessary
723 if len(fnames) > 0:
File ~\miniconda3\lib\site-packages\swprocess\array1d.py:84, in
Array1D.__init__(self, sensors, source)
68 """Initialize from an iterable of `Sensor1C`s and a `Source`.
69
70 Parameters
(...)
81
82 """
83 logger.info("Initializing Array1D")
---> 84 self.sensors, self.source = self._check_array(sensors, source)
File ~\miniconda3\lib\site-packages\swprocess\array1d.py:58, in
Array1D._check_array(sensors, source)
56 raise ValueError("All sensors must be similar.")
57 if sensor.x in positions:
---> 58 raise ValueError("Sensors must have unique x positions.")
59 positions.append(sensor.x)
61 # Sort sensors in terms of x from small to large
ValueError: Sensors must have unique x positions.
…On Thu, Sep 19, 2024 at 3:17 AM Joseph Vantassel ***@***.***> wrote:
Hi @jaisinghverma <https://github.com/jaisinghverma>,
This issue is caused by a bad value in your file's header. What version of
swprocess are you running? I believe I implemented a work around to this
problem in v0.3.0, following issue #16
<#16>.
—
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZY6RAIQ5D3W7YKNBY5PCHDZXHYHJAVCNFSM6AAAAABMMFOEFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJZGQ3DEMJWGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Thanks & Regards,
|
Hi @jaisinghverma, The error is because your sensors (e.g., geophones) "must have unique x positions". It is most-likely that the header of your file is not setup correctly so the code cannot understand which sensors go at which position. You may be able to fix this by editing the text-based header and/or properly configuring your data acquisition system. |
I think that another option would be to run the files through Geopsy and assign coordinates there. Although I have only done this for passive processing, not MASW, so I'm not sure how to get the files out again. |
Maybe this could be an addition. A utility to import a settings file containing coordinates. |
|
Respected Sir,
Could you please elaborate?
Currently I am following the given steps to get the data in KGS (.dat file)
format:
1. Collecting the vel-time history (.txt format without any headers) from
MASW simulations in ABAQUS.
2. Importing the .txt data file in SurfSeis software and converting it into
KGS (.dat) format
3. Using the KGS (.dat) file obtained above in the swprocess package.
…On Wed, Sep 25, 2024 at 1:29 AM Joseph Vantassel ***@***.***> wrote:
Hi @jaisinghverma <https://github.com/jaisinghverma>,
The error is because your sensors (e.g., geophones) "must have unique x
positions". It is most-likely that the header of your file is not setup
correctly so the code cannot understand which sensors go at which position.
You may be able to fix this by editing the text-based header and/or
properly configuring your data acquisition system.
—
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZY6RANOSECF36FA5OBSQJ3ZYHABDAVCNFSM6AAAAABMMFOEFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZSGI2TIOJZGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Thanks & Regards,
|
Hi @jaisinghverma, In SurfSeis there should be an option to assign coordinates (or positions) to your sensors. It would appear from the error above that all of your sensors are shown as being at the same location in the current .dat file. You will need to correct this. An alternative to your current approach that may be easier for you is to use the components swprocess provides to create an seismic unix (SU) based data file. You do this by creating Joe |
Greetings of the day!
How can I convert my .csv file to SEG2 format .dat files) before using the file for processing in swprocess?
Thank you.
The text was updated successfully, but these errors were encountered: