Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
12ec61e
try not to use time data unless temproally subsetting (#386)
sliu008 Mar 3, 2026
ee8a340
update readme (#387)
sliu008 Mar 3, 2026
e8b2eaa
/version 3.3.0a6
Mar 3, 2026
54584cf
Merge branch 'main' into develop
jamesfwood Mar 3, 2026
b959d96
/version 3.4.0a1
Mar 3, 2026
7ebcce7
Feature/fix cygnss collections (#389)
sliu008 Mar 10, 2026
1e651bb
/version 3.4.0a2
Mar 10, 2026
675ad8d
Release 3.3.1
jamesfwood Mar 10, 2026
f9621a1
/version 3.4.0a0
Mar 10, 2026
605baf9
/version 3.3.1rc1
Mar 10, 2026
abf7349
Add automatic team/project assignment workflow
tloubrieu-jpl Mar 14, 2026
5d37721
Add automatic team/project assignment workflow
tloubrieu-jpl Mar 14, 2026
d4f700e
remove print and update checking solar time
sliu008 Mar 17, 2026
7ec05c0
poetry update
sliu008 Mar 17, 2026
e8b4ae8
/version 3.3.1rc2
Mar 17, 2026
42e7826
Update versions
jamesfwood Mar 19, 2026
62e213a
/version 3.3.1rc3
Mar 19, 2026
9e9ae1d
Fix/hdf handling (#395)
ocsmit Mar 31, 2026
eaf39b9
chore(pylint): resolve pylint errors that surfaced on build (#410)
ocsmit Mar 31, 2026
ba46ff6
chore(flake8) (#411)
ocsmit Mar 31, 2026
4fe6e17
poetry update (#412)
sliu008 Mar 31, 2026
868ae01
/version 3.4.0a1
Mar 31, 2026
44e2e70
fix develop version
sliu008 Mar 31, 2026
c658559
/version 3.4.0a3
Mar 31, 2026
4a67c05
merge develop
sliu008 Mar 31, 2026
6f94837
/version 3.3.1rc4
Mar 31, 2026
9cd2dc9
Resolve dimension name recovery for multiple swaths with same dim nam…
ocsmit Apr 2, 2026
38c3821
/version 3.4.0a4
Apr 2, 2026
d08413c
Handle NetCDF with ScanTime swath group (#414)
ocsmit Apr 3, 2026
bb4d36b
/version 3.4.0a5
Apr 3, 2026
5bac343
trigger build
sliu008 Apr 3, 2026
7d6c838
/version 3.4.0a6
Apr 3, 2026
5506795
merge develop
sliu008 Apr 3, 2026
45eb4f4
/version 3.3.1rc5
Apr 3, 2026
617985c
trigger build
sliu008 Apr 7, 2026
139b878
/version 3.3.1rc6
Apr 7, 2026
e7cda23
Issue/400 (#415)
sliu008 Apr 7, 2026
cd41fc9
/version 3.4.0a7
Apr 7, 2026
3224270
merge develop
sliu008 Apr 7, 2026
ef89062
/version 3.3.1rc7
Apr 7, 2026
55fefb7
trigger build
sliu008 Apr 7, 2026
42a867f
/version 3.3.1rc8
Apr 7, 2026
8e5737b
rework ODL parser to be fully scope based, not size based (#416)
ocsmit Apr 9, 2026
81a83a8
/version 3.4.0a8
Apr 9, 2026
a864608
rework ODL parser to be fully scope based, not size based (#416)
ocsmit Apr 9, 2026
9daa51b
merge develop
sliu008 Apr 9, 2026
0d7335f
/version 3.3.1rc9
Apr 9, 2026
0383843
poetry update
sliu008 Apr 9, 2026
fc38adf
/version 3.3.1rc10
Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security


## [3.3.1]
### Added
- Updated readme documentation
### Changed
- Changed way Cygnss collection finds time variable
### Deprecated
### Removed
### Fixed
### Security


## [3.3.0]
### Added
- [issue/364] (https://github.com/podaac/l2ss-py/issues/364) Implement vertical subsetting via dimensions.
Expand Down
44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# l2ss-py

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=podaac_l2ss-py&metric=coverage)](https://sonarcloud.io/dashboard?id=podaac_l2ss-py)
Expand All @@ -13,6 +12,7 @@ Harmony service for subsetting L2 data. l2ss-py supports:
- GeoJSON subsetting
- Temporal subsetting
- Variable subsetting
- Vertical subsetting

If you would like to contribute to l2ss-py, refer to the [contribution document](CONTRIBUTING.md).

Expand Down Expand Up @@ -57,40 +57,50 @@ to run this, the l2ss-py package must be installed in your current
Python interpreter

```
$ l2ss-py --help
usage: run_subsetter.py [-h] [--bbox BBOX BBOX BBOX BBOX]
[--variables VARIABLES [VARIABLES ...]]
[--min-time MIN_TIME] [--max-time MAX_TIME] [--cut]
input_file output_file
$ l2ss-py --help
usage: l2ss-py [-h] [--bbox BBOX BBOX BBOX BBOX] [--variables VARIABLES [VARIABLES ...]] [--min-time MIN_TIME] [--max-time MAX_TIME] [--cut] [--shapefile SHAPEFILE] [--pixel_subset] [--vertical-var VERTICAL_VAR] [--vertical-min VERTICAL_MIN] [--vertical-max VERTICAL_MAX]
input_file output_file

Run l2ss-py

positional arguments:
input_file File to subset
output_file Output file

optional arguments:
options:
-h, --help show this help message and exit
--bbox BBOX BBOX BBOX BBOX
Bounding box in the form min_lon min_lat max_lon
max_lat
Bounding box in the form min_lon min_lat max_lon max_lat
--variables VARIABLES [VARIABLES ...]
Variables, only include if variable subset is desired.
Should be a space separated list of variable names
e.g. sst wind_dir sst_error ...
--min-time MIN_TIME Min time. Should be ISO-8601 format. Only include if
temporal subset is desired.
--max-time MAX_TIME Max time. Should be ISO-8601 format. Only include if
temporal subset is desired.
Variables, only include if variable subset is desired. Should be a space separated list of variable names e.g. sst wind_dir sst_error ...
--min-time MIN_TIME Min time. Should be ISO-8601 format. Only include if temporal subset is desired.
--max-time MAX_TIME Max time. Should be ISO-8601 format. Only include if temporal subset is desired.
--cut If provided, scanline will be cut
--shapefile SHAPEFILE
Path to either shapefile or geojson file used to subset the provided input granule
--pixel_subset To pixel cut based the lon lat on the bounding box
--vertical-var VERTICAL_VAR
Name of the vertical variable to subset by (e.g., depth, altitude)
--vertical-min VERTICAL_MIN
Minimum value for vertical subsetting (inclusive)
--vertical-max VERTICAL_MAX
Maximum value for vertical subsetting (inclusive)
```

#### Additional subsetting options

The following options are also recorded in the output file's metadata history for provenance and reproducibility:
- `--min-time` and `--max-time` (temporal subsetting)
- `--variables` (variable subsetting)
- `--vertical-var`, `--vertical-min`, `--vertical-max` (vertical subsetting)
- `--cut`, `--pixel_subset`, `--shapefile`, and `--bbox` (spatial subsetting)

All subsetting parameters used in a run are included in the output file's `history` and `history_json` attributes.

For example:

```
l2ss-py /path/to/input.nc /path/to/output.nc --bbox -50 -10 50 10 --variables wind_speed wind_dir ice_age time --min-time '2015-07-02T09:00:00' --max-time '2015-07-02T10:00:00' --cut
l2ss-py /path/to/input.nc /path/to/output.nc --bbox -50 -10 50 10 --variables wind_speed wind_dir ice_age time --min-time '2015-07-02T09:00:00' --max-time '2015-07-02T10:00:00' --cut --vertical-var depth --vertical-min 0 --vertical-max 100
```

An addition to providing a bounding box, spatial subsetting can be achieved by passing in a shapefile or a geojson file.
Expand Down
5 changes: 4 additions & 1 deletion podaac/subsetter/datatree_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,10 @@ def method_6(path, ds):
if result:
# Normalize /sample_time to /solar_time for this unique case
if result == "/sample_time":
return "/solar_time"
# Check if '/solar_time' exists in the dataset
if "/solar_time" in [f"/{v}" for v in ds.variables]:
print('returning solar time')
return "/solar_time"
return result
return None

Expand Down
17 changes: 14 additions & 3 deletions podaac/subsetter/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,21 @@ def subset_with_bbox(dataset: xr.Dataset, # pylint: disable=too-many-branches
time_path = None
if time_var_name:
time_path = file_utils.get_path(time_var_name)
time_data = dataset[time_var_name]

if time_data.ndim == 1 and lon_data.ndim == 2 and temporal_cond is not True:
temporal_cond = mask_utils.align_time_to_lon_dim(time_data, lon_data, temporal_cond)
try:
time_data = dataset[time_var_name]
except KeyError:
time_data = None

if (
time_data is not None
and time_data.ndim == 1
and lon_data.ndim == 2
and temporal_cond is not True
):
temporal_cond = mask_utils.align_time_to_lon_dim(
time_data, lon_data, temporal_cond
)

operation = (
oper((lon_data >= lon_bounds[0]), (lon_data <= lon_bounds[1])) &
Expand Down
Loading
Loading