ECOv003-L2T-STARS 1.2.0__tar.gz → 1.3.0__tar.gz
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.
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/.github/workflows/ci.yml +6 -1
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/L2T_STARS.py +1 -1
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/LPDAAC/LPDAACDataPool.py +42 -40
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/VNP09GA.py +3 -2
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/__init__.py +1 -1
- ecov003_l2t_stars-1.3.0/ECOv003_L2T_STARS/cksum.py +66 -0
- ecov003_l2t_stars-1.3.0/ECOv003_L2T_STARS/exceptions.py +2 -0
- ecov003_l2t_stars-1.2.0/ECOv003_L2T_STARS/install_STARS_jl.py → ecov003_l2t_stars-1.3.0/ECOv003_L2T_STARS/install_STARSDataFusion_jl.py +4 -4
- ecov003_l2t_stars-1.2.0/ECOv003_L2T_STARS/instantiate_STARS_jl.py → ecov003_l2t_stars-1.3.0/ECOv003_L2T_STARS/instantiate_STARSDataFusion_jl.py +3 -3
- ecov003_l2t_stars-1.3.0/ECOv003_L2T_STARS/login.py +61 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/process_julia_data_fusion.py +2 -2
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS.egg-info/PKG-INFO +1 -2
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS.egg-info/SOURCES.txt +7 -5
- ecov003_l2t_stars-1.3.0/ECOv003_L2T_STARS.egg-info/entry_points.txt +3 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS.egg-info/requires.txt +0 -1
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/PKG-INFO +1 -2
- ecov003_l2t_stars-1.3.0/makefile +90 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/pyproject.toml +2 -3
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/tests/test_import_dependencies.py +0 -1
- ecov003_l2t_stars-1.2.0/ECOv003_L2T_STARS/VIIRS/VIIRS_CMR_LOGIN.py +0 -36
- ecov003_l2t_stars-1.2.0/ECOv003_L2T_STARS.egg-info/entry_points.txt +0 -3
- ecov003_l2t_stars-1.2.0/makefile +0 -66
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/.github/workflows/python-publish.yml +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/.gitignore +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/Dockerfile +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOSTRESS Granule Download Bias.ipynb +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOSTRESS Granule Download.ipynb +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/BRDF/BRDF.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/BRDF/SZA.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/BRDF/__init__.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/BRDF/statistical_radiative_transport.txt +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/BRDF/version.txt +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/ECOv003_DL.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/ECOv003_DL.xml +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/ECOv003_L2T_STARS.xml +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/L2TSTARSConfig.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/LPDAAC/__init__.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/LPDAAC/version.txt +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/Manifest.toml +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/Project.toml +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/VIIRSDataPool.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/VIIRSDownloader.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/VNP43IA4.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/VNP43MA3.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/__init__.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/version.txt +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT/VNP43NRT.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT/__init__.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT/process_VNP43NRT.jl +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT/version.txt +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/Manifest.toml +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/Project.toml +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/__init__.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/instantiate.jl +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/instantiate.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/src/VNP43NRT.jl +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/src/__init__.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/calibrate_fine_to_coarse.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/constants.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/daterange/__init__.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/daterange/daterange.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_L2T_STARS_runconfig.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_NDVI_coarse_directory.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_NDVI_coarse_image.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_NDVI_fine_directory.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_NDVI_fine_image.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_STARS_inputs.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_albedo_coarse_directory.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_albedo_coarse_image.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_albedo_fine_directory.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_albedo_fine_image.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_filename.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_input_staging_directory.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_model_state_tile_date_directory.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_output_directory.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/load_prior.py +0 -0
- /ecov003_l2t_stars-1.2.0/ECOv003_L2T_STARS/ECOv003_L2T_STARS.py → /ecov003_l2t_stars-1.3.0/ECOv003_L2T_STARS/main.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/prior.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/process_ECOSTRESS_data_fusion_distributed_bias.jl +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/process_STARS_product.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/retrieve_STARS_sources.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/runconfig.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/timer/__init__.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/timer/timer.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/version.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/version.txt +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS.egg-info/dependency_links.txt +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS.egg-info/top_level.txt +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/LICENSE +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/README.md +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/STARS_memory_profile.jpeg +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/demo.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/example_L2T_STARS_with_download.py +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/mprofile_20241202193217.dat +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/mprofile_20241203112611.dat +0 -0
- {ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/setup.cfg +0 -0
- /ecov003_l2t_stars-1.2.0/tests/test_import_ECOv003_L3T_L4T_JET.py → /ecov003_l2t_stars-1.3.0/tests/test_import_ECOv003_L2T_STARS.py +0 -0
@@ -13,7 +13,7 @@ jobs:
|
|
13
13
|
runs-on: ubuntu-latest
|
14
14
|
strategy:
|
15
15
|
matrix:
|
16
|
-
python-version: ["3.10", "3.11"]
|
16
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
17
17
|
|
18
18
|
steps:
|
19
19
|
- name: Checkout repository
|
@@ -32,3 +32,8 @@ jobs:
|
|
32
32
|
- name: Run tests
|
33
33
|
run: |
|
34
34
|
pytest
|
35
|
+
env:
|
36
|
+
PYTHONPATH: .
|
37
|
+
EARTHDATA_USERNAME: ${{ secrets.EARTHDATA_USERNAME }}
|
38
|
+
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
|
39
|
+
SKIP_EARTHDATA_LOGIN: "true"
|
@@ -259,7 +259,7 @@ def L2T_STARS(
|
|
259
259
|
HLS_connection = HLS2CMR(
|
260
260
|
working_directory=working_directory,
|
261
261
|
download_directory=HLS_download_directory,
|
262
|
-
products_directory=HLS_products_directory,
|
262
|
+
# products_directory=HLS_products_directory,
|
263
263
|
target_resolution=target_resolution,
|
264
264
|
)
|
265
265
|
except CMRServerUnreachable as e:
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/LPDAAC/LPDAACDataPool.py
RENAMED
@@ -1,6 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import netrc
|
2
2
|
import hashlib
|
3
|
-
import json
|
4
3
|
import logging
|
5
4
|
import os
|
6
5
|
import posixpath
|
@@ -11,24 +10,27 @@ from datetime import date
|
|
11
10
|
from fnmatch import fnmatch
|
12
11
|
from http.cookiejar import CookieJar
|
13
12
|
from os import makedirs, remove
|
14
|
-
from os.path import abspath
|
15
13
|
from os.path import dirname
|
16
14
|
from os.path import exists
|
17
15
|
from os.path import getsize
|
18
16
|
from os.path import isdir
|
19
17
|
from os.path import join
|
18
|
+
from os.path import abspath
|
19
|
+
from os.path import expanduser
|
20
20
|
from time import sleep
|
21
21
|
from typing import List, OrderedDict
|
22
|
-
|
22
|
+
|
23
23
|
import requests
|
24
24
|
import xmltodict
|
25
25
|
from bs4 import BeautifulSoup
|
26
26
|
from dateutil import parser
|
27
|
-
from
|
27
|
+
from ..cksum import cksum
|
28
28
|
|
29
29
|
import colored_logging as cl
|
30
30
|
|
31
|
-
|
31
|
+
|
32
|
+
class DownloadFailed(Exception):
|
33
|
+
pass
|
32
34
|
|
33
35
|
CONNECTION_CLOSE = {
|
34
36
|
"Connection": "close",
|
@@ -57,7 +59,7 @@ class LPDAACDataPool:
|
|
57
59
|
DATE_REGEX = re.compile(r'^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$')
|
58
60
|
DEFAULT_REMOTE = DEFAULT_REMOTE
|
59
61
|
|
60
|
-
def __init__(self, username: str = None, password: str = None, remote: str = None, offline_ok: bool =
|
62
|
+
def __init__(self, username: str = None, password: str = None, remote: str = None, offline_ok: bool = True):
|
61
63
|
if remote is None:
|
62
64
|
remote = DEFAULT_REMOTE
|
63
65
|
|
@@ -66,15 +68,14 @@ class LPDAACDataPool:
|
|
66
68
|
netrc_file = netrc.netrc()
|
67
69
|
username, _, password = netrc_file.authenticators("urs.earthdata.nasa.gov")
|
68
70
|
except Exception as e:
|
69
|
-
logger.exception(e)
|
70
71
|
logger.warning("netrc credentials not found for urs.earthdata.nasa.gov")
|
71
72
|
|
72
73
|
if username is None or password is None:
|
73
74
|
if not "LPDAAC_USERNAME" in os.environ or not "LPDAAC_PASSWORD" in os.environ:
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
logger.warning("missing environment variable 'LPDAAC_USERNAME' or 'LPDAAC_PASSWORD'")
|
76
|
+
else:
|
77
|
+
username = os.environ["LPDAAC_USERNAME"]
|
78
|
+
password = os.environ["LPDAAC_PASSWORD"]
|
78
79
|
|
79
80
|
self._remote = remote
|
80
81
|
self._username = username
|
@@ -86,14 +87,15 @@ class LPDAACDataPool:
|
|
86
87
|
|
87
88
|
self._listings = {}
|
88
89
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
90
|
+
if not self.offline_ok:
|
91
|
+
try:
|
92
|
+
self._authenticate()
|
93
|
+
self._check_remote()
|
94
|
+
except Exception as e:
|
95
|
+
if self.offline_ok:
|
96
|
+
logger.warning("unable to connect to LP-DAAC data pool")
|
97
|
+
else:
|
98
|
+
raise e
|
97
99
|
|
98
100
|
def _authenticate(self):
|
99
101
|
try:
|
@@ -128,7 +130,7 @@ class LPDAACDataPool:
|
|
128
130
|
raise ConnectionError(message)
|
129
131
|
|
130
132
|
def _check_remote(self):
|
131
|
-
logger.
|
133
|
+
logger.debug(f"checking URL: {cl.URL(self.remote)}")
|
132
134
|
|
133
135
|
try:
|
134
136
|
response = requests.head(self.remote, headers=CONNECTION_CLOSE)
|
@@ -145,7 +147,7 @@ class LPDAACDataPool:
|
|
145
147
|
raise LPDAACServerUnreachable(message)
|
146
148
|
|
147
149
|
if status == 200:
|
148
|
-
logger.
|
150
|
+
logger.debug(
|
149
151
|
"remote verified with status " + cl.val(200) +
|
150
152
|
" in " + cl.time(f"{duration:0.2f}") +
|
151
153
|
" seconds: " + cl.URL(self.remote))
|
@@ -307,7 +309,7 @@ class LPDAACDataPool:
|
|
307
309
|
else:
|
308
310
|
metadata_filename = f"{download_location}.xml"
|
309
311
|
|
310
|
-
makedirs(dirname(metadata_filename), exist_ok=True)
|
312
|
+
makedirs(abspath(dirname(expanduser(metadata_filename))), exist_ok=True)
|
311
313
|
|
312
314
|
if XML_retries is None:
|
313
315
|
XML_retries = XML_RETRIES
|
@@ -325,8 +327,8 @@ class LPDAACDataPool:
|
|
325
327
|
|
326
328
|
while XML_retries > 0:
|
327
329
|
XML_retries -= 1
|
328
|
-
command = f"wget -nc -c --user {self._username} --password {self._password} -O {metadata_filename} {metadata_URL}"
|
329
|
-
logger.info(command)
|
330
|
+
command = f"wget -nc -c --user {self._username} --password {self._password} -O {abspath(expanduser(metadata_filename))} {metadata_URL}"
|
331
|
+
# logger.info(command)
|
330
332
|
os.system(command)
|
331
333
|
|
332
334
|
if not exists(metadata_filename):
|
@@ -350,12 +352,12 @@ class LPDAACDataPool:
|
|
350
352
|
continue
|
351
353
|
|
352
354
|
try:
|
353
|
-
with open(metadata_filename, "r") as file:
|
355
|
+
with open(abspath(expanduser(metadata_filename)), "r") as file:
|
354
356
|
metadata = xmltodict.parse(file.read())
|
355
357
|
except Exception as e:
|
356
358
|
logger.warning(e)
|
357
359
|
logger.warning(f"unable to parse metadata file: {metadata_filename}")
|
358
|
-
os.remove(metadata_filename)
|
360
|
+
os.remove(abspath(expanduser(metadata_filename)))
|
359
361
|
logger.warning(f"waiting {XML_timeout_seconds} for retry")
|
360
362
|
sleep(XML_timeout_seconds)
|
361
363
|
continue
|
@@ -372,7 +374,7 @@ class LPDAACDataPool:
|
|
372
374
|
|
373
375
|
logger.info(
|
374
376
|
f"metadata retrieved {checksum_type} checksum: {cl.val(remote_checksum)} size: {cl.val(remote_filesize)} URL: {cl.URL(metadata_URL)}")
|
375
|
-
makedirs(dirname(filename), exist_ok=True)
|
377
|
+
makedirs(abspath(dirname(expanduser(filename))), exist_ok=True)
|
376
378
|
logger.info(f"downloading {cl.URL(URL)} -> {cl.file(filename)}")
|
377
379
|
|
378
380
|
# Use a temporary file for downloading
|
@@ -382,8 +384,8 @@ class LPDAACDataPool:
|
|
382
384
|
download_retries -=1
|
383
385
|
|
384
386
|
try:
|
385
|
-
if exists(temporary_filename):
|
386
|
-
temporary_filesize = self.get_local_filesize(temporary_filename)
|
387
|
+
if exists(abspath(expanduser(temporary_filename))):
|
388
|
+
temporary_filesize = self.get_local_filesize(abspath(expanduser(temporary_filename)))
|
387
389
|
|
388
390
|
if temporary_filesize > remote_filesize:
|
389
391
|
logger.warning(
|
@@ -391,11 +393,11 @@ class LPDAACDataPool:
|
|
391
393
|
remove(temporary_filename)
|
392
394
|
|
393
395
|
elif temporary_filesize == remote_filesize:
|
394
|
-
local_checksum = self.get_local_checksum(temporary_filename, checksum_type=checksum_type)
|
396
|
+
local_checksum = self.get_local_checksum(abspath(expanduser(temporary_filename)), checksum_type=checksum_type)
|
395
397
|
|
396
398
|
if local_checksum == remote_checksum:
|
397
399
|
try:
|
398
|
-
shutil.move(temporary_filename, filename)
|
400
|
+
shutil.move(abspath(expanduser(temporary_filename)), abspath(expanduser(filename)))
|
399
401
|
except Exception as e:
|
400
402
|
if exists(filename):
|
401
403
|
logger.warning(f"unable to move temporary file: {temporary_filename}")
|
@@ -408,27 +410,27 @@ class LPDAACDataPool:
|
|
408
410
|
else:
|
409
411
|
logger.warning(
|
410
412
|
f"removing corrupted file with local checksum {local_checksum} and remote checksum {remote_checksum}: {temporary_filename}")
|
411
|
-
remove(temporary_filename)
|
413
|
+
remove(abspath(expanduser(temporary_filename)))
|
412
414
|
else:
|
413
415
|
logger.info(f"resuming incomplete download: {cl.file(temporary_filename)}")
|
414
416
|
|
415
|
-
command = f"wget -nc -c --user {self._username} --password {self._password} -O {temporary_filename} {URL}"
|
416
|
-
logger.info(command)
|
417
|
+
command = f"wget -nc -c --user {self._username} --password {self._password} -O {abspath(expanduser(temporary_filename))} {URL}"
|
418
|
+
# logger.info(command)
|
417
419
|
os.system(command)
|
418
420
|
|
419
|
-
if not exists(temporary_filename):
|
421
|
+
if not exists(abspath(expanduser(temporary_filename))):
|
420
422
|
raise ConnectionError(f"unable to download URL: {URL}")
|
421
423
|
|
422
|
-
local_filesize = self.get_local_filesize(temporary_filename)
|
423
|
-
local_checksum = self.get_local_checksum(temporary_filename, checksum_type=checksum_type)
|
424
|
+
local_filesize = self.get_local_filesize(abspath(expanduser(temporary_filename)))
|
425
|
+
local_checksum = self.get_local_checksum(abspath(expanduser(temporary_filename)), checksum_type=checksum_type)
|
424
426
|
|
425
427
|
if local_filesize != remote_filesize or local_checksum != remote_checksum:
|
426
|
-
os.remove(temporary_filename)
|
428
|
+
os.remove(abspath(expanduser(temporary_filename)))
|
427
429
|
raise ConnectionError(
|
428
430
|
f"removing corrupted file with local filesize {local_filesize} remote filesize {remote_filesize} local checksum {local_checksum} remote checksum {remote_checksum}: {temporary_filename}")
|
429
431
|
|
430
432
|
# Download successful, rename the temporary file to its proper name
|
431
|
-
shutil.move(temporary_filename, filename)
|
433
|
+
shutil.move(abspath(expanduser(temporary_filename)), abspath(expanduser(filename)))
|
432
434
|
|
433
435
|
logger.info(
|
434
436
|
f"successful download with filesize {cl.val(local_filesize)} checksum {cl.val(local_checksum)}: {cl.file(filename)}")
|
@@ -24,10 +24,11 @@ from modland import generate_modland_grid
|
|
24
24
|
|
25
25
|
from ECOv003_exit_codes import *
|
26
26
|
|
27
|
+
from ..login import login
|
27
28
|
from ..daterange import get_date
|
28
29
|
from ..LPDAAC.LPDAACDataPool import RETRIES
|
29
30
|
from .VIIRSDataPool import VIIRSGranule
|
30
|
-
from
|
31
|
+
from ..exceptions import *
|
31
32
|
|
32
33
|
NDVI_COLORMAP = LinearSegmentedColormap.from_list(
|
33
34
|
name="NDVI",
|
@@ -1122,7 +1123,7 @@ class VNP09GA:
|
|
1122
1123
|
self.products_directory = products_directory
|
1123
1124
|
self.mosaic_directory = mosaic_directory
|
1124
1125
|
|
1125
|
-
self.auth =
|
1126
|
+
self.auth = login()
|
1126
1127
|
|
1127
1128
|
def add_granules(self, granules: List[earthaccess.search.DataGranule]):
|
1128
1129
|
data = pd.DataFrame([
|
@@ -0,0 +1,66 @@
|
|
1
|
+
"""
|
2
|
+
Pure Python implementation of POSIX cksum algorithm.
|
3
|
+
|
4
|
+
This module provides a replacement for the pycksum package that is compatible
|
5
|
+
with Python 3.12 and later versions.
|
6
|
+
"""
|
7
|
+
|
8
|
+
|
9
|
+
def cksum(data_or_file):
|
10
|
+
"""
|
11
|
+
Calculate POSIX cksum checksum for data or file-like object.
|
12
|
+
|
13
|
+
Args:
|
14
|
+
data_or_file: Either bytes data or a file-like object opened in binary mode
|
15
|
+
|
16
|
+
Returns:
|
17
|
+
int: The POSIX cksum checksum value
|
18
|
+
"""
|
19
|
+
# Handle file-like objects
|
20
|
+
if hasattr(data_or_file, 'read'):
|
21
|
+
data = data_or_file.read()
|
22
|
+
else:
|
23
|
+
data = data_or_file
|
24
|
+
|
25
|
+
# Ensure we have bytes
|
26
|
+
if isinstance(data, str):
|
27
|
+
data = data.encode('utf-8')
|
28
|
+
|
29
|
+
# Initialize CRC with 0
|
30
|
+
crc = 0
|
31
|
+
|
32
|
+
# Process each byte of data
|
33
|
+
for byte in data:
|
34
|
+
# XOR the byte with the current CRC (shifted left 8 bits)
|
35
|
+
crc ^= byte << 24
|
36
|
+
|
37
|
+
# Process 8 bits
|
38
|
+
for _ in range(8):
|
39
|
+
if crc & 0x80000000: # If MSB is set
|
40
|
+
crc = (crc << 1) ^ 0x04c11db7 # CRC-32 polynomial
|
41
|
+
else:
|
42
|
+
crc = crc << 1
|
43
|
+
crc &= 0xffffffff # Keep it 32-bit
|
44
|
+
|
45
|
+
# Append the length in bytes as a big-endian value
|
46
|
+
length = len(data)
|
47
|
+
length_bytes = []
|
48
|
+
while length > 0:
|
49
|
+
length_bytes.insert(0, length & 0xff)
|
50
|
+
length >>= 8
|
51
|
+
|
52
|
+
# Process the length bytes
|
53
|
+
for byte in length_bytes:
|
54
|
+
crc ^= byte << 24
|
55
|
+
for _ in range(8):
|
56
|
+
if crc & 0x80000000:
|
57
|
+
crc = (crc << 1) ^ 0x04c11db7
|
58
|
+
else:
|
59
|
+
crc = crc << 1
|
60
|
+
crc &= 0xffffffff
|
61
|
+
|
62
|
+
# Final XOR and return as signed 32-bit integer equivalent
|
63
|
+
result = crc ^ 0xffffffff
|
64
|
+
|
65
|
+
# Convert to match expected return type (unsigned 32-bit integer)
|
66
|
+
return result
|
@@ -3,11 +3,11 @@ import logging
|
|
3
3
|
|
4
4
|
logger = logging.getLogger(__name__)
|
5
5
|
|
6
|
-
def
|
7
|
-
github_URL: str = "https://github.com/STARS-Data-Fusion/
|
6
|
+
def install_STARSDataFusion_jl(
|
7
|
+
github_URL: str = "https://github.com/STARS-Data-Fusion/STARSDataFusion.jl",
|
8
8
|
environment_name: str = "@ECOv003-L2T-STARS") -> subprocess.CompletedProcess:
|
9
9
|
"""
|
10
|
-
Installs the
|
10
|
+
Installs the STARSDataFusion.jl Julia package from GitHub into a specified Julia environment.
|
11
11
|
|
12
12
|
This function executes a Julia command to activate a given environment and
|
13
13
|
then develops (installs in editable mode) the STARS.jl package from its
|
@@ -35,7 +35,7 @@ def install_STARS_jl(
|
|
35
35
|
|
36
36
|
if result.returncode == 0:
|
37
37
|
logger.info(
|
38
|
-
f"
|
38
|
+
f"STARSDataFusion.jl installed successfully in environment '{environment_name}'!"
|
39
39
|
)
|
40
40
|
else:
|
41
41
|
logger.error("Error installing STARS.jl:")
|
@@ -3,11 +3,11 @@ import logging
|
|
3
3
|
|
4
4
|
logger = logging.getLogger(__name__)
|
5
5
|
|
6
|
-
def
|
6
|
+
def instantiate_STARSDataFusion_jl(package_location: str) -> subprocess.CompletedProcess:
|
7
7
|
"""
|
8
8
|
Activates a Julia project at a given location and instantiates its dependencies.
|
9
9
|
|
10
|
-
This is necessary to ensure all required Julia packages for
|
10
|
+
This is necessary to ensure all required Julia packages for STARSDataFusion.jl are
|
11
11
|
downloaded and ready for use within the specified project environment.
|
12
12
|
|
13
13
|
Args:
|
@@ -30,7 +30,7 @@ def instantiate_STARS_jl(package_location: str) -> subprocess.CompletedProcess:
|
|
30
30
|
|
31
31
|
if result.returncode == 0:
|
32
32
|
logger.info(
|
33
|
-
f"
|
33
|
+
f"STARSDataFusion.jl instantiated successfully in directory '{package_location}'!"
|
34
34
|
)
|
35
35
|
else:
|
36
36
|
logger.error("Error instantiating STARS.jl:")
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import logging
|
2
|
+
import netrc
|
3
|
+
import os
|
4
|
+
|
5
|
+
import earthaccess
|
6
|
+
|
7
|
+
from .exceptions import *
|
8
|
+
|
9
|
+
__author__ = "Evan Davis"
|
10
|
+
|
11
|
+
_AUTH = None
|
12
|
+
|
13
|
+
def login() -> earthaccess.Auth:
|
14
|
+
"""
|
15
|
+
Login to Earthdata using environment variables if available, falling back to netrc credentials, then interactive login.
|
16
|
+
"""
|
17
|
+
# Only login to earthaccess once
|
18
|
+
global _AUTH
|
19
|
+
if _AUTH is not None:
|
20
|
+
return _AUTH
|
21
|
+
|
22
|
+
# Check if we're in a testing environment where authentication should be skipped
|
23
|
+
if os.environ.get("SKIP_EARTHDATA_LOGIN", "").lower() in ("true", "1", "yes"):
|
24
|
+
# Return a mock auth object for testing
|
25
|
+
class MockAuth:
|
26
|
+
def __init__(self):
|
27
|
+
self.authenticated = True
|
28
|
+
_AUTH = MockAuth()
|
29
|
+
return _AUTH
|
30
|
+
|
31
|
+
# Temporarily suppress INFO logs from earthaccess during login
|
32
|
+
earthaccess_logger = logging.getLogger('earthaccess')
|
33
|
+
original_level = earthaccess_logger.level
|
34
|
+
earthaccess_logger.setLevel(logging.WARNING)
|
35
|
+
|
36
|
+
try:
|
37
|
+
# First priority: environment variables
|
38
|
+
if "EARTHDATA_USERNAME" in os.environ and "EARTHDATA_PASSWORD" in os.environ:
|
39
|
+
_AUTH = earthaccess.login(strategy="environment")
|
40
|
+
return _AUTH
|
41
|
+
|
42
|
+
# Second priority: netrc credentials
|
43
|
+
try:
|
44
|
+
secrets = netrc.netrc()
|
45
|
+
auth = secrets.authenticators("urs.earthdata.nasa.gov")
|
46
|
+
if auth:
|
47
|
+
_AUTH = earthaccess.login(strategy="netrc")
|
48
|
+
return _AUTH
|
49
|
+
except (FileNotFoundError, netrc.NetrcParseError):
|
50
|
+
# .netrc file doesn't exist or is malformed, continue to interactive login
|
51
|
+
pass
|
52
|
+
|
53
|
+
# Last resort: interactive login
|
54
|
+
_AUTH = earthaccess.login(strategy="interactive")
|
55
|
+
return _AUTH
|
56
|
+
|
57
|
+
except Exception as e:
|
58
|
+
raise CMRServerUnreachable(e)
|
59
|
+
finally:
|
60
|
+
# Restore original logging level
|
61
|
+
earthaccess_logger.setLevel(original_level)
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/process_julia_data_fusion.py
RENAMED
@@ -4,7 +4,7 @@ from datetime import date
|
|
4
4
|
from os.path import abspath, dirname, join, exists
|
5
5
|
import logging
|
6
6
|
|
7
|
-
from .
|
7
|
+
from .instantiate_STARSDataFusion_jl import instantiate_STARSDataFusion_jl
|
8
8
|
|
9
9
|
logger = logging.getLogger(__name__)
|
10
10
|
|
@@ -71,7 +71,7 @@ def process_julia_data_fusion(
|
|
71
71
|
STARS_source_directory = abspath(dirname(__file__))
|
72
72
|
|
73
73
|
# Instantiate Julia dependencies
|
74
|
-
|
74
|
+
instantiate_STARSDataFusion_jl(STARS_source_directory)
|
75
75
|
|
76
76
|
# Base Julia command with required arguments
|
77
77
|
command = (
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ECOv003-L2T-STARS
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.3.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
|
@@ -21,7 +21,6 @@ Requires-Dist: matplotlib
|
|
21
21
|
Requires-Dist: modland
|
22
22
|
Requires-Dist: numpy
|
23
23
|
Requires-Dist: pandas
|
24
|
-
Requires-Dist: pycksum
|
25
24
|
Requires-Dist: pytictoc
|
26
25
|
Requires-Dist: rasters
|
27
26
|
Requires-Dist: scikit-image
|
@@ -15,7 +15,6 @@ pyproject.toml
|
|
15
15
|
.github/workflows/python-publish.yml
|
16
16
|
ECOv003_L2T_STARS/ECOv003_DL.py
|
17
17
|
ECOv003_L2T_STARS/ECOv003_DL.xml
|
18
|
-
ECOv003_L2T_STARS/ECOv003_L2T_STARS.py
|
19
18
|
ECOv003_L2T_STARS/ECOv003_L2T_STARS.xml
|
20
19
|
ECOv003_L2T_STARS/L2TSTARSConfig.py
|
21
20
|
ECOv003_L2T_STARS/L2T_STARS.py
|
@@ -23,7 +22,9 @@ ECOv003_L2T_STARS/Manifest.toml
|
|
23
22
|
ECOv003_L2T_STARS/Project.toml
|
24
23
|
ECOv003_L2T_STARS/__init__.py
|
25
24
|
ECOv003_L2T_STARS/calibrate_fine_to_coarse.py
|
25
|
+
ECOv003_L2T_STARS/cksum.py
|
26
26
|
ECOv003_L2T_STARS/constants.py
|
27
|
+
ECOv003_L2T_STARS/exceptions.py
|
27
28
|
ECOv003_L2T_STARS/generate_L2T_STARS_runconfig.py
|
28
29
|
ECOv003_L2T_STARS/generate_NDVI_coarse_directory.py
|
29
30
|
ECOv003_L2T_STARS/generate_NDVI_coarse_image.py
|
@@ -38,9 +39,11 @@ ECOv003_L2T_STARS/generate_filename.py
|
|
38
39
|
ECOv003_L2T_STARS/generate_input_staging_directory.py
|
39
40
|
ECOv003_L2T_STARS/generate_model_state_tile_date_directory.py
|
40
41
|
ECOv003_L2T_STARS/generate_output_directory.py
|
41
|
-
ECOv003_L2T_STARS/
|
42
|
-
ECOv003_L2T_STARS/
|
42
|
+
ECOv003_L2T_STARS/install_STARSDataFusion_jl.py
|
43
|
+
ECOv003_L2T_STARS/instantiate_STARSDataFusion_jl.py
|
43
44
|
ECOv003_L2T_STARS/load_prior.py
|
45
|
+
ECOv003_L2T_STARS/login.py
|
46
|
+
ECOv003_L2T_STARS/main.py
|
44
47
|
ECOv003_L2T_STARS/prior.py
|
45
48
|
ECOv003_L2T_STARS/process_ECOSTRESS_data_fusion_distributed_bias.jl
|
46
49
|
ECOv003_L2T_STARS/process_STARS_product.py
|
@@ -65,7 +68,6 @@ ECOv003_L2T_STARS/LPDAAC/__init__.py
|
|
65
68
|
ECOv003_L2T_STARS/LPDAAC/version.txt
|
66
69
|
ECOv003_L2T_STARS/VIIRS/VIIRSDataPool.py
|
67
70
|
ECOv003_L2T_STARS/VIIRS/VIIRSDownloader.py
|
68
|
-
ECOv003_L2T_STARS/VIIRS/VIIRS_CMR_LOGIN.py
|
69
71
|
ECOv003_L2T_STARS/VIIRS/VNP09GA.py
|
70
72
|
ECOv003_L2T_STARS/VIIRS/VNP43IA4.py
|
71
73
|
ECOv003_L2T_STARS/VIIRS/VNP43MA3.py
|
@@ -86,5 +88,5 @@ ECOv003_L2T_STARS/daterange/__init__.py
|
|
86
88
|
ECOv003_L2T_STARS/daterange/daterange.py
|
87
89
|
ECOv003_L2T_STARS/timer/__init__.py
|
88
90
|
ECOv003_L2T_STARS/timer/timer.py
|
89
|
-
tests/
|
91
|
+
tests/test_import_ECOv003_L2T_STARS.py
|
90
92
|
tests/test_import_dependencies.py
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ECOv003-L2T-STARS
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.3.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
|
@@ -21,7 +21,6 @@ Requires-Dist: matplotlib
|
|
21
21
|
Requires-Dist: modland
|
22
22
|
Requires-Dist: numpy
|
23
23
|
Requires-Dist: pandas
|
24
|
-
Requires-Dist: pycksum
|
25
24
|
Requires-Dist: pytictoc
|
26
25
|
Requires-Dist: rasters
|
27
26
|
Requires-Dist: scikit-image
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# Define package and environment variables
|
2
|
+
PACKAGE_NAME = ECOv003-L2T-STARS
|
3
|
+
ENVIRONMENT_NAME = $(PACKAGE_NAME)
|
4
|
+
DOCKER_IMAGE_NAME = $(shell echo $(PACKAGE_NAME) | tr '[:upper:]' '[:lower:]')
|
5
|
+
|
6
|
+
.PHONY: clean test build twine-upload dist install-package install uninstall reinstall environment remove-environment install-julia colima-start docker-build docker-build-environment docker-build-installation docker-interactive docker-remove
|
7
|
+
|
8
|
+
# --- Cleaning and Maintenance ---
|
9
|
+
|
10
|
+
clean:
|
11
|
+
@echo "Cleaning up build artifacts..."
|
12
|
+
rm -rf *.o *.out *.log
|
13
|
+
rm -rf build/
|
14
|
+
rm -rf dist/
|
15
|
+
rm -rf *.egg-info
|
16
|
+
rm -rf .pytest_cache
|
17
|
+
find . -type d -name "__pycache__" -exec rm -rf {} +
|
18
|
+
|
19
|
+
# --- Testing ---
|
20
|
+
|
21
|
+
test:
|
22
|
+
@echo "Running tests..."
|
23
|
+
PYTHONPATH=. pytest
|
24
|
+
|
25
|
+
# --- Package Management ---
|
26
|
+
|
27
|
+
build:
|
28
|
+
@echo "Building package..."
|
29
|
+
python -m build
|
30
|
+
|
31
|
+
twine-upload:
|
32
|
+
@echo "Uploading package to PyPI..."
|
33
|
+
twine upload dist/*
|
34
|
+
|
35
|
+
dist: clean build twine-upload
|
36
|
+
@echo "Distribution process complete."
|
37
|
+
|
38
|
+
install-package:
|
39
|
+
@echo "Installing package in development mode..."
|
40
|
+
pip install -e .[dev]
|
41
|
+
|
42
|
+
install: install-julia install-package
|
43
|
+
@echo "All installations complete."
|
44
|
+
|
45
|
+
uninstall:
|
46
|
+
@echo "Uninstalling $(PACKAGE_NAME)..."
|
47
|
+
pip uninstall $(PACKAGE_NAME)
|
48
|
+
|
49
|
+
reinstall: uninstall install
|
50
|
+
@echo "Package reinstalled."
|
51
|
+
|
52
|
+
# --- Environment Management ---
|
53
|
+
|
54
|
+
environment:
|
55
|
+
@echo "Creating mamba environment: $(ENVIRONMENT_NAME)..."
|
56
|
+
mamba create -y -n $(ENVIRONMENT_NAME) -c conda-forge python=3.11
|
57
|
+
|
58
|
+
remove-environment:
|
59
|
+
@echo "Removing mamba environment: $(ENVIRONMENT_NAME)..."
|
60
|
+
mamba env remove -y -n $(ENVIRONMENT_NAME)
|
61
|
+
|
62
|
+
install-julia:
|
63
|
+
@echo "Installing Julia packages..."
|
64
|
+
julia -e 'using Pkg; Pkg.add.(["Glob", "DimensionalData", "HTTP", "JSON", "ArchGDAL", "Rasters", "STARSDataFusion"]); Pkg.develop(path="ECOv003_L2T_STARS/VNP43NRT_jl")'
|
65
|
+
|
66
|
+
# --- Docker & Colima ---
|
67
|
+
|
68
|
+
colima-start:
|
69
|
+
@echo "Starting Colima..."
|
70
|
+
colima start -m 16 -a x86_64 -d 100
|
71
|
+
|
72
|
+
docker-build:
|
73
|
+
@echo "Building Docker image: $(DOCKER_IMAGE_NAME):latest..."
|
74
|
+
docker build -t $(DOCKER_IMAGE_NAME):latest .
|
75
|
+
|
76
|
+
docker-build-environment:
|
77
|
+
@echo "Building Docker environment target..."
|
78
|
+
docker build --target environment -t $(DOCKER_IMAGE_NAME):latest .
|
79
|
+
|
80
|
+
docker-build-installation:
|
81
|
+
@echo "Building Docker installation target..."
|
82
|
+
docker build --target installation -t $(DOCKER_IMAGE_NAME):latest .
|
83
|
+
|
84
|
+
docker-interactive:
|
85
|
+
@echo "Starting interactive Docker session..."
|
86
|
+
docker run -it $(DOCKER_IMAGE_NAME) fish
|
87
|
+
|
88
|
+
docker-remove:
|
89
|
+
@echo "Removing Docker image: $(DOCKER_IMAGE_NAME)..."
|
90
|
+
docker rmi -f $(DOCKER_IMAGE_NAME)
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "ECOv003-L2T-STARS"
|
7
|
-
version = "1.
|
7
|
+
version = "1.3.0"
|
8
8
|
description = "ECOSTRESS Collection 3 JPL STARS Data Fusion Product Generating Executable (PGE)"
|
9
9
|
readme = "README.md"
|
10
10
|
authors = [
|
@@ -27,7 +27,6 @@ dependencies = [
|
|
27
27
|
"modland",
|
28
28
|
"numpy",
|
29
29
|
"pandas",
|
30
|
-
"pycksum",
|
31
30
|
"pytictoc",
|
32
31
|
"rasters",
|
33
32
|
"scikit-image",
|
@@ -61,5 +60,5 @@ include = ["ECOv003_L2T_STARS"]
|
|
61
60
|
exclude = []
|
62
61
|
|
63
62
|
[project.scripts]
|
64
|
-
ECOv003-L2T-STARS = "ECOv003_L2T_STARS.
|
63
|
+
ECOv003-L2T-STARS = "ECOv003_L2T_STARS.main:main"
|
65
64
|
ECOv003-DL = "ECOv003_DL.ECOv003_DL:main"
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import netrc
|
2
|
-
import os
|
3
|
-
|
4
|
-
import earthaccess
|
5
|
-
|
6
|
-
_AUTH = None
|
7
|
-
|
8
|
-
class CMRServerUnreachable(Exception):
|
9
|
-
pass
|
10
|
-
|
11
|
-
def VIIRS_CMR_login() -> earthaccess.Auth:
|
12
|
-
"""
|
13
|
-
Login to Earthdata using netrc credentials if available, falling back to environment variables.
|
14
|
-
"""
|
15
|
-
# Only login to earthaccess once
|
16
|
-
global _AUTH
|
17
|
-
if _AUTH is not None:
|
18
|
-
return _AUTH
|
19
|
-
|
20
|
-
try:
|
21
|
-
# Attempt to use netrc for credentials
|
22
|
-
secrets = netrc.netrc()
|
23
|
-
auth = secrets.authenticators("urs.earthdata.nasa.gov")
|
24
|
-
if auth:
|
25
|
-
_AUTH = earthaccess.login(strategy="netrc") # Use strategy="netrc"
|
26
|
-
return _AUTH
|
27
|
-
|
28
|
-
# Fallback to environment variables if netrc fails
|
29
|
-
if "EARTHDATA_USERNAME" in os.environ and "EARTHDATA_PASSWORD" in os.environ:
|
30
|
-
_AUTH = earthaccess.login(strategy="environment")
|
31
|
-
return _AUTH
|
32
|
-
else:
|
33
|
-
raise CMRServerUnreachable("Missing netrc credentials or environment variables 'EARTHDATA_USERNAME' and 'EARTHDATA_PASSWORD'")
|
34
|
-
|
35
|
-
except Exception as e:
|
36
|
-
raise CMRServerUnreachable(e)
|
ecov003_l2t_stars-1.2.0/makefile
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
PACKAGE_NAME = ECOv003-L2T-STARS
|
2
|
-
ENVIRONMENT_NAME = $(PACKAGE_NAME)
|
3
|
-
DOCKER_IMAGE_NAME = $(shell echo $(PACKAGE_NAME) | tr '[:upper:]' '[:lower:]')
|
4
|
-
|
5
|
-
clean:
|
6
|
-
rm -rf *.o *.out *.log
|
7
|
-
rm -rf build/
|
8
|
-
rm -rf dist/
|
9
|
-
rm -rf *.egg-info
|
10
|
-
rm -rf .pytest_cache
|
11
|
-
find . -type d -name "__pycache__" -exec rm -rf {} +
|
12
|
-
|
13
|
-
test:
|
14
|
-
pytest
|
15
|
-
|
16
|
-
build:
|
17
|
-
python -m build
|
18
|
-
|
19
|
-
twine-upload:
|
20
|
-
twine upload dist/*
|
21
|
-
|
22
|
-
dist:
|
23
|
-
make clean
|
24
|
-
make build
|
25
|
-
make twine-upload
|
26
|
-
|
27
|
-
install-package:
|
28
|
-
pip install -e .[dev]
|
29
|
-
|
30
|
-
install:
|
31
|
-
make install-julia
|
32
|
-
make install-package
|
33
|
-
|
34
|
-
uninstall:
|
35
|
-
pip uninstall $(PACKAGE_NAME)
|
36
|
-
|
37
|
-
reinstall:
|
38
|
-
make uninstall
|
39
|
-
make install
|
40
|
-
|
41
|
-
environment:
|
42
|
-
mamba create -y -n $(ENVIRONMENT_NAME) -c conda-forge python=3.11
|
43
|
-
|
44
|
-
remove-environment:
|
45
|
-
mamba env remove -y -n $(ENVIRONMENT_NAME)
|
46
|
-
|
47
|
-
install-julia:
|
48
|
-
julia -e 'using Pkg; Pkg.add.(["Glob", "DimensionalData", "HTTP", "JSON", "ArchGDAL", "Rasters", "STARSDataFusion"]); Pkg.develop(path="ECOv003_L2T_STARS/VNP43NRT_jl")'
|
49
|
-
|
50
|
-
colima-start:
|
51
|
-
colima start -m 16 -a x86_64 -d 100
|
52
|
-
|
53
|
-
docker-build:
|
54
|
-
docker build -t $(DOCKER_IMAGE_NAME):latest .
|
55
|
-
|
56
|
-
docker-build-environment:
|
57
|
-
docker build --target environment -t $(DOCKER_IMAGE_NAME):latest .
|
58
|
-
|
59
|
-
docker-build-installation:
|
60
|
-
docker build --target installation -t $(DOCKER_IMAGE_NAME):latest .
|
61
|
-
|
62
|
-
docker-interactive:
|
63
|
-
docker run -it $(DOCKER_IMAGE_NAME) fish
|
64
|
-
|
65
|
-
docker-remove:
|
66
|
-
docker rmi -f $(DOCKER_IMAGE_NAME)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/VIIRSDataPool.py
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VIIRS/VIIRSDownloader.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT/process_VNP43NRT.jl
RENAMED
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/Manifest.toml
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/Project.toml
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/__init__.py
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/instantiate.jl
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/instantiate.py
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/src/VNP43NRT.jl
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/VNP43NRT_jl/src/__init__.py
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/calibrate_fine_to_coarse.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/daterange/daterange.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_NDVI_coarse_image.py
RENAMED
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_NDVI_fine_image.py
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_STARS_inputs.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_albedo_fine_image.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/generate_output_directory.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/process_STARS_product.py
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS/retrieve_STARS_sources.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS.egg-info/dependency_links.txt
RENAMED
File without changes
|
{ecov003_l2t_stars-1.2.0 → ecov003_l2t_stars-1.3.0}/ECOv003_L2T_STARS.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|