Repository navigation
Cookbook_SWOT_vC_to_vD_updates_v2 - #342
NickTarpinian wants to merge 2 commits into
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
ScienceCat18
left a comment
There was a problem hiding this comment.
Thanks for the updates @NickTarpinian and @celiaou-podaac.
This is a review for SWOT_Raster_Notebook_cloud.ipynb only. Here are the requested changes:
Review of SWOT_Raster_Notebook_cloud.ipynb
- (a) Do we need code box 6 (center point, lon_c doesn’t appear anywhere else)?
- (b) Before code block 10, explain what we got from the previous code block (i.e. add markdown):
24 granules were returned. Inspecting the granule names, we notice data was returned for three UTM zones: UTM01, UTM60, UTM11. UTM01 and UTM60 are the International Date Line zones and not near our AOI (defined bbox near Lake Mead). Due to a known footprint metadata issue in some of the L2 Raster products, spatial search doesn’t filter the Raster granules correctly, returning both rasters in the AOI and rasters around the International Data Line. This issue is actively being worked on to be corrected (Nov 2026). Meanwhile, we can further filter out for only our AOI by using the GPolygon metadata in the file as below. This will return 4 unique raster granules that actually overlap with our AOI.
- (c) In code block 11: add a line at the end to print the valid granule names
- (d) Code block 12 markdown: does this check the CRID or the Prod Counter? Looks like the prod counter? Update the code block and add markdown before this code block as follows:
- Markdown: Checking for “duplicate” granules: check if there are multiple versions returned for the same granule, but with different Product Counter ids. As described in the SWOT User Handbook (see Section 0), the respective product description document, and the SWOT Release Note for Version D (sections 3 and 4), all KaRIn science data products include a Composite Release IDentifier (CRID) and a Product Counter in the individual product file names, for example _. The Product Counter reflects the number of attempts made by the automated production system to generate the particular granule (product file). It will typically have a value of “01” but can be higher if there are anomalies with the processing systems. Users are advised to use the granule with the highest Product Counter. Below we filter to keep only the granules with the highest Product Counter.
- Code block (update comments and add a print line):
# Check if there are reprocessing duplicates: same acquisition, different Product Counter e.g. _01, _02
by_acq = {}
for g in filtered_results:
name = g['meta']['native-id']
by_acq.setdefault('_'.join(name.split('_')[:-2]), []).append(g)
for key, items in by_acq.items():
if len(items) > 1:
print("duplicates:", sorted(g['meta']['native-id'][-20:] for g in items))
# Keep one per acquisition. Sort by granule name and choose the highest Product Counter; check the printout above to confirm that is the reprocessed version you want.
filtered_results = [sorted(items, key=lambda g: g['meta']['native-id'])[-1] for items in by_acq.values()]
print(f"Unique granules: {len(filtered_results)}")
- Nick: Add code to print the granule names again to confirm filtering
- (e) Update markdown header to read: Masking a variable by its quality flag
- (f) Update final explanation before Appendix to read: Our end product is a time series animation of the SWOT raster data showing only the values where the quality flag is either good (0) or suspect (1). (Note: the animation may not show in a static version of the notebook, e.g. in the PO.DAAC Cookbook rendering, but when code is executed, the animation will rotate and show the maps through the different dates.)
- (g) Did we check that the Appendix code still works, even if it’s commented out?
Please make similar updates to the local versions of the raster notebook. The feedback above is based on review of the cloud versions of the notebook.
Updating SWOT Chapter and related tutorials from vC to vD.