Skip to content

Commit c156510

Browse files
committed
Add install scripts for L1B PGE
1 parent 95b4eb9 commit c156510

File tree

3 files changed

+145
-5
lines changed

3 files changed

+145
-5
lines changed

install/build_l1b.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Parallel build can cause the build to failr
4+
export NUM_COMPILE_JOBS=1
5+
6+
usage () {
7+
echo "Usage:"
8+
echo "$0 <source_code_directory> [<destination_binary_directory>]"
9+
exit 1
10+
}
11+
12+
src_dir=$1
13+
dst_dir=$2
14+
15+
if [ -z "$src_dir" ]; then
16+
usage
17+
fi
18+
19+
cd $src_dir/src/sips_pge/l1b_atms/make && make -j $NUM_COMPILE_JOBS
20+
21+
if [ ! -z "$dst_dir" ]; then
22+
mkdir -p $dst_dir
23+
cp $src_dir/src/sips_pge/l1b_atms/main/bin/L1BMw_main $dst_dir
24+
cp $src_dir/src/scf_metextractors/main/bin/MetExtractor $dst_dir
25+
fi
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
DEFAULT_STATIC_FILES_DIR="/unity/ads/sounder_sips/static_files/"
6+
7+
usage () {
8+
echo "Usage:"
9+
echo "$0 <source_code_directory> <static_config_directory> [<static_data_directory>]"
10+
exit 1
11+
}
12+
13+
script_dir=$(dirname $0)
14+
15+
src_dir=$1
16+
dst_dir=$2
17+
static_dir=$3
18+
19+
if [ -z "$src_dir" ]; then
20+
usage
21+
fi
22+
23+
if [ -z "$dst_dir" ]; then
24+
usage
25+
fi
26+
27+
if [ ! -e "$dst_dir" ]; then
28+
mkdir -p $dst_dir
29+
fi
30+
31+
if [ -z "$static_dir" ]; then
32+
static_dir=$DEFAULT_STATIC_FILES_DIR
33+
fi
34+
35+
# Copy files from acceptance test directories, these are referenced by the input XML file
36+
cp $src_dir/pcf/SNDR.PGSToolkit_ProcessControlFile.pcf $dst_dir
37+
cp $src_dir/src/sips_pge/l1b_atms_snpp/acctest/in/SNDR.SNPP.L1bMw.sfif.acctest.xml $dst_dir
38+
cp $src_dir/src/sips_pge/l1b_atms_snpp/acctest/in/SNDR.SchemaParameterfile.060401120000.xsd $dst_dir
39+
40+
# Modify SFIF file to point to destination paths
41+
sed -i 's|../../../static|'$dst_dir'|' $dst_dir/SNDR.SNPP.L1bMw.sfif.acctest.xml
42+
43+
# Modify to point DEMs to a path controlled by Docker
44+
sed -i -e 's|/peate/support/static/dem|'$static_dir'/dem|' \
45+
-e 's|/ref/devstable/STORE/mcf|'$static_dir'/mcf|' \
46+
$dst_dir/SNDR.PGSToolkit_ProcessControlFile.pcf
47+
48+
49+
# Static files referenced in SFIF file
50+
cp $src_dir/src/sips_pge/l1b_atms_snpp/static/SNDR.SNPP.L1bMw.template.201217000000.nc $dst_dir
51+
cp $src_dir/src/sips_pge/l1b_atms_snpp/static/SNDR.SNPP.L1bMw.apf.171115000000.xml $dst_dir
52+
cp $src_dir/src/sips_pge/l1b_atms_snpp/static/SNDR.SIPS.SNPP.ATMS.L1B.SPDCMetConstants_170801000000.pev $dst_dir
53+
cp $src_dir/src/sips_pge/l1b_atms_snpp/static/SNDR.SIPS.SNPP.ATMS.L1B.SPDCMetMappings_171115000000.xml $dst_dir
54+
cp $src_dir/src/sips_pge/l1b_atms_snpp/static/SNDR.SIPS.ATMS.L1B.SPDCMetStructure_171115000000.xml $dst_dir
55+
56+
# Template PGE configuration file to be modified by the Jupyter notebook
57+
cp $src_dir/src/sips_pge/l1b_atms_snpp/acctest/spdc_nominal/in/SNDR.SNPP.L1bMw.nominal.config.xml $dst_dir/pge_config_template.xml

install/local_install.ipynb

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,47 @@
2121
"install_path = \"/tmp/pge\""
2222
]
2323
},
24+
{
25+
"cell_type": "code",
26+
"execution_count": null,
27+
"id": "970e511c-3322-47c8-9fc4-a105d2c13fa7",
28+
"metadata": {},
29+
"outputs": [],
30+
"source": [
31+
"l1a_path = os.path.join(install_path, \"l1a\")\n",
32+
"l1b_path = os.path.join(install_path, \"l1b\")"
33+
]
34+
},
2435
{
2536
"cell_type": "code",
2637
"execution_count": null,
2738
"id": "5393d4db-1e86-481b-9f18-04ebf2177fca",
2839
"metadata": {},
2940
"outputs": [],
3041
"source": [
31-
"binary_path = os.path.join(install_path, \"bin\")\n",
32-
"config_path = os.path.join(install_path, \"config\")"
42+
"l1a_binary_path = os.path.join(l1a_path, \"bin\")\n",
43+
"l1a_config_path = os.path.join(l1a_path, \"config\")"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": null,
49+
"id": "985c48e4-d058-4e6d-976a-4b3aa1d64b16",
50+
"metadata": {},
51+
"outputs": [],
52+
"source": [
53+
"l1b_binary_path = os.path.join(l1b_path, \"bin\")\n",
54+
"l1b_config_path = os.path.join(l1b_path, \"config\")"
55+
]
56+
},
57+
{
58+
"cell_type": "code",
59+
"execution_count": null,
60+
"id": "874f3d44-5a51-45fd-ae06-4150dc985fb7",
61+
"metadata": {},
62+
"outputs": [],
63+
"source": [
64+
"!./patch_source.sh $source_path"
3365
]
3466
},
3567
{
@@ -53,17 +85,43 @@
5385
},
5486
"outputs": [],
5587
"source": [
56-
"!./build_l1a.sh $source_path $binary_path"
88+
"!./build_l1a.sh $source_path $l1a_binary_path"
89+
]
90+
},
91+
{
92+
"cell_type": "code",
93+
"execution_count": null,
94+
"id": "e46db16c-a02c-4f0c-bbf1-7fdcef9162a2",
95+
"metadata": {
96+
"tags": []
97+
},
98+
"outputs": [],
99+
"source": [
100+
"!./build_l1b.sh $source_path $l1b_binary_path"
57101
]
58102
},
59103
{
60104
"cell_type": "code",
61105
"execution_count": null,
62106
"id": "7a9d7c5b-4c16-4597-9093-87367c7e3675",
63-
"metadata": {},
107+
"metadata": {
108+
"tags": []
109+
},
110+
"outputs": [],
111+
"source": [
112+
"!./create_l1a_static_config.sh $source_path $l1a_config_path"
113+
]
114+
},
115+
{
116+
"cell_type": "code",
117+
"execution_count": null,
118+
"id": "5900da57-90b8-4282-8bf9-93f7ea3c68c3",
119+
"metadata": {
120+
"tags": []
121+
},
64122
"outputs": [],
65123
"source": [
66-
"!./create_l1a_static_config.sh $source_path $config_path"
124+
"!./create_l1b_static_config.sh $source_path $l1b_config_path"
67125
]
68126
}
69127
],

0 commit comments

Comments
 (0)