Skip to content

Commit

Permalink
Optionally use env var for number of ray workers. Reduce debug logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboulware committed Apr 12, 2024
1 parent 6a6ab71 commit 409ec60
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions scos_actions/actions/acquire_sea_data_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
FFT_WINDOW = get_fft_window(FFT_WINDOW_TYPE, FFT_SIZE)
FFT_WINDOW_ECF = get_fft_window_correction(FFT_WINDOW, "energy")
IMPEDANCE_OHMS = 50.0
NUM_ACTORS = 3 # Number of ray actors to initialize
NUM_ACTORS = env.int("RAY_WORKERS", default=3) # Number of ray actors to initialize

# Create power detectors
TD_DETECTOR = create_statistical_detector("TdMeanMaxDetector", ["max", "mean"])
Expand Down Expand Up @@ -588,28 +588,23 @@ def __call__(self, sensor: Sensor, schedule_entry: dict, task_id: int):
# Now block until the data is ready
dp_refs_tuple = ray.get(data_products_refs[index])
psd_ref, pvt_ref, pfp_ref, apd_ref = dp_refs_tuple
logger.debug("Getting PSD data.")
psd_data = ray.get(psd_ref)
channel_data.extend(psd_data)

logger.debug("Getting PVT data.")
pvt_data = ray.get(pvt_ref)
# Power-vs-Time results, a tuple of arrays
logger.debug("Splitting PVT tuple")
data, summaries = pvt_data # Split the tuple
max_max_ch_pwrs.append(DATA_TYPE(summaries[0]))
med_mean_ch_pwrs.append(DATA_TYPE(summaries[1]))
mean_ch_pwrs.append(DATA_TYPE(summaries[2]))
median_ch_pwrs.append(DATA_TYPE(summaries[3]))
del summaries

logger.debug("Getting PFP data.")
pfp_data = ray.get(pfp_ref)
channel_data.extend(pfp_data)

# APD result: append instead of extend,
# since the result is a single 1D array
logger.debug("Getting APD data.")
apd_data = ray.get(apd_ref)
channel_data.append(apd_data)

Expand Down

0 comments on commit 409ec60

Please sign in to comment.