Skip to content

Commit

Permalink
unit test first
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Niessner authored and Al Niessner committed Jun 5, 2024
1 parent 7fc118c commit 67b5d90
Show file tree
Hide file tree
Showing 11 changed files with 545 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/resources/features/developer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Scenario Outline: Execute validate command for tests below.
Examples:
| testName | testDir | messageCount | messageText | problemEnum | resourceDir | reportDir | commandArgs | refOutputValue |

# Validate#915
|"NASA-PDS/validate#915 Failure context ref mismatch" | "github915" | 6 | "6 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN|UNALLOWED_BUNDLE_SUBDIR_NAME" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github915.json -s json --skip-context-validation --skip-content-validation -t {resourceDir}/github915/dsn_0159-science.2008-02-29.xml {resourceDir}/github915/dsn_0159-science.2009-05-18.xml" | "report_github915.json" |

# Validate#905
|"NASA-PDS/validate#905 Success no duplicates in non-observational;" | "github905" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github905.json -s json --skip-context-validation -t {resourceDir}/github905/dsn_0159-science.2008-02-29.xml {resourceDir}/github905/dsn_0159-science.2009-05-18.xml" | "report_github905.json" |

Expand Down
149 changes: 149 additions & 0 deletions src/test/resources/github915/collection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1L00.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<Product_Collection xmlns="http://pds.nasa.gov/pds4/pds/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1L00.xsd">
<Identification_Area>
<logical_identifier>urn:nasa:pds:nh_derived:pluto_albedo</logical_identifier>
<version_id>1.0</version_id>
<title>Bolometric Hemispherical Albedo Map of Pluto from New Horizons Observations</title>
<information_model_version>1.21.0.0</information_model_version>
<product_class>Product_Collection</product_class>
<Citation_Information>
<author_list>Hofgartner, J. D.</author_list>
<publication_year>2024</publication_year>
<doi>10.26007/62b6-ya11</doi>
<description>Map of Pluto's incidence-angle-average bolometric hemispherical albedo
(local energy-balance albedo, equal to one minus absorption). The map is based on
analyses of New Horizons Long Range Reconnaissance Imager (LORRI) and
Multispectral Visible Imaging Camera (MVIC) images of Pluto in 2015. Users are
strongly encouraged to read the publication titled 'Bolometric Hemispherical
Albedo Map of Pluto from New Horizons Observations' in the Planetary Science
Journal by Hofgartner et al. in 2023.</description>
<Funding_Acknowledgement>
<funding_source>NASA</funding_source>
<funding_award>80NSSC22K1118</funding_award>
<funding_acknowledgement_text>Financial support from the NASA New Frontiers Data Analysis Program (NFDAP)
is gratefully acknowledged (Grant Number 80NSSC22K1118).</funding_acknowledgement_text>
</Funding_Acknowledgement>
</Citation_Information>
</Identification_Area>
<Context_Area>
<Time_Coordinates>
<start_date_time>2015-07-08T15:58:00.775Z</start_date_time>
<stop_date_time>2015-07-14T08:29:13.781Z</stop_date_time>
</Time_Coordinates>
<Primary_Result_Summary>
<purpose>Science</purpose>
<processing_level>Derived</processing_level>
<Science_Facets>
<wavelength_range>Near Infrared</wavelength_range>
<wavelength_range>Visible</wavelength_range>
<discipline_name>Imaging</discipline_name>
<facet1>Color</facet1>
</Science_Facets>
<Science_Facets>
<wavelength_range>Near Infrared</wavelength_range>
<wavelength_range>Visible</wavelength_range>
<discipline_name>Flux Measurements</discipline_name>
<facet1>Photometry</facet1>
</Science_Facets>
<Science_Facets>
<wavelength_range>Near Infrared</wavelength_range>
<wavelength_range>Visible</wavelength_range>
<discipline_name>Small Bodies</discipline_name>
<facet1>Physical Properties</facet1>
</Science_Facets>
</Primary_Result_Summary>
<Investigation_Area>
<name>None</name>
<type>Other Investigation</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:individual.none</lid_reference>
<reference_type>collection_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>
<Observing_System>
<Observing_System_Component>
<name>NEW HORIZONS</name>
<type>Host</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.nh</lid_reference>
<reference_type>is_instrument_host</reference_type>
</Internal_Reference>
</Observing_System_Component>
<Observing_System_Component>
<name>LONG RANGE RECONNAISSANCE IMAGER</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:nh.lorri</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>
</Observing_System>
<Observing_System>
<Observing_System_Component>
<name>NEW HORIZONS</name>
<type>Host</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.nh</lid_reference>
<reference_type>is_instrument_host</reference_type>
</Internal_Reference>
</Observing_System_Component>
<Observing_System_Component>
<name>MULTISPECTRAL VISIBLE IMAGING CAMERA</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:nh.mvic</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>
</Observing_System>
<Target_Identification>
<name>(134340) Pluto</name>
<type>Dwarf Planet</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:target:dwarf_planet.134340_pluto</lid_reference>
<reference_type>collection_to_target</reference_type>
</Internal_Reference>
</Target_Identification>
</Context_Area>
<Reference_List>
<Internal_Reference>
<lid_reference>urn:nasa:pds:nh_derived:pluto_albedo:overview</lid_reference>
<reference_type>collection_to_document</reference_type>
<comment>This brief document provides an overview of the collection content and history.</comment>
</Internal_Reference>
</Reference_List>
<Collection>
<collection_type>Data</collection_type>
</Collection>
<File_Area_Inventory>
<File>
<file_name>inventory.csv</file_name>
<local_identifier>data</local_identifier>
</File>
<Inventory>
<offset unit="byte">0</offset>
<parsing_standard_id>PDS DSV 1</parsing_standard_id>
<records>4</records>
<record_delimiter>Carriage-Return Line-Feed</record_delimiter>
<field_delimiter>Comma</field_delimiter>
<Record_Delimited>
<fields>2</fields>
<groups>0</groups>
<Field_Delimited>
<name>Member Status</name>
<field_number>1</field_number>
<data_type>ASCII_String</data_type>
<maximum_field_length unit="byte">1</maximum_field_length>
</Field_Delimited>
<Field_Delimited>
<name>LIDVID_LID</name>
<field_number>2</field_number>
<data_type>ASCII_LIDVID_LID</data_type>
<maximum_field_length unit="byte">255</maximum_field_length>
</Field_Delimited>
</Record_Delimited>
<reference_type>inventory_has_member_product</reference_type>
</Inventory>
</File_Area_Inventory>
</Product_Collection>
Empty file.
196 changes: 196 additions & 0 deletions src/test/resources/github915/data/pluto_albedo_hof22.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1L00.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-model href="https://pds.nasa.gov/pds4/disp/v1/PDS4_DISP_1L00_1510.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-model href="https://pds.nasa.gov/pds4/cart/v1/PDS4_CART_1L00_1970.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<Product_Observational xmlns="http://pds.nasa.gov/pds4/pds/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cart="http://pds.nasa.gov/pds4/cart/v1" xmlns:disp="http://pds.nasa.gov/pds4/disp/v1" xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1L00.xsd http://pds.nasa.gov/pds4/disp/v1 https://pds.nasa.gov/pds4/disp/v1/PDS4_DISP_1L00_1510.xsd http://pds.nasa.gov/pds4/cart/v1 https://pds.nasa.gov/pds4/cart/v1/PDS4_CART_1L00_1970.xsd">
<Identification_Area>
<logical_identifier>urn:nasa:pds:nh_derived:pluto_albedo:pluto_albedo_hof22_fit</logical_identifier>
<version_id>1.0</version_id>
<title>Incidence-angle-average Bolometric Hemispherical Albedo Map of Pluto</title>
<information_model_version>1.21.0.0</information_model_version>
<product_class>Product_Observational</product_class>
<Citation_Information>
<author_list>Hofgartner, J. D.; Buratti, B. J.; Beyer, R. A.; Ennico, K.; Grundy, W. M.; Howett,
C. J.; Johnson, P. E.; Lauer, T. R.; Olkin, C. B.; Spencer, J. R.; Stern, S. A.;
Weaver, H. A.; Young, L. A.</author_list>
<publication_year>2024</publication_year>
<description>Incidence-angle-average Bolometric Hemispherical Albedo Map of Pluto</description>
</Citation_Information>
</Identification_Area>
<Observation_Area>
<Time_Coordinates>
<start_date_time>2015-07-08T15:58:00.775Z</start_date_time>
<stop_date_time>2015-07-14T08:29:13.781Z</stop_date_time>
</Time_Coordinates>
<Primary_Result_Summary>
<purpose>Science</purpose>
<processing_level>Derived</processing_level>
<Science_Facets>
<wavelength_range>Near Infrared</wavelength_range>
<wavelength_range>Visible</wavelength_range>
<discipline_name>Imaging</discipline_name>
<facet1>Grayscale</facet1>
</Science_Facets>
<Science_Facets>
<wavelength_range>Near Infrared</wavelength_range>
<wavelength_range>Visible</wavelength_range>
<discipline_name>Small Bodies</discipline_name>
<facet1>Physical Properties</facet1>
</Science_Facets>
<Science_Facets>
<wavelength_range>Near Infrared</wavelength_range>
<wavelength_range>Visible</wavelength_range>
<discipline_name>Flux Measurements</discipline_name>
<facet1>Photometry</facet1>
</Science_Facets>
</Primary_Result_Summary>
<Investigation_Area>
<name>None</name>
<type>Other Investigation</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:individual.none</lid_reference>
<reference_type>data_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>
<Observing_System>
<Observing_System_Component>
<name>NEW HORIZONS</name>
<type>Host</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.nh</lid_reference>
<reference_type>is_instrument_host</reference_type>
</Internal_Reference>
</Observing_System_Component>
<Observing_System_Component>
<name>LONG RANGE RECONNAISSANCE IMAGER</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:nh.lorri</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>
</Observing_System>
<Observing_System>
<Observing_System_Component>
<name>NEW HORIZONS</name>
<type>Host</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.nh</lid_reference>
<reference_type>is_instrument_host</reference_type>
</Internal_Reference>
</Observing_System_Component>
<Observing_System_Component>
<name>MULTISPECTRAL VISIBLE IMAGING CAMERA</name>
<type>Instrument</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument:nh.mvic</lid_reference>
<reference_type>is_instrument</reference_type>
</Internal_Reference>
</Observing_System_Component>
</Observing_System>
<Target_Identification>
<name>(134340) Pluto</name>
<type>Dwarf Planet</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:target:dwarf_planet.134340_pluto</lid_reference>
<reference_type>data_to_target</reference_type>
</Internal_Reference>
</Target_Identification>
<Discipline_Area>
<disp:Display_Settings>
<Local_Internal_Reference>
<local_identifier_reference>primary_image</local_identifier_reference>
<local_reference_type>display_settings_to_array</local_reference_type>
</Local_Internal_Reference>
<disp:Display_Direction>
<disp:horizontal_display_axis>Sample</disp:horizontal_display_axis>
<disp:horizontal_display_direction>Left to Right</disp:horizontal_display_direction>
<disp:vertical_display_axis>Line</disp:vertical_display_axis>
<disp:vertical_display_direction>Top to Bottom</disp:vertical_display_direction>
</disp:Display_Direction>
</disp:Display_Settings>
<cart:Cartography>
<Local_Internal_Reference>
<local_identifier_reference>primary_image</local_identifier_reference>
<local_reference_type>cartography_parameters_to_image_object</local_reference_type>
</Local_Internal_Reference>
<cart:Spatial_Domain>
<cart:Bounding_Coordinates>
<cart:west_bounding_coordinate unit="deg">0.0</cart:west_bounding_coordinate>
<cart:east_bounding_coordinate unit="deg">360.0</cart:east_bounding_coordinate>
<cart:north_bounding_coordinate unit="deg">90.0</cart:north_bounding_coordinate>
<cart:south_bounding_coordinate unit="deg">-49.381884697957</cart:south_bounding_coordinate>
</cart:Bounding_Coordinates>
</cart:Spatial_Domain>
<cart:Spatial_Reference_Information>
<cart:Horizontal_Coordinate_System_Definition>
<cart:Planar>
<cart:Map_Projection>
<cart:map_projection_name>Equirectangular</cart:map_projection_name>
<cart:Equirectangular>
<cart:latitude_of_projection_origin unit="deg">0</cart:latitude_of_projection_origin>
<cart:standard_parallel_1 unit="deg">0</cart:standard_parallel_1>
<cart:longitude_of_central_meridian unit="deg">180</cart:longitude_of_central_meridian>
</cart:Equirectangular>
</cart:Map_Projection>
<cart:Planar_Coordinate_Information>
<cart:planar_coordinate_encoding_method>Coordinate Pair</cart:planar_coordinate_encoding_method>
<cart:Coordinate_Representation>
<cart:pixel_resolution_x unit="m/pixel">879.23076275961</cart:pixel_resolution_x>
<cart:pixel_resolution_y unit="m/pixel">879.23076275961</cart:pixel_resolution_y>
<cart:pixel_scale_x unit="pixel/deg">23.5885143922324971</cart:pixel_scale_x>
<cart:pixel_scale_y unit="pixel/deg">23.5885143922324971</cart:pixel_scale_y>
</cart:Coordinate_Representation>
</cart:Planar_Coordinate_Information>
<cart:Geo_Transformation>
<cart:upperleft_corner_x unit="m">-3396.746</cart:upperleft_corner_x>
<cart:upperleft_corner_y unit="m">4600.123</cart:upperleft_corner_y>
</cart:Geo_Transformation>
</cart:Planar>
<cart:Geodetic_Model>
<cart:latitude_type>Planetocentric</cart:latitude_type>
<cart:spheroid_name>Pluto</cart:spheroid_name>
<cart:a_axis_radius unit="m">1188300</cart:a_axis_radius>
<cart:b_axis_radius unit="m">1188300</cart:b_axis_radius>
<cart:c_axis_radius unit="m">1188300</cart:c_axis_radius>
<cart:longitude_direction>Positive East</cart:longitude_direction>
</cart:Geodetic_Model>
</cart:Horizontal_Coordinate_System_Definition>
</cart:Spatial_Reference_Information>
</cart:Cartography>
</Discipline_Area>
</Observation_Area>
<File_Area_Observational>
<File>
<file_name>pluto_albedo_hof22.fit</file_name>
<local_identifier>file</local_identifier>
<file_size unit="byte">0</file_size>
</File>
<Header>
<offset unit="byte">0</offset>
<object_length unit="byte">2880</object_length>
<parsing_standard_id>FITS 3.0</parsing_standard_id>
<description>FITS attached header</description>
</Header>
<Array_2D>
<local_identifier>primary_image</local_identifier>
<offset unit="byte">2880</offset>
<axes>2</axes>
<axis_index_order>Last Index Fastest</axis_index_order>
<description>Incidence-angle-average Bolometric Hemispherical Albedo Map of Pluto</description>
<Element_Array>
<data_type>IEEE754MSBSingle</data_type>
</Element_Array>
<Axis_Array>
<axis_name>Line</axis_name>
<elements>3288</elements>
<sequence_number>1</sequence_number>
</Axis_Array>
<Axis_Array>
<axis_name>Sample</axis_name>
<elements>8492</elements>
<sequence_number>2</sequence_number>
</Axis_Array>
</Array_2D>
</File_Area_Observational>
</Product_Observational>
Binary file not shown.
Loading

0 comments on commit 67b5d90

Please sign in to comment.