|
35 | 35 | "from xml.dom import minidom" |
36 | 36 | ] |
37 | 37 | }, |
| 38 | + { |
| 39 | + "cell_type": "markdown", |
| 40 | + "id": "1fc21ce3-a47a-40f9-8039-d04970151ef5", |
| 41 | + "metadata": {}, |
| 42 | + "source": [ |
| 43 | + "## Constants" |
| 44 | + ] |
| 45 | + }, |
| 46 | + { |
| 47 | + "cell_type": "code", |
| 48 | + "execution_count": null, |
| 49 | + "id": "40c333f0-aff0-4813-9a59-5fdff4681bcf", |
| 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 | + "# Where PGE static config files\n", |
| 57 | + "config_static_path = os.path.join(install_base_path, \"static\")\n", |
| 58 | + "\n", |
| 59 | + "# Where PGE binaries are located\n", |
| 60 | + "pge_bin_path = os.path.join(install_base_path, \"bin\")" |
| 61 | + ] |
| 62 | + }, |
38 | 63 | { |
39 | 64 | "cell_type": "markdown", |
40 | 65 | "id": "0f1c1c7e", |
|
55 | 80 | "outputs": [], |
56 | 81 | "source": [ |
57 | 82 | "# Location of input L0 files\n", |
58 | | - "input_path = \"/pge/in\"\n", |
| 83 | + "input_path = \"/tmp/in\"\n", |
59 | 84 | "\n", |
60 | 85 | "# Where PGE output files and log files get written\n", |
61 | | - "output_path = \"/pge/out\"\n", |
| 86 | + "output_path = \"/tmp/out\"\n", |
62 | 87 | "\n", |
63 | 88 | "# Location of dem and mcf static files\n", |
64 | 89 | "data_static_path = \"/tmp/static\"\n", |
|
76 | 101 | "id": "e80baccd", |
77 | 102 | "metadata": {}, |
78 | 103 | "source": [ |
79 | | - "## Constants" |
| 104 | + "## Configuration" |
80 | 105 | ] |
81 | 106 | }, |
82 | 107 | { |
|
86 | 111 | "metadata": {}, |
87 | 112 | "outputs": [], |
88 | 113 | "source": [ |
89 | | - "# Where PGE static config files\n", |
90 | | - "config_static_path = \"/pge/static\"\n", |
91 | | - "\n", |
92 | 114 | "# Source XML file to be modified with execution parameters\n", |
93 | | - "config_template_filename = \"/pge/static/pge_config_template.xml\"\n", |
| 115 | + "config_template_filename = os.path.join(config_static_path, \"pge_config_template.xml\")\n", |
94 | 116 | "\n", |
95 | 117 | "# Where config file gets written\n", |
96 | 118 | "config_output_filename = os.path.join(output_path, \"l1a_config.xml\")\n", |
|
99 | 121 | "log_filename = os.path.join(output_path, \"L1AMw_main.log\")\n", |
100 | 122 | "\n", |
101 | 123 | "# Location of PGE executable\n", |
102 | | - "pge_executable = \"/pge/bin/L1AMw_main\"\n", |
| 124 | + "pge_executable = os.path.join(pge_bin_path, \"L1AMw_main\")\n", |
103 | 125 | "\n", |
104 | 126 | "# Location of MetExtractor executable\n", |
105 | | - "met_extractor_executable = \"/pge/bin/MetExtractor\"" |
| 127 | + "met_extractor_executable = os.path.join(pge_bin_path, \"MetExtractor\")" |
106 | 128 | ] |
107 | 129 | }, |
108 | 130 | { |
|
175 | 197 | "\n", |
176 | 198 | "dem_dst_path = \"/tmp/static/dem\"\n", |
177 | 199 | "mcf_dst_path = \"/tmp/static/mcf\"\n", |
178 | | - "\n", |
| 200 | + " \n", |
179 | 201 | "for src_path, dst_path in [(dem_src_path, dem_dst_path), (mcf_src_path, mcf_dst_path)]:\n", |
180 | 202 | " # Only error if the destination path exists and is not the same as the source\n", |
181 | 203 | " if os.path.exists(dst_path) and not os.path.realpath(src_path) == os.path.realpath(dst_path):\n", |
|
569 | 591 | ], |
570 | 592 | "metadata": { |
571 | 593 | "kernelspec": { |
572 | | - "display_name": "Python 3", |
| 594 | + "display_name": "Python 3 (ipykernel)", |
573 | 595 | "language": "python", |
574 | 596 | "name": "python3" |
575 | 597 | }, |
|
583 | 605 | "name": "python", |
584 | 606 | "nbconvert_exporter": "python", |
585 | 607 | "pygments_lexer": "ipython3", |
586 | | - "version": "3.6.8" |
| 608 | + "version": "3.10.5" |
587 | 609 | } |
588 | 610 | }, |
589 | 611 | "nbformat": 4, |
|
0 commit comments