ECOv003-L2T-STARS 1.6.0__py3-none-any.whl → 1.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ import sys
7
7
  from datetime import date, timedelta, datetime
8
8
  from glob import glob
9
9
  from os.path import abspath, expanduser, join, basename, splitext, exists, dirname
10
+ import os
10
11
  from typing import Union, List
11
12
  import dateutil
12
13
  import numpy as np
@@ -115,9 +116,28 @@ def process_julia_BRDF(
115
116
  if initialize_julia:
116
117
  instantiate_VNP43NRT_jl(julia_source_directory)
117
118
 
118
- command = f'julia "{julia_script_filename}" "{band}" "{h}" "{v}" "{tile_width_cells}" "{start_date:%Y-%m-%d}" "{end_date:%Y-%m-%d}" "{reflectance_directory}" "{solar_zenith_directory}" "{sensor_zenith_directory}" "{relative_azimuth_directory}" "{SZA_filename}" "{output_directory}"'
119
- logger.info(command)
120
- subprocess.run(command, shell=True)
119
+ # Set up the environment for the julia script
120
+ julia_env = os.environ.copy()
121
+ # Ensure that julia uses its own bundled GDAL instead of conda's GDAL
122
+ julia_env.pop("GDAL_DATA")
123
+ julia_env.pop("GDAL_DRIVER_PATH")
124
+
125
+ command = [
126
+ "julia", julia_script_filename,
127
+ band,
128
+ f"{h}", f"{v}",
129
+ f"{tile_width_cells}",
130
+ f"{start_date:%Y-%m-%d}", f"{end_date:%Y-%m-%d}",
131
+ reflectance_directory,
132
+ solar_zenith_directory,
133
+ sensor_zenith_directory,
134
+ relative_azimuth_directory,
135
+ SZA_filename,
136
+ output_directory,
137
+ ]
138
+
139
+ logger.info(" ".join(command))
140
+ subprocess.run(command, env=julia_env)
121
141
 
122
142
  class BRDFRetrievalFailed(RuntimeError):
123
143
  pass
@@ -2,6 +2,7 @@ import subprocess
2
2
  from typing import Union
3
3
  from datetime import date
4
4
  from os.path import abspath, dirname, join, exists
5
+ import os
5
6
  import logging
6
7
 
7
8
  from .instantiate_STARSDataFusion_jl import instantiate_STARSDataFusion_jl
@@ -75,16 +76,26 @@ def process_julia_data_fusion(
75
76
  if initialize_julia:
76
77
  instantiate_STARSDataFusion_jl(STARS_source_directory)
77
78
 
79
+ # Set up the environment for the julia script
80
+ julia_env = os.environ.copy()
81
+ julia_env["JULIA_NUM_THREADS"] = str(threads)
82
+ # Ensure that julia uses its own bundled GDAL instead of conda's GDAL
83
+ julia_env.pop("GDAL_DATA")
84
+ julia_env.pop("GDAL_DRIVER_PATH")
85
+
78
86
  # Base Julia command with required arguments
79
- command = (
80
- f'export JULIA_NUM_THREADS={threads}; julia --threads {threads} '
81
- f'"{julia_script_filename}" {num_workers} "{tile}" "{coarse_cell_size}" '
82
- f'"{fine_cell_size}" "{VIIRS_start_date}" "{VIIRS_end_date}" '
83
- f'"{HLS_start_date}" "{HLS_end_date}" "{downsampled_directory}" '
84
- f'"{product_name}" "{posterior_filename}" "{posterior_UQ_filename}" '
85
- f'"{posterior_flag_filename}" "{posterior_bias_filename}" '
86
- f'"{posterior_bias_UQ_filename}"'
87
- )
87
+ command = [
88
+ "julia", "--threads", f"{threads}", julia_script_filename,
89
+ f"{num_workers}",
90
+ tile,
91
+ f"{coarse_cell_size}", f"{fine_cell_size}",
92
+ f"{VIIRS_start_date}", f"{VIIRS_end_date}",
93
+ f"{HLS_start_date}", f"{HLS_end_date}",
94
+ downsampled_directory, product_name,
95
+ posterior_filename, posterior_UQ_filename,
96
+ posterior_flag_filename,
97
+ posterior_bias_filename, posterior_bias_UQ_filename,
98
+ ]
88
99
 
89
100
  # Conditionally add prior arguments if all prior filenames are provided and exist
90
101
  if all(
@@ -99,14 +110,14 @@ def process_julia_data_fusion(
99
110
  ]
100
111
  ):
101
112
  logger.info("Passing prior into Julia data fusion system")
102
- command += (
103
- f' "{prior_filename}" "{prior_UQ_filename}" "{prior_bias_filename}" '
104
- f'"{prior_bias_UQ_filename}"'
105
- )
113
+ command += [
114
+ prior_filename, prior_UQ_filename,
115
+ prior_bias_filename, prior_bias_UQ_filename,
116
+ ]
106
117
  else:
107
118
  logger.info("No complete prior set found; running Julia data fusion without prior.")
108
119
 
109
- logger.info(f"Executing Julia command: {command}")
110
- # Execute the Julia command. Using shell=True as the command string includes shell syntax (export).
120
+ logger.info(f"Executing Julia command: {' '.join(command)}")
121
+ # Execute the Julia command, adding the environment changes
111
122
  # This assumes the Julia executable is in the system's PATH.
112
- subprocess.run(command, shell=True, check=False)
123
+ subprocess.run(command, check=False, env=julia_env)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ECOv003-L2T-STARS
3
- Version: 1.6.0
3
+ Version: 1.7.0
4
4
  Summary: ECOSTRESS Collection 3 JPL STARS Data Fusion Product Generating Executable (PGE)
5
5
  Author-email: "Gregory H. Halverson" <gregory.h.halverson@jpl.nasa.gov>
6
6
  Project-URL: Homepage, https://github.com/ECOSTRESS-Collection-3/ECOv003-L2T-STARS
@@ -28,7 +28,7 @@ ECOv003_L2T_STARS/main.py,sha256=FjLTfN6tk-CaVBDwT5OlYxc8m-0bQZbniXx-6881MhA,605
28
28
  ECOv003_L2T_STARS/prior.py,sha256=fLE54pBIOG6sCas1G60nhn8LcHa2AqZ_eSY_J-MB4eM,2867
29
29
  ECOv003_L2T_STARS/process_ECOSTRESS_data_fusion_distributed_bias.jl,sha256=OuMd-Y_zNQJStecIPRwz9_5N5Loh8JVmkhBLFu1nlNs,16089
30
30
  ECOv003_L2T_STARS/process_STARS_product.py,sha256=KPzH28dR4bX966hVXRpupO8fxzxoiFwwYpf4lf7YE68,21948
31
- ECOv003_L2T_STARS/process_julia_data_fusion.py,sha256=lpChy2WJBQAvaJXa3PJFLwItQzlRqj1Z13EBaQLB40s,5341
31
+ ECOv003_L2T_STARS/process_julia_data_fusion.py,sha256=LxHsmML_5OAo03v656bvGijf4-JvFXfdASezNztto5Q,5542
32
32
  ECOv003_L2T_STARS/retrieve_STARS_sources.py,sha256=jP4IXJK4XSYj4Yp0zfWIrYXTbHfGBvge0h2yEznIPNY,3802
33
33
  ECOv003_L2T_STARS/runconfig.py,sha256=TLaB3w6Y0qEZPqMa-YXuUzKSACrdpKmrozUNLh70aQw,1519
34
34
  ECOv003_L2T_STARS/version.py,sha256=CcCeNt2pNqb8AQ_vHLUbLJciE8hxTMeGmN79vAYObYQ,354
@@ -48,7 +48,7 @@ ECOv003_L2T_STARS/VIIRS/VNP43IA4.py,sha256=3qZbDHoLVhoiSr4hoojMxXXuDSNKkN4B9Dan-
48
48
  ECOv003_L2T_STARS/VIIRS/VNP43MA3.py,sha256=T_1mxdg_SII0vXp_D422aAU7fE0-7TY46IZzRJPGJ1Q,11043
49
49
  ECOv003_L2T_STARS/VIIRS/__init__.py,sha256=PVyb97Bg5gVMdcyC7JpErQCjJWSrOFdHJH4rNE__eL8,264
50
50
  ECOv003_L2T_STARS/VIIRS/version.txt,sha256=Ke8b6aOkBgjuceFV64cco0Yw4jvu6a8pRBq6nQ6nbVQ,5
51
- ECOv003_L2T_STARS/VNP43NRT/VNP43NRT.py,sha256=qC6Ufvn6lQwTzchLucLgPUZsaLbMqTLPqTpHRYZBZxo,31719
51
+ ECOv003_L2T_STARS/VNP43NRT/VNP43NRT.py,sha256=2r8RYpu_RFizBuyEw-TH0DJWeSXa3ExfPB_FDrFUB44,32053
52
52
  ECOv003_L2T_STARS/VNP43NRT/__init__.py,sha256=8LkfUUFW0pyaO-1S134RnimfKYAKP6UfvzO7kPAx9mo,24
53
53
  ECOv003_L2T_STARS/VNP43NRT/process_VNP43NRT.jl,sha256=pNa5Z0RcyXSul2pysPwEWwl1e6XuTX_XURqgJIsVfT8,7139
54
54
  ECOv003_L2T_STARS/VNP43NRT/version.txt,sha256=atlhOkVXmNbZLl9fOQq0uqcFlryGntaxf1zdKyhjXwY,5
@@ -63,9 +63,9 @@ ECOv003_L2T_STARS/daterange/__init__.py,sha256=54kYb9tmsm5twxMqjJKeD__5kGkNDz3Pp
63
63
  ECOv003_L2T_STARS/daterange/daterange.py,sha256=EHa2Xt9fiJ1gbX7aa_QV_br1rAXjg3pHrLSRasOsOhM,959
64
64
  ECOv003_L2T_STARS/timer/__init__.py,sha256=I_MQKp_aamBLUzZv0psEbRgs6GZLOJd4mmJ7bli0Ikc,21
65
65
  ECOv003_L2T_STARS/timer/timer.py,sha256=tn5e3NQmsh55Jp9Fstjf-8KJW4F8UIJs-d_ZLooFYE8,1610
66
- ecov003_l2t_stars-1.6.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
67
- ecov003_l2t_stars-1.6.0.dist-info/METADATA,sha256=x7NYNmR2chp_QHoPbBTjIv_Rolxx8r1gLsaC08hyOV0,13283
68
- ecov003_l2t_stars-1.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
- ecov003_l2t_stars-1.6.0.dist-info/entry_points.txt,sha256=EVVKltKsqXBc94JIu4IjVrMP0DPqaNEdQoAgcZOApQQ,106
70
- ecov003_l2t_stars-1.6.0.dist-info/top_level.txt,sha256=lRivA5MjbrabH4sv-LUstMGaLZ865wRQPpz9Kh6-plg,18
71
- ecov003_l2t_stars-1.6.0.dist-info/RECORD,,
66
+ ecov003_l2t_stars-1.7.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
67
+ ecov003_l2t_stars-1.7.0.dist-info/METADATA,sha256=7cCbJNsDumZKy9mbiHl1DVeuyIUNOonCc0jaC7i5OZQ,13283
68
+ ecov003_l2t_stars-1.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
+ ecov003_l2t_stars-1.7.0.dist-info/entry_points.txt,sha256=w1SInJQvMFavgcUIWW1NLOygycIJpA86MZBKg74ZmiM,113
70
+ ecov003_l2t_stars-1.7.0.dist-info/top_level.txt,sha256=lRivA5MjbrabH4sv-LUstMGaLZ865wRQPpz9Kh6-plg,18
71
+ ecov003_l2t_stars-1.7.0.dist-info/RECORD,,
@@ -1,3 +1,3 @@
1
1
  [console_scripts]
2
- ECOv003-DL = ECOv003_DL.ECOv003_DL:main
2
+ ECOv003-DL = ECOv003_L2T_STARS.ECOv003_DL:main
3
3
  ECOv003-L2T-STARS = ECOv003_L2T_STARS.main:main