Skip to content
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

SO production tests #752

Merged
merged 6 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"feedbackPolarity" : 1,
"feedbackLimitkHz": 225,
"lmsGain": 7,
"att_uc": 12,
"att_uc": 0,
"att_dc": 0,
"amplitude_scale": 12
},
Expand All @@ -49,7 +49,7 @@
"feedbackPolarity" : 1,
"feedbackLimitkHz": 225,
"lmsGain": 7,
"att_uc": 12,
"att_uc": 0,
"att_dc": 0,
"amplitude_scale": 12
},
Expand All @@ -74,7 +74,7 @@
"feedbackPolarity" : 1,
"feedbackLimitkHz": 225,
"lmsGain": 7,
"att_uc": 12,
"att_uc": 0,
"att_dc": 0,
"amplitude_scale": 12
},
Expand All @@ -99,7 +99,7 @@
"feedbackPolarity" : 1,
"feedbackLimitkHz": 225,
"lmsGain": 7,
"att_uc": 12,
"att_uc": 0,
"att_dc": 0,
"amplitude_scale": 12
},
Expand Down
15 changes: 11 additions & 4 deletions cfg_files/rflab/rflab_smurf_startup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ shelfmanager=shm-smrf-sp01
set_crate_fans_to_full=true
# COMTEL max fan level is 100, ASIS is 15, ELMA is 15
## COMTEL in RF lab
max_fan_level=100
max_fan_level=25

# more often used
attach_at_end=true
configure_pysmurf=true
reboot=true
using_timing_master=false
start_atca_monitor=true
start_atca_monitor=false
disable_streaming=true
parallel_setup=false

Expand All @@ -26,19 +26,26 @@ save_state=false
# go go go
cpwd=$PWD

# This has run.sh and one copy of the pysmurf repo. run.sh is used in
# tmux before running ipy and instantiating SmurfControl. The .cfg
# file below is taken from here.
pysmurf=/home/cryo/docker/pysmurf/dev/v5.0.2

# This is turned into "shm-smurf-sp01" so we can hit it with clia.
crate_id=1

# This gets put into slot_cfgs in shawnhammer.
# Param 1 is slot number
# Param 2 is used for ?
# Param 3 is the cfg file to get from the pysmurf variable above.
unset slot_cfgs
read -r -d '' slot_cfgs << EOM
6 /home/cryo/docker/smurf/stable/slotN/v5.0.2 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
EOM
#3 /home/cryo/docker/smurf/dev_fw/slotN/v4.1.0 cfg_files/rflab/experiment_rflab_onlyBay0.cfg

#pysmurf_init_script=scratch/shawn/scripts/init_rflab.py

tmux_session_name=smurf

thermal_test_script=scratch/shawn/thermal_test.py
#thermal_test_script=scratch/shawn/thermal_test.py
run_thermal_test=false
4 changes: 2 additions & 2 deletions cfg_files/rflab/rflab_smurf_startup_stephen_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ save_state=false
# go go go
cpwd=$PWD

pysmurf=/home/cryo/docker/pysmurf/dev/v5.0.2
pysmurf=/home/cryo/docker/pysmurf/dev/v7.1.0_prodtest

crate_id=1

unset slot_cfgs
read -r -d '' slot_cfgs << EOM
6 /home/cryo/docker/smurf/stable/slotN/v5.0.2 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
3 /home/cryo/docker/smurf/stable/v7.1.0 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
EOM

#pysmurf_init_script=scratch/shawn/scripts/init_rflab.py
Expand Down
45 changes: 45 additions & 0 deletions cfg_files/rflab/rflab_smurf_startup_stephen_test2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
shelfmanager=shm-smrf-sp01

set_crate_fans_to_full=true
# COMTEL max fan level is 100, ASIS is 15, ELMA is 15
## COMTEL in RF lab
max_fan_level=100

# more often used
attach_at_end=true
configure_pysmurf=true
reboot=true
using_timing_master=false
start_atca_monitor=true
disable_streaming=true
parallel_setup=false

# Less often used
# requires tmux-logging plugin
enable_tmux_logging=false
screenshot_signal_analyzer=false
run_full_band_response=false
run_half_band_test=false
write_config=false
save_state=false

# go go go
cpwd=$PWD

pysmurf=/home/cryo/docker/pysmurf/dev/v7.1.0_prodtest

