Skip to content

Add pdsfile support for the f ring and b ring bundles#89

Open
juzen2003 wants to merge 85 commits intomainfrom
73_add_pdsFile_support_for_the_f_ring_bundle
Open

Add pdsfile support for the f ring and b ring bundles#89
juzen2003 wants to merge 85 commits intomainfrom
73_add_pdsFile_support_for_the_f_ring_bundle

Conversation

@juzen2003
Copy link
Copy Markdown
Collaborator

@juzen2003 juzen2003 commented Feb 23, 2026

  • Fixed Add PdsFile support for the F Ring bundle when it becomes available #73

  • Changes:

    • Add rules and tests for cassini_iss_fring_mosaics_rsfrench2025:
      • Create pds4file/rules/cassini_iss_fring_mosaics_rsfrench2025.py
      • Add opus id rules for mosaic files in cassini_iss_fring_mosaics_rsfrench2025 bundle
      • Add opus type rules for mosaic & reproj files in cassini_iss_fring_mosaics_rsfrench2025 bundle
      • Add opus id to primary filespec rules for mosaic files in cassini_iss_fring_mosaics_rsfrench2025 bundle
      • Add associations_to_bundles rules for mosaic files in cassini_iss_fring_mosaics_rsfrench2025 bundle
      • Add associations_to_previews rules for mosaic files in cassini_iss_fring_mosaics_rsfrench2025 bundle
      • Add default_viewables rules for mosaic files in cassini_iss_fring_mosaics_rsfrench2025 bundle
      • Create tests results files for opus_products and associated_abspaths and opus_id_to_primary_logical_path
      • Add blackbox tests for opus_id and opus_type
    • Update COISS_xxxx.py:
      • Update the opus products rules to include the reproj files from cassini_iss_fring_mosaics_rsfrench2025
      • Add a new test case for test_opus_products that includes reproj files.
    • Update `pdsfile.py``:
      • Support both '.xml' and '.lblx' label extensions for pds4
      • Handle the label of viewables that has different basenames
      • Update opus_products to handle the existence of cross pds3 and pds4 products
  • History of changes:

    • 03/13/26:
      • Update the code based on coderabbit and Rob's comments.
      • Add archive rules for cassini_iss_fring_mosaics_rsfrench2025.
    • 03/31/26:
      • Update opus_type to put all browse products under browse category and all index files under metadata category
    • 4/3/26:
      • Add corresponding label files to the opus products output for these categories:
        • coiss_f_ring_mosaic_metadata
        • coiss_f_ring_mosaic_bkg_sub_metadata
        • coiss_f_ring_reproj_img_spice_pointing
        • coiss_f_ring_reproj_img_metadata
    • 4/24/26:
      • Create cassini_iss_spokes_hedman_hamilton_2024.py and add rules for cassini_iss_spokes_hedman_hamilton_2024
      • Update the corresponding tests
      • Add these dummy files to the pdsdata/holdings to pass the tests without shelves for the new test cases:
    previews/COISS_2xxx/COISS_2008/data/1479208692_1479461954/N1479210132_1_thumb.jpg
    previews/COISS_2xxx/COISS_2008/data/1479208692_1479461954/N1479210132_1_small.jpg
    previews/COISS_2xxx/COISS_2008/data/1479208692_1479461954/N1479210132_1_med.jpg
    previews/COISS_2xxx/COISS_2008/data/1479208692_1479461954/N1479210132_1_full.png
    
    previews/COISS_2xxx/COISS_2008/data/1481264980_1481267140/N1481265970_1_thumb.jpg
    previews/COISS_2xxx/COISS_2008/data/1481264980_1481267140/N1481265970_1_small.jpg
    previews/COISS_2xxx/COISS_2008/data/1481264980_1481267140/N1481265970_1_med.jpg
    previews/COISS_2xxx/COISS_2008/data/1481264980_1481267140/N1481265970_1_full.png
    
    calibrated/COISS_2xxx/COISS_2008/data/1481264980_1481267140/N1481265970_1_CALIB.IMG
    calibrated/COISS_2xxx/COISS_2008/data/1481264980_1481267140/N1481265970_1_CALIB.LBL    
    calibrated/COISS_2xxx_v1/COISS_2008/data/1481264980_1481267140/N1481265970_1_CALIB.IMG
    calibrated/COISS_2xxx_v1/COISS_2008/data/1481264980_1481267140/N1481265970_1_CALIB.LBL    
    calibrated/COISS_2xxx_v2/COISS_2008/data/1481264980_1481267140/N1481265970_1_CALIB.IMG
    calibrated/COISS_2xxx_v2/COISS_2008/data/1481264980_1481267140/N1481265970_1_CALIB.LBL
    
  • Questions:

    • As discussed with Rob, we can use previews from bundles/browse_mosaic_bkg_sub. So for those files, do we use the same opus type as ones under previews/ directory? Or do we create new opus type for them? (the current output is using the new opus type) Also I assume we want to include files from bundles/browse_mosaic as well, but with different preview opus types. Please review the opus types for these.
    • Do we include the label files for browse (previews) files? Please review the output of opus products, the label of browse files is included now.

Summary by CodeRabbit

  • New Features

    • Cross-version PDS3/PDS4 product coupling and discovery; full Cassini ISS F‑Ring Mosaics dataset added (bundles, mosaics, previews, metadata, archives).
  • Improvements

    • Label extension handling expanded (multiple extensions and case variants).
    • Opus product resolution now preserves source class info for cross-product traversal.
    • Associated-path resolution now prefers existing assets before including alternatives.
  • Tests

    • Extensive new and updated test data and test cases covering mosaics and cross-version scenarios.

@rfrenchseti
Copy link
Copy Markdown
Collaborator

I talked this over with Mia and Matt. Here's what we'd like to do for the archives:

  • One archive for the entire bundle.
  • One archive for just the reprojected images.
  • One archive for just the plain mosaics.
  • One archive for just the background-subtracted mosaics.

Each of the last 3 will include:

  • Browse images
  • Data
  • Documentation
  • The part of documentation supplemental that has the global index files for the specific data type
  • All the top-level support stuff (readme, bundle.xml, spice kernels, xml schema, etc.)

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
pdsfile/pds4file/rules/cassini_iss_fring_mosaics_rsfrench2025.py (1)

90-96: ⚠️ Potential issue | 🟠 Major

Route document associations to in-bundle document/ paths.

Line 93 and Line 94 emit documents/... patterns, while this module’s products and archives use bundles/.../document/.... This can break associated_abspaths('documents') resolution for these products.

Suggested fix
 associations_to_documents = translator.TranslatorByRegex([
-    (r'bundles/cassini_iss_fring_mosaics_rsfrench2025[^/]*', 0,
+    (r'bundles/(cassini_iss_fring_mosaics_rsfrench2025/cassini_iss_fring_mosaics_rsfrench2025[^/]*)(|/.*)$', 0,
         [
-            r'documents/cassini_iss_fring_mosaics_rsfrench2025[^/]*',
-            r'documents/cassini_iss_fring_mosaics_rsfrench2025[^/]*/.*',
+            r'bundles/\1/readme.txt',
+            r'bundles/\1/document/user_guide/f-ring-mosaics-user-guide.lblx',
+            r'bundles/\1/document/user_guide/f-ring-mosaics-user-guide.pdf',
+            r'bundles/\1/document/supplemental/global_mosaic_index.lblx',
+            r'bundles/\1/document/supplemental/global_mosaic_index.tab',
+            r'bundles/\1/document/supplemental/global_mosaic_bkg_sub_index.lblx',
+            r'bundles/\1/document/supplemental/global_mosaic_bkg_sub_index.tab',
+            r'bundles/\1/document/supplemental/global_reproj_img_index.lblx',
+            r'bundles/\1/document/supplemental/global_reproj_img_index.tab',
         ]),
 ])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pdsfile/pds4file/rules/cassini_iss_fring_mosaics_rsfrench2025.py` around
