Skip to content

Commit 2fd6ffa

Browse files
authored
sca file update for consistency with new solid-waffle (#17)
* sca file update for consistency with new solid-waffle * update for compatibility with new romanisim
1 parent 4bb7105 commit 2fd6ffa

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed
Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#!/bin/bash
22
#SBATCH --job-name=preproc
3-
#SBATCH --account=PCON0003
3+
#SBATCH --account=PAS2340
44
#SBATCH --time=48:00:00
55
#SBATCH --nodes=1
66
#SBATCH --ntasks-per-node=12
77

88
# you can tell the script which SCA to use by setting:
99
#
10-
# sbatch --export=USE_SCA=10 make_sca_files.job
10+
# sbatch --export=USE_SCA=07 make_sca_files_install.job
1111
#
1212
# (this way you don't need to modify the script to run any of the SCAs)
1313
# which SCA to use? (format: '01' .. '18' -- you are supposed to have the leading 0 for SCA<=9)
1414

1515
# which read pattern to use? (format: string)
1616
export READ_PATTERN_NAME="IM_107_8"
1717
# tag for this set of files (should be the same for all the SCAs)
18-
export TAG="DUMMY20250521"
18+
export TAG="DUMMY20251211"
1919

2020
# where we get the darks
2121
export DARK_DIR="/fs/scratch/PCON0003/cond0007/FPT-Darks"
@@ -24,11 +24,9 @@ export FLAT_DIR="/fs/scratch/PCON0003/cond0007/FPT-Flats"
2424
# where we get the low-intensity flats
2525
export LOFLAT_DIR="/fs/scratch/PCON0003/cond0007/FPT-LoFlats"
2626
# where we are sending the data
27-
export TARGET_DIR="/fs/scratch/PCON0003/cond0007/cal"
27+
export TARGET_DIR="/fs/scratch/PCON0003/cond0007/cal_fall25"
2828
# where these scripts are located
2929
export SCRIPT_DIR="/users/PCON0003/cond0007/imcom/romanimpreprocess/runs/summer2025run"
30-
# solid-waffle directory
31-
export SOLID_WAFFLE_DIR="/users/PCON0003/cond0007/solid-waffle"
3230

3331
# tell the log some information
3432
echo "--- Environment variable ---"
@@ -39,7 +37,6 @@ echo "DARK_DIR" $DARK_DIR
3937
echo "FLAT_DIR" $FLAT_DIR
4038
echo "TARGET_DIR" $TARGET_DIR
4139
echo "SCRIPT_DIR" $SCRIPT_DIR
42-
echo "SOLID_WAFFLE_DIR" $SOLID_WAFFLE_DIR
4340
echo " "
4441

4542
# make single FITS files of the darks and flats
@@ -52,7 +49,6 @@ python convert_loflt.py $LOFLAT_DIR 12 $TARGET_DIR $USE_SCA
5249

5350
# set up solid-waffle
5451
# This is for using 50 exposures.
55-
cd $SCRIPT_DIR
5652
pwd
5753
echo "" > summary_files_$USE_SCA.txt; rm summary_files_$USE_SCA.txt # suppress warning
5854
perl write_solid-waffle_config.pl $TARGET_DIR $USE_SCA 1 10 > config1_$USE_SCA.txt
@@ -62,7 +58,6 @@ perl write_solid-waffle_config.pl $TARGET_DIR $USE_SCA 31 40 > config4_$USE_SCA.
6258
perl write_solid-waffle_config.pl $TARGET_DIR $USE_SCA 41 50 > config5_$USE_SCA.txt
6359
# run solid-waffle
6460
# This step can be parallelized
65-
cd $SOLID_WAFFLE_DIR
6661
python test_run.py $SCRIPT_DIR/config1_$USE_SCA.txt > $TARGET_DIR/sw-SCA$USE_SCA-P1.log &
6762
python test_run.py $SCRIPT_DIR/config2_$USE_SCA.txt > $TARGET_DIR/sw-SCA$USE_SCA-P2.log &
6863
python test_run.py $SCRIPT_DIR/config3_$USE_SCA.txt > $TARGET_DIR/sw-SCA$USE_SCA-P3.log &
@@ -73,16 +68,13 @@ wait
7368
rm $SCRIPT_DIR/config?_$USE_SCA.txt
7469

7570
# now print the gain files
76-
cd $SCRIPT_DIR
7771
pwd
7872
python make_gain_file.py summary_files_$USE_SCA.txt $USE_SCA $TARGET_DIR/roman_wfi_gain_$TAG\_SCA$USE_SCA.asdf
7973
# this is no longer needed
8074
rm summary_files_$USE_SCA.txt
8175

8276
# run the noise script
83-
cd $SOLID_WAFFLE_DIR
84-
pwd
85-
python noise_run.py -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_Noise_001.fits -o $TARGET_DIR/noise_SCA$USE_SCA.fits -n 100 -t 2 -cd 5.0 -rh 7 -tn 34 -ro
77+
python -m solid_waffle.noise_run -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_Noise_001.fits -o $TARGET_DIR/noise_SCA$USE_SCA.fits -n 100 -t 2 -cd 5.0 -rh 7 -tn 34 -ro
8678
# here:
8779
# 6 = file format (consistent with FPS)
8880
# $TARGET_DIR/99999999_SCA$USE_SCA\_Noise_001.fits = name of first noise file
@@ -95,25 +87,20 @@ python noise_run.py -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_Noise_001.fits -o
9587
# -ro = include reference output in build
9688

9789
# and generate histograms for the DNL
98-
python histograms.py -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_Noise_001.fits -o $TARGET_DIR/histD_SCA$USE_SCA.dat -n 100
99-
python histograms.py -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_LoFlat_001.fits -o $TARGET_DIR/histG_SCA$USE_SCA.dat -n 30
100-
python histograms.py -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_Flat_001.fits -o $TARGET_DIR/histF_SCA$USE_SCA.dat -n 50
90+
python -m solid_waffle.histograms -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_Noise_001.fits -o $TARGET_DIR/histD_SCA$USE_SCA.dat -n 100
91+
python -m solid_waffle.histograms -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_LoFlat_001.fits -o $TARGET_DIR/histG_SCA$USE_SCA.dat -n 30
92+
python -m solid_waffle.histograms -f 6 -i $TARGET_DIR/99999999_SCA$USE_SCA\_Flat_001.fits -o $TARGET_DIR/histF_SCA$USE_SCA.dat -n 50
10193

10294
# build the dark file
103-
cd $SCRIPT_DIR
10495
pwd
10596
python make_dark_file.py IM_107_8 $TARGET_DIR/99999999_SCA$USE_SCA\_Noise_001.fits $TARGET_DIR/noise_SCA$USE_SCA.fits $USE_SCA $TARGET_DIR/roman_wfi_dark_$TAG\_SCA$USE_SCA.asdf
10697

10798
# build the linearity files
108-
cd $SCRIPT_DIR
10999
pwd
110100
perl write_linearity_config.pl $TARGET_DIR $USE_SCA $TAG > linearity_pars_$USE_SCA.json
111-
cd $SOLID_WAFFLE_DIR
112-
pwd
113-
python linearity_run.py $SCRIPT_DIR/linearity_pars_$USE_SCA.json
101+
python -m solid_waffle.linearity_run $SCRIPT_DIR/linearity_pars_$USE_SCA.json
114102

115103
# post-process these to get pflat and saturation
116-
cd $SCRIPT_DIR
117104
pwd
118105
python postprocess_calfiles.py $TARGET_DIR/roman_wfi_linearitylegendre_$TAG\_SCA$USE_SCA.asdf $USE_SCA $READ_PATTERN_NAME
119106
python makemask.py $TARGET_DIR/roman_wfi_mask_$TAG\_SCA$USE_SCA.asdf $USE_SCA $READ_PATTERN_NAME

runs/summer2025run/test_run.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# this is just to call solid-waffle from the command line
2+
import sys
3+
4+
from solid_waffle.correlation_run import run_ir_all
5+
6+
run_ir_all(sys.argv[1])

src/romanimpreprocess/from_sim/sim_to_isim.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,6 @@ def simulate(self, use_read_pattern, caldir=None, config={}, seed=43):
585585
rng=rng,
586586
usecrds=False,
587587
darkrate=refdata["dark"],
588-
stpsf=False,
589588
flat=refdata["flat"],
590589
psf_keywords=dict(),
591590
)
@@ -617,7 +616,6 @@ def simulate(self, use_read_pattern, caldir=None, config={}, seed=43):
617616
rng=rng,
618617
usecrds=False,
619618
darkrate=this_dark,
620-
stpsf=False,
621619
flat=this_flat,
622620
psf_keywords=dict(),
623621
)

0 commit comments

Comments
 (0)