crate_id=1

unset slot_cfgs
read -r -d '' slot_cfgs << EOM
2 /home/cryo/docker/smurf/stable/v7.1.0 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
EOM

#pysmurf_init_script=scratch/shawn/scripts/init_rflab.py

tmux_session_name=smurf

#thermal_test_script=scratch/shawn/thermal_test.py
#run_thermal_test=false

script_to_run=scratch/stephen/full_band_response_AMCatten.py
10 changes: 5 additions & 5 deletions cfg_files/rflab/smurf_startup_low_power_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ max_fan_level=100
attach_at_end=true
# don't configure pysmurf for the low power test because we want to
# run setup for first time as a part of the test.
configure_pysmurf=false
configure_pysmurf=true
reboot=true
using_timing_master=false
start_atca_monitor=true
Expand All @@ -29,18 +29,18 @@ write_config=false
# go go go
cpwd=$PWD

pysmurf=/home/cryo/docker/pysmurf/v5.0.2
pysmurf=/home/cryo/docker/pysmurf/dev/v7.1.0_prodtest

crate_id=3
crate_id=1

unset slot_cfgs
read -r -d '' slot_cfgs << EOM
6 /home/cryo/docker/smurf/dev_fw/slotN/v5.0.2 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
2 /home/cryo/docker/smurf/stable/v7.1.0 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
EOM

#pysmurf_init_script=scratch/shawn/scripts/init_rflab.py

tmux_session_name=smurf

# this script will run at the end of the hammer.
script_to_run=scratch/shawn/test_new_carrier.py
script_to_run=scratch/shawn/test_new_carrier.py
46 changes: 46 additions & 0 deletions cfg_files/rflab/smurf_startup_low_power_test2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
shelfmanager=shm-smrf-sp01

set_crate_fans_to_full=true
# COMTEL max fan level is 100, ASIS is 15, ELMA is 15
## COMTEL in RF lab
#max_fan_level=50
## ELMA in RF lab
#max_fan_level=15
## ASIS in RF lab
max_fan_level=100

# more often used
attach_at_end=true
# don't configure pysmurf for the low power test because we want to
# run setup for first time as a part of the test.
configure_pysmurf=true
reboot=true
using_timing_master=false
start_atca_monitor=true
disable_streaming=true
parallel_setup=false

# less often used
enable_tmux_logging=true
screenshot_signal_analyzer=false
run_half_band_test=false
write_config=false

# go go go
cpwd=$PWD

pysmurf=/home/cryo/docker/pysmurf/dev/v7.1.0_prodtest

crate_id=1

unset slot_cfgs
read -r -d '' slot_cfgs << EOM
2 /home/cryo/docker/smurf/stable/v7.1.0 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
EOM

#pysmurf_init_script=scratch/shawn/scripts/init_rflab.py

tmux_session_name=smurf

# this script will run at the end of the hammer.
script_to_run=scratch/shawn/test_new_carrier.py
10 changes: 7 additions & 3 deletions cfg_files/rflab/smurf_startup_thermal_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ attach_at_end=true
# setup for first time as a part of the thermal test.
configure_pysmurf=false
reboot=true
enable_tmux_logging=true
using_timing_master=false
start_atca_monitor=true
disable_streaming=true
Expand All @@ -28,18 +29,21 @@ write_config=false
# go go go
cpwd=$PWD

pysmurf=/home/cryo/docker/pysmurf/dev/v5.0.2
# this is used in shawnhammer
pysmurf=/home/cryo/docker/pysmurf/dev/v7.1.0_prodtest

crate_id=1

unset slot_cfgs

# slot number
read -r -d '' slot_cfgs << EOM
6 /home/cryo/docker/smurf/dev_sw/slotN/v5.0.2 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
6 /home/cryo/docker/smurf/stable/v7.1.0 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
EOM

#pysmurf_init_script=scratch/shawn/scripts/init_rflab.py

tmux_session_name=smurf

thermal_test_script=scratch/shawn/thermal_test.py
run_thermal_test=true
run_thermal_test=true
49 changes: 49 additions & 0 deletions cfg_files/rflab/smurf_startup_thermal_test2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
shelfmanager=shm-smrf-sp01

