Skip to content

Commit

Permalink
get rid of temp stream by spawning a new process for preprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasLecocq committed Sep 18, 2024
1 parent e7e701d commit bdc9dc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions msnoise_sara/compute_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
except:
pass

import concurrent

from obspy.signal.filter import envelope
import bottleneck as bn

Expand Down Expand Up @@ -90,8 +92,9 @@ def main(loglevel="INFO"):
comps.append(comp[0])
comps.append(comp[1])
comps = np.unique(comps)
stream = preprocess(stations, comps, goal_day, params, responses, logger='msnoise.sara_envelope_child')
# for tr in stream:
with concurrent.futures.ProcessPoolExecutor(max_workers=1) as executor:
stream = executor.submit(preprocess, stations, comps, goal_day, params, responses, loglevel).result()
logger.info("Received preprocessed traces")# for tr in stream:
# tr.stats.location = "00"
uniqueids = np.unique([tr.id for tr in stream])
for uid in uniqueids:
Expand Down

0 comments on commit bdc9dc5

Please sign in to comment.