lines 90 - 96, The current associations_to_documents TranslatorByRegex maps
bundle ids to top-level "documents/..." paths, but this module stores documents
inside the bundle under "bundles/.../document/..."; update the regex targets in
associations_to_documents (the TranslatorByRegex call) so the right-hand
patterns point to the in-bundle document locations (i.e., use patterns that
insert "bundles/cassini_iss_fring_mosaics_rsfrench2025.../document..." instead
of "documents/...") so associated_abspaths('documents') resolves to the
bundle-local document paths.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pdsfile/pds4file/rules/cassini_iss_fring_mosaics_rsfrench2025.py`:
- Around line 240-247: The archive rule's input regex used in archive_paths with
TranslatorByRegex currently allows 'bundles|metadata|previews|diagrams' but
emits bundle-content directories (data_*, browse_*, document/*), which can
produce archive specs pointing outside actual bundle roots; update the regex in
the TranslatorByRegex entries (the tuple that builds archive_paths) to only
match the 'bundles' root (remove 'metadata|previews|diagrams') for the patterns
that emit bundle-content tarballs, and apply the same restriction to the other
TranslatorByRegex entries referenced in the same block (the later entries
covering lines ~252-309) so all rules that produce data_browse_*,
data_browse_mosaic*, document/* archives are constrained to bundle roots.

---

Duplicate comments:
In `@pdsfile/pds4file/rules/cassini_iss_fring_mosaics_rsfrench2025.py`:
- Around line 90-96: The current associations_to_documents TranslatorByRegex
maps bundle ids to top-level "documents/..." paths, but this module stores
documents inside the bundle under "bundles/.../document/..."; update the regex
targets in associations_to_documents (the TranslatorByRegex call) so the
right-hand patterns point to the in-bundle document locations (i.e., use
patterns that insert
"bundles/cassini_iss_fring_mosaics_rsfrench2025.../document..." instead of
"documents/...") so associated_abspaths('documents') resolves to the
bundle-local document paths.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f15bb46a-a50c-4107-800e-4ab575caaa6a

📥 Commits

Reviewing files that changed from the base of the PR and between 1820593 and 85e91b0.

📒 Files selected for processing (3)
  • pdsfile/pds4file/rules/cassini_iss_fring_mosaics_rsfrench2025.py
  • pdsfile/pds4file/rules/cassini_uvis_solarocc_beckerjarmak2023.py
  • pdsfile/pds4file/rules/uranus_occs_earthbased.py

Comment thread pdsfile/pds4file/rules/cassini_iss_fring_mosaics_rsfrench2025.py
…l browse products under browse category and all index files under metadata category
…COISS_xxxx.py to move index files from the supplemental to the miscellaneous directory. This change improves organization and consistency in file categorization for Cassini ISS F Ring mosaic data.
…eflect the relocation of index files from the supplemental to the miscellaneous directory, ensuring improved organization and consistency.
… reflect consistent naming for reprojected images, enhancing clarity in file categorization.
…ages by adding logic for handling '_suppl' suffix. Update test results to reflect consistent naming for reprojected images, ensuring accurate categorization and retrieval.
…eprojected images, ensuring accurate root name extraction for label files.
(r'bundles/cassini_iss_fring_mosaics_rsfrench2025/cassini_iss_fring_mosaics_rsfrench2025[^/]*/data_mosaic_bkg_sub/(iss|iosic)_.*/(iss|iosic)_.*metadata.*\.tab', 0, ('Cassini ISS F Ring Mosaics', 40, 'coiss_f_ring_mosaic_bkg_sub_metadata', 'Background-Subtracted Mosaic Metadata', True)),

# browse_mosaic
# put all browse files under browse category
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the normal Cassini ISS images, we only download the "full" version by default. We should probably do something similar here. I suggest downloading the "medium" version because it's the most useful.

# document
(r'bundles/cassini_iss_fring_mosaics_rsfrench2025/cassini_iss_fring_mosaics_rsfrench2025[^/]*/(readme.txt|document/user_guide/.*mosaic.*\.(lblx|pdf))', 0, ('Cassini ISS F Ring Mosaics', 130, 'coiss_f_ring_documentation', 'Documentation', False)),

# index under document/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment for miscellaneous

(r'bundles/cassini_iss_fring_mosaics_rsfrench2025/cassini_iss_fring_mosaics_rsfrench2025[^/]*/data_reproj_img/(iss|iosic)_.*/.*_reproj_suppl\.txt', 0, ('Cassini ISS F Ring Reprojected Images', 180, 'coiss_f_ring_reproj_img_spice_pointing', 'Reprojected Image SPICE Pointing', False)),
(r'bundles/cassini_iss_fring_mosaics_rsfrench2025/cassini_iss_fring_mosaics_rsfrench2025[^/]*/data_reproj_img/(iss|iosic)_.*/.*_reproj_img_metadata_params\.tab', 0, ('Cassini ISS F Ring Reprojected Images', 190, 'coiss_f_ring_reproj_img_metadata', 'Reprojected Image Metadata', False)),

# browse_reproj_img cassini_iss_fring_mosaics_rsfrench2025
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of confusing that we are mixing mosaics (which have their own opus ids) and reproj images (which are part of the downloads for normal cassini image) in the same opus_types. At the lease you should add a more detailed comment explaining how this works.

opus_products = translator.TranslatorByRegex([
(r'bundles/(cassini_iss_fring_mosaics_rsfrench2025/cassini_iss_fring_mosaics_rsfrench2025[^/]*)/(data|browse)_mosaic.*/((iss|iosic)_[a-zA-Z0-9_]*)/(iss|iosic)_[a-zA-Z0-9_]*_mosaic.*\.[a-z]{3,4}', 0,
[
# bundles data_mosaic/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And same here about an explanatory comment

r'\1/\2/\2/data_reproj_img',
r'\1/\2/\2/document/collection_document.csv',
r'\1/\2/\2/document/collection_document.lblx',
r'\1/\2/\2/miscellaneous/global_reproj_img_index.lblx',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move below "document/user_guide". Also there is a collection_miscellaneous.

Comment thread pdsfile/pdsfile.py Outdated
# For viewables with label (like f ring browse mosaic), we need to get rid of
# _thumb, _full, _med, and _small from the data file names to obtain the correct
# root name for the label files.
if ('_thumb' in self.basename or '_full' in self.basename or
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a good place for this. Anything specific to particular datasets should be under rules. Don't hardcode special cases in the generic code.

…mproved label file mapping

Introduce PRODUCT_LBL_BASENAME_WO_EXT to facilitate the extraction of label file basenames without extensions. Update logic in PdsFile to utilize this new attribute for determining root names. Adjust regex patterns in cassini_iss_fring_mosaics_rsfrench2025.py and test results to reflect changes in file categorization, ensuring consistent handling of browse and background-subtracted images.
@juzen2003
Copy link
Copy Markdown
Collaborator Author

All comments addressed.

Introduce a new subclass for the Cassini ISS Spokes dataset, enhancing the Pds4File class with specific regex patterns for product categorization, view options, and archive handling. This addition includes the implementation of various translators for metadata and file organization, ensuring accurate mapping and retrieval of reprojected images and associated documentation.
Add detailed comments to clarify the structure and purpose of archive files and directories for the Cassini ISS Spokes dataset. This includes specifying the inclusion of the entire bundle, data_derived, and browse_derived directories, along with associated files for improved organization and clarity in file categorization.
Updated regex patterns to include new mappings for B Ring and F Ring reprojected images in the COISS_xxxx.py file. Added test results for new image files, ensuring accurate categorization and retrieval of associated metadata. This enhancement improves the organization and clarity of the Cassini ISS dataset.
Incorporated additional test cases in test_pds4file_blackbox.py to support the cassini_iss_spokes_hedman-hamilton-2024 dataset. This includes mappings for documentation and various derived image files, enhancing the coverage and accuracy of the test suite for the Cassini ISS dataset.
…on_2024.py to streamline the code and improve clarity. This cleanup enhances maintainability by eliminating redundant code segments.
…milton_2024.py to streamline the code and enhance maintainability by eliminating redundancy.
…ni_iss_spokes_hedman_hamilton_2024.py to streamline code and improve maintainability.
@juzen2003
Copy link
Copy Markdown
Collaborator Author

  • Add rules for b ring bundle cassini_iss_spokes_hedman-hamilton-2024
  • Update tests results

@juzen2003 juzen2003 changed the title Add pds file support for the f ring bundle Add pdsfile support for the f ring and b ring bundles Apr 24, 2026
…d cassini_iss_spokes_hedman_hamilton_2024.py to include specific descriptors for F Ring and B Ring reprojected images. This enhances clarity in product categorization and improves maintainability of the code.
…o improve product categorization for B Ring reprojected images. Adjusted sort keys for clarity and maintainability.
…to streamline test cases for the cassini_iss_spokes_hedman-hamilton-2024 dataset, enhancing clarity and maintainability of the test suite.
…g reprojected image mappings. Adjusted sort keys for clarity and maintainability, ensuring accurate categorization of associated metadata in the dataset.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PdsFile support for the F Ring bundle when it becomes available

2 participants