Skip to content

Commit ed172a1

Browse files
Add license terms for cache API
1 parent fb85886 commit ed172a1

4 files changed

Lines changed: 50 additions & 20 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ The previous-generation [PyGMTSAR](https://github.com/AlexeyPechnikov/pygmtsar)
1717

1818
For funded academic, institutional, or professional use of the insardev package, see [insardev/SUBSCRIBE](https://github.com/AlexeyPechnikov/InSARdev/blob/main/insardev/SUBSCRIBE). The BSD-licensed insardev_pygmtsar and insardev_toolkit do not require subscription.
1919

20+
## API Services
21+
22+
The Cache APIs at insar.dev provide fast access to Sentinel-1 data via NASA ASF and Copernicus, and NASA NISAR data. Free for non-commercial use; license required for funded academic, institutional, or professional use. See [insardev/LICENSE](./insardev/LICENSE) for terms.
23+
2024
## Features
2125

2226
- **Per-burst/swath processing** — each Sentinel-1 TOPS burst and NISAR swaths processed independently on a geocoded grid, no frame stitching required

insardev/LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,23 @@ Not permitted without written permission:
235235
- Commercial redistribution
236236

237237
Contact: alexey@pechnikov.dev
238+
239+
---
240+
241+
API SERVICES
242+
243+
The Cache APIs at insar.dev (Sentinel-1 via NASA ASF and Copernicus, and NASA
244+
NISAR) are subject to the same licensing terms as the insardev library.
245+
246+
Free for non-commercial use:
247+
- Personal learning and self-education
248+
- Unfunded academic coursework, thesis, or dissertation work
249+
- Hobby projects with no commercial intent
250+
- Teaching and classroom instruction
251+
252+
License required for funded academic, institutional, or professional use:
253+
- Grant-funded, institutional, or government-funded research
254+
- Business, consulting, or professional services
255+
- Corporate or organizational projects
256+
257+
For licensing, contact: alexey@pechnikov.dev

insardev_toolkit/insardev_toolkit/ASF.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ def __init__(self, username=None, password=None):
237237
"""
238238
self.username = username
239239
self.password = password
240+
if username is None:
241+
print("NOTE: Using insar.dev Cache API. Free for non-commercial use; license required for funded academic, institutional, or professional use.")
240242

241243
def _get_asf_session(self):
242244
"""Get authenticated session for ASF downloads.
@@ -414,11 +416,11 @@ def download(self, basedir, bursts, polarization=None, frequency=None, bbox=None
414416
- None: S1 uses pol from name, NISAR downloads all available
415417
- 'VV': Download only VV (S1) or 'HH' (NISAR)
416418
- ['VV', 'VH']: Download both polarizations
417-
frequency : str, required for NISAR
418-
Which frequency band to download (NISAR stores two frequencies with different resolutions):
419-
- 'A': frequencyA (20MHz bandwidth, ~7m range resolution, primary InSAR)
420-
- 'B': frequencyB (5MHz bandwidth, ~25m range resolution, 4x less data)
421-
To download both frequencies, call download() twice with different output directories.
419+
frequency : str or list, required for NISAR
420+
Which frequency band(s) to download (NISAR stores two frequencies with different resolutions):
421+
- 'A': frequencyA (20MHz bandwidth, ~7m range resolution, ~10GB per scene)
422+
- 'B': frequencyB (5MHz bandwidth, ~25m range resolution, ~1.5GB per scene)
423+
- ['A', 'B']: Both frequencies in same file (~14GB per scene)
422424
bbox : tuple or None, optional (NISAR cache proxy only)
423425
Bounding box in WGS84 coordinates: (west, south, east, north).
424426
When provided, only downloads aligned blocks covering the bbox.
@@ -480,10 +482,10 @@ def download(self, basedir, bursts, polarization=None, frequency=None, bbox=None
480482
# Require explicit frequency for NISAR to prevent accidental large downloads
481483
if nisar_granules and frequency is None:
482484
raise ValueError(
483-
"NISAR data requires explicit frequency='A' or 'B' parameter.\n"
484-
" frequency='A': 20MHz bandwidth (~7m range resolution, primary InSAR)\n"
485-
" frequency='B': 5MHz bandwidth (~25m range resolution, 4x smaller)\n"
486-
"To download both frequencies, run download() twice with different output directories."
485+
"NISAR data requires explicit frequency parameter:\n"
486+
" frequency='B': 5MHz bandwidth (~25m res, ~1.5GB) - recommended for quick look\n"
487+
" frequency='A': 20MHz bandwidth (~7m res, ~10GB) - full resolution InSAR\n"
488+
" frequency=['A','B']: Both frequencies in same file (~14GB)"
487489
)
488490

489491
# Check if any downloads needed BEFORE creating session (avoid network call)
@@ -1529,14 +1531,13 @@ def download_nisar_granule(granule_id, basedir, polarizations, skip_exist, debug
15291531
print(f"WARNING: Polarizations {missing} not available in {granule_id}")
15301532

15311533
# Update frequency download flags based on actual availability
1532-
download_freq_a = frequency is None or frequency == 'A'
1533-
download_freq_b = (frequency is None or frequency == 'B') and has_freq_b
1534+
# Normalize frequency to list for consistent checking
1535+
freq_list = [frequency] if isinstance(frequency, str) else frequency
1536+
download_freq_a = 'A' in freq_list
1537+
download_freq_b = 'B' in freq_list and has_freq_b
15341538

15351539
if debug and position is None:
1536-
if frequency is None:
1537-
freq_str = 'A+B' if has_freq_b else 'A'
1538-
else:
1539-
freq_str = frequency
1540+
freq_str = '+'.join(f for f in freq_list if f == 'A' or (f == 'B' and has_freq_b))
15401541
print(f"NISAR {track}_{frame}: downloading {pols_to_download} (frequency{freq_str})")
15411542

15421543
if layout != 'A':
@@ -2332,9 +2333,10 @@ def download_granule_via_cache(granule_id, position=None, shared_pbar=None, shar
23322333
if missing:
23332334
print(f"WARNING: Polarizations {missing} not available")
23342335

2335-
# Frequency flags
2336-
download_freq_a = frequency is None or frequency == 'A'
2337-
download_freq_b = (frequency is None or frequency == 'B') and has_freq_b
2336+
# Frequency flags - normalize to list for consistent checking
2337+
freq_list = [frequency] if isinstance(frequency, str) else frequency
2338+
download_freq_a = 'A' in freq_list
2339+
download_freq_b = 'B' in freq_list and has_freq_b
23382340

23392341
# Get chunk info for all pols
23402342
all_chunk_info = {}
@@ -2527,8 +2529,10 @@ def download_single_chunk(gid, offset, length):
25272529
pols = [p for p in (polarizations or avail_pols) if p in avail_pols]
25282530
has_freq_b = 'frequencyB' in swaths
25292531
freq_b_pols = [k for k in swaths['frequencyB'].keys() if k in ['HH','HV','VH','VV']] if has_freq_b else []
2530-
dl_a = frequency is None or frequency == 'A'
2531-
dl_b = (frequency is None or frequency == 'B') and has_freq_b
2532+
# Normalize frequency to list for consistent checking
2533+
freq_list = [frequency] if isinstance(frequency, str) else frequency
2534+
dl_a = 'A' in freq_list
2535+
dl_b = 'B' in freq_list and has_freq_b
25322536

25332537
# Pre-collect chunk info for all pols while h5 is open
25342538
all_chunk_info = {}

insardev_toolkit/insardev_toolkit/CDSE.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ def __init__(self, username=None, password=None):
324324
self.password = password
325325
self._session = None
326326
self._token_time = None
327+
if username is None:
328+
print("NOTE: Using insar.dev Cache API. Free for non-commercial use; license required for funded academic, institutional, or professional use.")
327329

328330
@staticmethod
329331
def _normalize_polarization(polarization):

0 commit comments

Comments
 (0)