#source /beegfs/store/shared/nostripe/miniconda3/bin/activate
#conda activate /beegfs/store/shared/nostripe/conda-shared-envs/isofit_env
#MODTRAN
base_dir=/beegfs/scratch/reckert/develop/202301_SMODE/202407_GlintSurface/avng_data_segments/
for fid in ang20220512t181806 ang20220512t180531
do 
    outlog=glint_${fid}_mt
    sbatch -N 1 -c 40 -o logs/${outlog}_o -e logs/${outlog}_e --mem=180G --job-name=mt_ang${fid:12:6}_glint --wrap="rm -f /dev/shm/*; export PYTHONPATH=/beegfs/scratch/reckert/develop/isofit/:$PYTHONPATH; python /beegfs/scratch/reckert/develop/isofit/isofit apply_oe ${base_dir}${fid}_RDN_sub ${base_dir}${fid}_LOC_sub ${base_dir}${fid}_OBS_sub /beegfs/scratch/reckert/develop/202301_SMODE/202407_GlintSurface/${fid}_modtran ang --surface_category glint_model_surface --surface_path /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/surface_SWIPE_avng_swir_20240424.mat --n_cores 40 --presolve --lut_config_file /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/lut_config.json"
done
#--presolve
# #KF emulator
# base_dir=/beegfs/scratch/reckert/develop/202301_SMODE/202407_GlintSurface/avng_data_segments/
# for fid in ang20220512t181806 #ang20220512t180531
# do 
#     outlog=glint_${fid}_em
#     sbatch -N 1 -c 40 -o logs/${outlog}_o -e logs/${outlog}_e --mem=180G --job-name=em_ang${fid:12:6}_glint --wrap="rm -f /dev/shm/*; export PYTHONPATH=/beegfs/scratch/reckert/develop/isofit/:$PYTHONPATH; python /beegfs/scratch/reckert/develop/isofit/isofit apply_oe ${base_dir}${fid}_RDN_sub ${base_dir}${fid}_LOC_sub ${base_dir}${fid}_OBS_sub /beegfs/scratch/reckert/develop/202301_SMODE/202407_GlintSurface/${fid}_emulator ang --surface_category glint_model_surface --surface_path /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/surface_SWIPE_avng_swir_20240424.mat --n_cores 40 --presolve --emulator_base=/beegfs/scratch/brodrick/isofit/kf/saved/convolve_01_EMIT_20220817_clipped_jparm_sizetest__1000.jld2 --lut_config_file /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/lut_config.json"
# done

#

#April-June 2024
# base_dir=/beegfs/store/ang/y22/
# for fid in ang20220512t180531
# do 
#     outlog=glint_${fid}
#     sbatch -N 1 -c 40 -o logs/${outlog}_o -e logs/${outlog}_e --mem=180G --job-name=ang${fid:12:6}_glint --wrap="rm -f /dev/shm/*; export PYTHONPATH=/beegfs/scratch/reckert/develop/isofit/:$PYTHONPATH; python /beegfs/scratch/reckert/develop/isofit/isofit/utils/apply_oe.py ${base_dir}rdn/${fid}_000_L1B_RDN_4e368800_RDN ${base_dir}rdn/ort/${fid}_000_L1B_ORT_b9bde824_LOC ${base_dir}rdn/ort/${fid}_000_L1B_ORT_b9bde824_OBS /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/new_${fid} ang --surface_category glint_model_surface --surface_path /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/surface_SWIPE_avng_swir_20240424.mat --n_cores 40 --presolve 1 --lut_config_file /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/lut_config.json"
# done


# base_dir=/beegfs/store/ang/y22/
# for fid in ang20220529t220943 ang20220529t222033
# do 
#     outlog=glint_${fid}
#     sbatch -N 1 -c 40 -o logs/${outlog}_o -e logs/${outlog}_e --mem=180G --job-name=ang${fid:12:6}_glint --wrap="rm -f /dev/shm/*; export PYTHONPATH=/beegfs/scratch/reckert/develop/isofit/:$PYTHONPATH; python /beegfs/scratch/reckert/develop/isofit/isofit/utils/apply_oe.py ${base_dir}rdn/${fid}_rdn_v2y1_clip ${base_dir}raw/${fid}_rdn_loc ${base_dir}raw/${fid}_rdn_obs /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/new_${fid} ang --surface_category glint_model_surface --surface_path /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/surface_SWIPE_avng_swir_20240424.mat --n_cores 40 --presolve 1 --lut_config_file /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/lut_config.json"
# done

# for fid in ang20200825t193235
# do 
#     outlog=glint_${fid}
#     sbatch -N 1 -c 40 -o logs/${outlog}_o -e logs/${outlog}_e --mem=180G --job-name=ang${fid:12:6}_glint --wrap="rm -f /dev/shm/*; export PYTHONPATH=/beegfs/scratch/reckert/develop/isofit/:$PYTHONPATH; python /beegfs/scratch/reckert/develop/isofit/isofit/utils/apply_oe.py ${base_dir}${fid}_rdn_v2y1_clip ${base_dir}${fid}_rdn_loc ${base_dir}${fid}_rdn_obs /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/new_${fid} ang --surface_category glint_model_surface --surface_path /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/surface_swipe_20240328_AVNG.mat --n_cores 40 --presolve 1 --analytical_line 1 --atm_sigma 2 --lut_config_file /beegfs/scratch/reckert/develop/202301_SMODE/202311_GlintSurface/lut_config.json"
# done