set_crate_fans_to_full=true
# COMTEL max fan level is 100, ASIS is 15, ELMA is 15
## COMTEL in RF lab
#max_fan_level=50
## ELMA in RF lab
#max_fan_level=15
## ASIS in RF lab
max_fan_level=100

# more often used
attach_at_end=true
# don't configure pysmurf for thermal test because we want to run
# setup for first time as a part of the thermal test.
configure_pysmurf=false
reboot=true
enable_tmux_logging=true
using_timing_master=false
start_atca_monitor=true
disable_streaming=true
parallel_setup=false

# less often used
screenshot_signal_analyzer=false
run_half_band_test=false
write_config=false

# go go go
cpwd=$PWD

# this is used in shawnhammer
pysmurf=/home/cryo/docker/pysmurf/dev/v7.1.0_prodtest

crate_id=1

unset slot_cfgs

# slot number
read -r -d '' slot_cfgs << EOM
2 /home/cryo/docker/smurf/stable/v7.1.0 cfg_files/rflab/experiment_rflab_thermal_testing_201907.cfg
EOM

#pysmurf_init_script=scratch/shawn/scripts/init_rflab.py

tmux_session_name=smurf

thermal_test_script=scratch/shawn/thermal_test.py
run_thermal_test=true
5 changes: 4 additions & 1 deletion scratch/shawn/full_band_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import sys
import os
import matplotlib.pylab as plt

print("Inside full_band_response.py. Starting.")

plt.ion()

n_scan_per_band=5
Expand Down Expand Up @@ -69,7 +72,7 @@
bbox_inches='tight')
plt.show()

save_name = '{}_full_band_resp_all.npy'.format(timestamp)
save_name = os.path.join(S.output_dir,'{}_full_band_resp_all.npy'.format(timestamp))
print(f'Saving data to {os.path.join(S.output_dir, save_name)}')
np.save(save_name,resp_dict)

Expand Down
6 changes: 6 additions & 0 deletions scratch/shawn/scripts/shawnhammer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ if [ "$set_crate_fans_to_full" = true ] ; then
sleep 2
fi

echo "3"

# use tmux instead
# https://www.peterdebelak.com/blog/tmux-scripting/

Expand Down Expand Up @@ -207,6 +209,8 @@ tmux select-pane -t 0

if [ "$reboot" = true ] ; then

echo "Rebooting."

# deactivate carriers
deactivatecmd=""
activatecmd=""
Expand Down Expand Up @@ -326,6 +330,8 @@ else
echo "-> Waiting for ethernet on carrier in slot ${slot} to come up ..."
cd $cpwd
ping_carrier 10.0.${crate_id}.$((${slot}+100))

echo "Starting serial slot ${slot} with pyrogue ${pyrogue} with config ${pysmurf_cfg}"

start_slot_tmux_serial ${slot} ${pyrogue} ${pysmurf_cfg}

Expand Down
4 changes: 4 additions & 0 deletions scratch/shawn/scripts/shawnhammerfunctions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ is_slot_server_up() {
}

pysmurf_init() {
echo "Start of pysmurf_init"

slot_number=$1
pysmurf_cfg=$2

Expand All @@ -86,6 +88,7 @@ pysmurf_init() {
exit 1
fi
else
echo "Making temporary init script"
tmp_pysmurf_init_script=/tmp/psmurf_init_`date +%s`.py

# load pysmurf.client
Expand Down Expand Up @@ -301,6 +304,7 @@ is_rogue_server_up(){
timeout_sec=10
dockercmd="docker exec -it smurf_utils caget -w 1.0 -t smurf_server_s${slot}:AMCc:LocalTime -S"
localtime=`${dockercmd}`
echo $localtime
epochtime=`date "+%s" -d "$localtime" 2> /dev/null`

if [ "$?" -eq "0" ]; then
Expand Down
7 changes: 0 additions & 7 deletions scratch/shawn/test_new_carrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@

slot = S.slot_number

wait_before_setup_min=1
print('-> Waiting {} min before setup.'.format(wait_before_setup_min))
wait_before_setup_sec=wait_before_setup_min*60
time.sleep(wait_before_setup_sec)

S.setup()

wait_after_setup_min=1
print('-> Waiting {} min after setup.'.format(wait_after_setup_min))
wait_after_setup_sec=wait_after_setup_min*60
Expand Down
Loading