Skip to content

Commit 7841f70

Browse files
committed
Update L1B notebook to match changes to L1A notebook
1 parent c156510 commit 7841f70

File tree

2 files changed

+85
-23
lines changed

2 files changed

+85
-23
lines changed

interface/run_l1a_pge.ipynb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@
107107
"#start_datetime = \"2016-01-14T09:54:00.000Z\""
108108
]
109109
},
110+
{
111+
"cell_type": "code",
112+
"execution_count": null,
113+
"id": "f4e7ced6-0a10-482c-8607-a8a6874b75c1",
114+
"metadata": {},
115+
"outputs": [],
116+
"source": [
117+
"# Converting to absolute path to remove any relative paths\n",
118+
"input_path = os.path.realpath(input_path)\n",
119+
"output_path = os.path.realpath(output_path)\n",
120+
"data_static_path = os.path.realpath(config_static_path)"
121+
]
122+
},
110123
{
111124
"cell_type": "markdown",
112125
"id": "e80baccd",

interface/run_l1b_pge.ipynb

Lines changed: 72 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,38 @@
3535
"from xml.dom import minidom"
3636
]
3737
},
38+
{
39+
"cell_type": "markdown",
40+
"id": "e80baccd",
41+
"metadata": {},
42+
"source": [
43+
"## Constants"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": null,
49+
"id": "5df6c714",
50+
"metadata": {},
51+
"outputs": [],
52+
"source": [
53+
"# Base path where configuration and executables have been installed\n",
54+
"install_base_path = \"/pge\"\n",
55+
"\n",
56+
"# The following are defaults for when the environemnt variables referenced below are not found\n",
57+
"\n",
58+
"# Where PGE static config files\n",
59+
"config_static_path = os.environ.get(\"PGE_STATIC_CONFIG_PATH\", os.path.join(install_base_path, \"config\"))\n",
60+
"\n",
61+
"# Where PGE binaries are located\n",
62+
"pge_bin_path = os.environ.get(\"PGE_BINARY_PATH\", os.path.join(install_base_path, \"bin\"))\n",
63+
"\n",
64+
"# Where PGE static data files are looked for in a predictable location\n",
65+
"# This path needs to be constant because the static config files are\n",
66+
"# rewritten to point to it.\n",
67+
"data_static_path_local = os.environ.get(\"PGE_STATIC_DATA_PATH\", \"/tmp/static\")"
68+
]
69+
},
3870
{
3971
"cell_type": "markdown",
4072
"id": "0f1c1c7e",
@@ -54,14 +86,11 @@
5486
},
5587
"outputs": [],
5688
"source": [
57-
"# Location of input L0 files\n",
58-
"input_path = \"/pge/in\"\n",
89+
"# Location of input L1A files\n",
90+
"input_path = \"/tmp/in\"\n",
5991
"\n",
6092
"# Where PGE output files and log files get written\n",
61-
"output_path = \"/pge/out\"\n",
62-
"\n",
63-
"# Where PGE static config files\n",
64-
"config_static_path = \"/pge/static\"\n",
93+
"output_path = \"/tmp/out\"\n",
6594
"\n",
6695
"# Enable verbose logging\n",
6796
"verbose = True"
@@ -74,30 +103,23 @@
74103
"metadata": {},
75104
"outputs": [],
76105
"source": [
77-
"# converting to absolute path if relative paths passed in\n",
78-
"\n",
79-
"if not input_path.startswith('/'):\n",
80-
" input_path = os.path.abspath(input_path)\n",
81-
"\n",
82-
"if not output_path.startswith('/'):\n",
83-
" output_path = os.path.abspath(output_path)\n",
84-
"\n",
85-
"if not config_static_path.startswith('/'):\n",
86-
" config_static_path = os.path.abspath(config_static_path)"
106+
"# Converting to absolute path to remove any relative paths\n",
107+
"input_path = os.path.realpath(input_path)\n",
108+
"output_path = os.path.realpath(output_path)"
87109
]
88110
},
89111
{
90112
"cell_type": "markdown",
91-
"id": "e80baccd",
113+
"id": "b9f00c55-7836-4b0f-a26b-eb0ca1c4e3b6",
92114
"metadata": {},
93115
"source": [
94-
"## Constants"
116+
"## Configuration"
95117
]
96118
},
97119
{
98120
"cell_type": "code",
99121
"execution_count": null,
100-
"id": "5df6c714",
122+
"id": "af083a72-c0db-4edd-8c6e-4169d75d2200",
101123
"metadata": {},
102124
"outputs": [],
103125
"source": [
@@ -111,10 +133,37 @@
111133
"log_filename = os.path.join(output_path, \"L1BMw_main.log\")\n",
112134
"\n",
113135
"# Location of PGE executable\n",
114-
"pge_executable = \"/pge/bin/L1BMw_main\"\n",
136+
"pge_executable = os.path.join(pge_bin_path, \"L1BMw_main\")\n",
115137
"\n",
116138
"# Location of MetExtractor executable\n",
117-
"met_extractor_executable = \"/pge/bin/MetExtractor\""
139+
"met_extractor_executable = os.path.join(pge_bin_path, \"MetExtractor\")"
140+
]
141+
},
142+
{
143+
"cell_type": "markdown",
144+
"id": "613bb42b-25e2-4408-bec0-2011d2683207",
145+
"metadata": {},
146+
"source": [
147+
"## Enviroment Variables"
148+
]
149+
},
150+
{
151+
"cell_type": "code",
152+
"execution_count": null,
153+
"id": "9483cea1-aa0c-4ca4-ae41-bd9885a30136",
154+
"metadata": {},
155+
"outputs": [],
156+
"source": [
157+
"# These need to be defined for the PGS Toolkit to find its files\n",
158+
"# Values supplied by the runtime environment take precedence\n",
159+
"if not \"PGSHOME\" in os.environ:\n",
160+
" os.environ[\"PGSHOME\"] = \"/opt/packages/sdptk5.2.20v1.01/TOOLKIT/\"\n",
161+
" \n",
162+
"if not \"PGS_PC_INFO_FILE\" in os.environ:\n",
163+
" os.environ[\"PGS_PC_INFO_FILE\"] = os.path.join(config_static_path, \"SNDR.PGSToolkit_ProcessControlFile.pcf\")\n",
164+
" \n",
165+
"if not \"PGS_LEAPSEC_FILE\" in os.environ:\n",
166+
" os.environ[\"PGS_LEAPSEC_FILE\"] = os.path.join(os.environ[\"PGSHOME\"], \"leapsec.dat\")"
118167
]
119168
},
120169
{
@@ -451,7 +500,7 @@
451500
],
452501
"metadata": {
453502
"kernelspec": {
454-
"display_name": "Python 3",
503+
"display_name": "Python 3 (ipykernel)",
455504
"language": "python",
456505
"name": "python3"
457506
},
@@ -465,7 +514,7 @@
465514
"name": "python",
466515
"nbconvert_exporter": "python",
467516
"pygments_lexer": "ipython3",
468-
"version": "3.6.8"
517+
"version": "3.10.5"
469518
}
470519
},
471520
"nbformat": 4,

0 commit comments

Comments
 (0)