dist-s1-enumerator 1.0.10__py3-none-any.whl → 1.0.12__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.
dist_s1_enumerator/asf.py CHANGED
@@ -135,7 +135,7 @@ def get_rtc_s1_ts_metadata_by_burst_ids(
135
135
  properties_f = [
136
136
  {
137
137
  'opera_id': p['sceneName'],
138
- 'acq_dt': pd.to_datetime(p['startTime']),
138
+ 'acq_dt': pd.Timestamp(p['startTime'], tz='UTC'),
139
139
  'track_number': p['pathNumber'],
140
140
  'polarizations': p['polarization'],
141
141
  'all_urls': [p['url']] + p['additionalUrls'],
@@ -16,9 +16,9 @@ def enumerate_one_dist_s1_product(
16
16
  post_date: datetime | pd.Timestamp | str,
17
17
  lookback_strategy: str = 'multi_window',
18
18
  post_date_buffer_days: int = 1,
19
- max_pre_imgs_per_burst: int | list[int] | tuple[int, ...] = (5, 5, 5),
19
+ max_pre_imgs_per_burst: int | list[int] | tuple[int, ...] = (4, 3, 3),
20
20
  delta_window_days: int = 60,
21
- delta_lookback_days: int | list[int] | tuple[int, ...] = 365,
21
+ delta_lookback_days: int | list[int] | tuple[int, ...] = (365, 730, 1095),
22
22
  min_pre_imgs_per_burst: int = 1,
23
23
  tqdm_enabled: bool = True,
24
24
  ) -> gpd.GeoDataFrame:
@@ -53,8 +53,9 @@ def enumerate_one_dist_s1_product(
53
53
  If lookback strategy is 'multi_window':
54
54
  - this is interpreted as the maximum number of pre-images on each anniversary date.
55
55
  - tuple/list of integers are provided, each int represents the maximum number of pre-images on each
56
- anniversary date,
57
- most recent last.
56
+ anniversary date. Each integer in tuple should be aligned with `delta_lookback_days`, if latter is a tuple.
57
+ If `delta_lookback_days` is an integer, then `max_pre_imgs_per_burst` will be interpreted with recent
58
+ coming first.
58
59
  - if a single integer is provided, this is interpreted as the maximum number of pre-images on 3
59
60
  anniversary dates.
60
61
  If the lookback strategy is 'immediate_lookback':
@@ -231,10 +232,10 @@ def enumerate_dist_s1_products(
231
232
  df_rtc_ts: gpd.GeoDataFrame,
232
233
  mgrs_tile_ids: list[str],
233
234
  lookback_strategy: str = 'multi_window',
234
- max_pre_imgs_per_burst: int = (5, 5, 5),
235
+ max_pre_imgs_per_burst: int = (4, 3, 3),
235
236
  min_pre_imgs_per_burst: int = 1,
236
237
  tqdm_enabled: bool = True,
237
- delta_lookback_days: int = 365,
238
+ delta_lookback_days: int = (365, 730, 1095),
238
239
  delta_window_days: int = 60,
239
240
  ) -> gpd.GeoDataFrame:
240
241
  """
@@ -259,7 +260,9 @@ def enumerate_dist_s1_products(
259
260
  If lookback strategy is 'multi_window':
260
261
  - this is interpreted as the maximum number of pre-images on each anniversary date.
261
262
  - tuple/list of integers are provided, each int represents the maximum number of pre-images on each
262
- anniversary date, most recent last.
263
+ anniversary date. Each integer in tuple should be aligned with `delta_lookback_days`, if latter is a tuple.
264
+ If `delta_lookback_days` is an integer, then `max_pre_imgs_per_burst` will be interpreted with recent
265
+ coming first.
263
266
  - if a single integer is provided, this is interpreted as the maximum number of pre-images on 3
264
267
  anniversary dates.
265
268
  If the lookback strategy is 'immediate_lookback':
@@ -270,7 +273,12 @@ def enumerate_dist_s1_products(
270
273
  tqdm_enabled : bool, optional
271
274
  Whether to enable tqdm progress bars, by default True.
272
275
  delta_lookback_days : int, optional
273
- When to set the most recent pre-image date. Default is 365.
276
+ When to set the most recent pre-image date for a given lookback window in baseline.
277
+ Default is (365, 730, 1095). Explicitly set to a tuple to ensure proper alignment with `max_pre_imgs_per_burst`
278
+ and improve readability.
279
+ See `max_pre_imgs_per_burst` for how this parameter is aligned with that. Specifically, when they are both
280
+ tuples they should be the same length (i.e. if `delta_lookback_days` is a tuple, then `max_pre_imgs_per_burst`
281
+ should be the same length).
274
282
  If lookback strategy is 'multi_window', this means the maximum number of days to search for pre-images on each
275
283
  anniversary date where `post_date - n * lookback_days` are the anniversary dates for n = 1,....
276
284
  If lookback strategy is 'immediate_lookback', this must be set to 0.
@@ -32,10 +32,10 @@ def enumerate_dist_s1_workflow_inputs(
32
32
  start_acq_dt: datetime | pd.Timestamp | str | None = None,
33
33
  stop_acq_dt: datetime | pd.Timestamp | str | None = None,
34
34
  lookback_strategy: str = 'multi_window',
35
- max_pre_imgs_per_burst: int | list[int] | tuple[int, ...] = (5, 5, 5),
35
+ max_pre_imgs_per_burst: int | list[int] | tuple[int, ...] = (4, 3, 3),
36
36
  min_pre_imgs_per_burst: int = 1,
37
- delta_lookback_days: int | list[int] | tuple[int, ...] = 365,
38
- delta_window_days: int = 365,
37
+ delta_lookback_days: int | list[int] | tuple[int, ...] = (365, 730, 1095),
38
+ delta_window_days: int = 60,
39
39
  df_ts: gpd.GeoDataFrame | None = None,
40
40
  ) -> list[dict]:
41
41
  """Enumerate the inputs for a DIST-S1 workflow.
@@ -60,11 +60,13 @@ def enumerate_dist_s1_workflow_inputs(
60
60
  Lookback strategy to use, by default 'multi_window'. Options are
61
61
  'immediate_lookback' or 'multi_window'.
62
62
  max_pre_imgs_per_burst : int | list[int] | tuple[int, ...], optional
63
- Maximum number of pre-images per burst to include, by default 10.
63
+ Maximum number of pre-images per burst to include, by default (4, 3, 3).
64
64
  If lookback strategy is 'multi_window':
65
65
  - this is interpreted as the maximum number of pre-images on each anniversary date.
66
66
  - tuple/list of integers are provided, each int represents the maximum number of pre-images on each
67
- anniversary date, most recent last.
67
+ anniversary date. Each integer in tuple should be aligned with `delta_lookback_days`, if latter is a tuple.
68
+ If `delta_lookback_days` is an integer, then `max_pre_imgs_per_burst` will be interpreted with recent
69
+ coming first.
68
70
  - if a single integer is provided, this is interpreted as the maximum number of pre-images on 3
69
71
  anniversary dates.
70
72
  If the lookback strategy is 'immediate_lookback':
@@ -73,7 +75,7 @@ def enumerate_dist_s1_workflow_inputs(
73
75
  min_pre_imgs_per_burst : int, optional
74
76
  Minimum number of pre-images per burst to include, by default 1. This is for *all* the pre-images.
75
77
  delta_lookback_days : int | list[int] | tuple[int, ...], optional
76
- When to set the most recent pre-image date. Default is 0.
78
+ When to set the most recent pre-image date. Default is (365, 730, 1095) days.
77
79
  If lookback strategy is 'multi_window', this means the maximum number of days to search for pre-images on each
78
80
  anniversary date where `post_date - n * lookback_days` are the anniversary dates for n = 1,....
79
81
  If lookback strategy is 'immediate_lookback', this must be set to 0.
@@ -27,7 +27,7 @@ rtc_s1_resp_schema = DataFrameSchema(
27
27
  {
28
28
  'opera_id': Column(str, required=True),
29
29
  'jpl_burst_id': Column(str, required=True),
30
- 'acq_dt': Column(DateTime(tz='UTC'), required=True),
30
+ 'acq_dt': Column(DateTime(tz='UTC'), coerce=True, required=True),
31
31
  'acq_date_for_mgrs_pass': Column(str, required=False),
32
32
  'polarizations': Column(str, required=True),
33
33
  'track_number': Column(int, required=True),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dist-s1-enumerator
3
- Version: 1.0.10
3
+ Version: 1.0.12
4
4
  Summary: Enumeration and ops library for the OPERA DIST-S1 project
5
5
  Author-email: "Richard West, Charlie Marshak, Talib Oliver-Cabrera, and Jungkyo Jung" <charlie.z.marshak@jpl.nasa.gov>
6
6
  License: Apache-2.0
@@ -99,7 +99,8 @@ Yields:
99
99
  <details>
100
100
  <summary>Output</summary>
101
101
 
102
- ```[{'mgrs_tile_id': '19HBD',
102
+ ```
103
+ [{'mgrs_tile_id': '19HBD',
103
104
  'post_acq_date': '2023-11-05',
104
105
  'track_number': 91,
105
106
  'post_acq_timestamp': '2023-11-05 23:36:49+00:00'},
@@ -342,6 +343,21 @@ In theory, we could specify the exact time of acquisition, but we have elected t
342
343
  It is also important to note that we are assuming the selection of pre-images (once a post-image set is selected) is fixed.
343
344
  Although varying a baseline of pre-images to measure disturbance will alter the final DIST-S1 product, we assume with a fixed strategy to construct this baseline, the above 3 fields uniquely identify a DIST-S1 product.
344
345
 
346
+ ### Parameters for Enumeration of RTC-S1 Inputs
347
+
348
+ We quickly discuss the primary parameters for enumerating the RTC-S1 inputs and provide a picture for the default parameters for clarity particularly for enumerating products.
349
+ The primary paramters we discuss are $\Delta_w$ (`delta_window_days` in library), $\Delta_l$ (`delta_lookback_days` in library), and $m$ (`max_pre_imgs_per_burst` in library).
350
+ These parameters operate on a per-burst curation as noted above.
351
+ The parameter $\Delta_w$ constrains how many days between the anniversary date of a recent post-acquisition date and $\Delta_w$ days before that.
352
+ By default it is set to 60 days.
353
+ The parameter $\Delta_l$ explicitly defines the number of anniversary dates and their distance in days from the recent post-acquisition.
354
+ It is by default set to (365, 730, 1095) days, which is 3 anniversary dates at 365 days apart.
355
+ $m$ explicitly says the maximum amount in each window when constructing this baseline and by default it is set to (4, 3, 3).
356
+ So for a post-date acquistion at $t_0$, the maximum number of RTC-S1 products to be used in the time range $[t_0 - 365 - \Delta_w, t_0 - 365]$ is $4$ and the next range $[t_0 - 730 - \Delta_w, t_0 - 730]$ is 3. A visualization of this is shown below.
357
+
358
+ ![params](assets/visualization_of_parameters.png)
359
+
360
+
345
361
  # About the Data Tables in this Library
346
362
 
347
363
  One of the purposes of this data is to provide easy access via standard lookups to a variety of tables associated with enumerating DIST-S1 products.
@@ -1,19 +1,19 @@
1
1
  dist_s1_enumerator/__init__.py,sha256=L89uOLGobmF-ZsBA767RiGpKCDKVx6KOK6wJkjGQ69M,1766
2
- dist_s1_enumerator/asf.py,sha256=m0LHIBM6OSeoNi2Htin5oeeyGjsWecFgyKeqUXNcbDo,13850
2
+ dist_s1_enumerator/asf.py,sha256=FflbykjtZDT8sn8a2g2PMpFejYXgbtyCaW7wuKnzcSE,13858
3
3
  dist_s1_enumerator/constants.py,sha256=Ve_aLWRqNduh7uEBaHbJNy1VfH2njzV57L4T_gBVNaE,727
4
- dist_s1_enumerator/dist_enum.py,sha256=pQn5646hyeks8ZYxTKGb7lwOXAKkS6sijiWRFXF2Gro,21412
5
- dist_s1_enumerator/dist_enum_inputs.py,sha256=RG8URUyXqjyOUzq7MtBGeJhwHyfM8tjmv5gD2buu5Zs,6792
4
+ dist_s1_enumerator/dist_enum.py,sha256=AidZHEqB-vyJF-0N9Mvxj6aj4DqTg0MeII4NYzdDW7I,22297
5
+ dist_s1_enumerator/dist_enum_inputs.py,sha256=mHwkQtgsK3gRoW52KJB5NzF6-JCa6P0K087vUGXPE4A,7043
6
6
  dist_s1_enumerator/exceptions.py,sha256=JhT8fIEmW3O2OvUQADkEJkL8ZrUN5pkKNzCCSt33goQ,82
7
7
  dist_s1_enumerator/mgrs_burst_data.py,sha256=vt9ubDUP3l2iNXK82OuvahX_WUq0MpHMkmTKOPvbRuw,7162
8
8
  dist_s1_enumerator/param_models.py,sha256=DI2MgSxiPo7HiRKtXX8bxZnQtuoYAmtAcdYYrnhMIho,4614
9
9
  dist_s1_enumerator/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  dist_s1_enumerator/rtc_s1_io.py,sha256=TPlgMdyjRYnGWCt7J1nQ1AY90lAPQoMy2BN0oFMw4gg,5267
11
- dist_s1_enumerator/tabular_models.py,sha256=OjsTg6fN9Mq-LHVKuz9klFD3DsG0WkfPmfDfdZYUJOw,3189
11
+ dist_s1_enumerator/tabular_models.py,sha256=v1XBDiDtMvRix7HKJMvmPDO3HtD7ipE-Sol405YF2pY,3202
12
12
  dist_s1_enumerator/data/jpl_burst_geo.parquet,sha256=EXpQcXhWt2T6RVBmvkh7vQb150ShftIsZWvN97wQP4g,30106843
13
13
  dist_s1_enumerator/data/mgrs.parquet,sha256=XB69HyNK502cJJ2Ry5wmnrbe-jepAdoMe7y35QUj_Gs,596933
14
14
  dist_s1_enumerator/data/mgrs_burst_lookup_table.parquet,sha256=m_r0E7yTet6Xwd_H-lg2qr6IpBYBksYn5C5nOaXY8pw,3029091
15
- dist_s1_enumerator-1.0.10.dist-info/licenses/LICENSE,sha256=qsoT0jnoSQSgSzA-sywESwmVxC3XcugfW-3vctvz2aM,11346
16
- dist_s1_enumerator-1.0.10.dist-info/METADATA,sha256=I8wF9HlLcM60_nSxsNbFryzsZWWeIgu-XBv_bcH6ss8,20543
17
- dist_s1_enumerator-1.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- dist_s1_enumerator-1.0.10.dist-info/top_level.txt,sha256=5-RGu6oxsKKyhybZZSuUImALhcQT8ZOAnVv2MmrESDE,19
19
- dist_s1_enumerator-1.0.10.dist-info/RECORD,,
15
+ dist_s1_enumerator-1.0.12.dist-info/licenses/LICENSE,sha256=qsoT0jnoSQSgSzA-sywESwmVxC3XcugfW-3vctvz2aM,11346
16
+ dist_s1_enumerator-1.0.12.dist-info/METADATA,sha256=nDC2iPBQE7J8v_hW_4FhpU6oQHq4xg_vI2dLMJpobtk,21850
17
+ dist_s1_enumerator-1.0.12.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
18
+ dist_s1_enumerator-1.0.12.dist-info/top_level.txt,sha256=5-RGu6oxsKKyhybZZSuUImALhcQT8ZOAnVv2MmrESDE,19
19
+ dist_s1_enumerator-1.0.12.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5