diff --git a/model-dmdocument/src/main/java/gov/nasa/pds/model/plugin/DMDocument.java b/model-dmdocument/src/main/java/gov/nasa/pds/model/plugin/DMDocument.java index a9034f1c..a39b48b6 100644 --- a/model-dmdocument/src/main/java/gov/nasa/pds/model/plugin/DMDocument.java +++ b/model-dmdocument/src/main/java/gov/nasa/pds/model/plugin/DMDocument.java @@ -324,9 +324,9 @@ public class DMDocument extends Object { * @throws Throwable */ public static void main(String[] args) throws Throwable { - run(args); + boolean success = run(args); - if (lMessageErrorCount > 0 || lMessageFatalErrorCount > 0) { + if (!success) { System.out.println(""); System.out.println(">> INFO Exit(1)"); System.exit(1); @@ -341,7 +341,7 @@ public static void main(String[] args) throws Throwable { * @throws Throwable * @throws IOException */ - public static void run(String[] args) throws Throwable { + public static boolean run(String[] args) throws Throwable { init(); // get the command line arguments using argparse4j @@ -349,7 +349,7 @@ public static void run(String[] args) throws Throwable { try { argparse4jNamespace = getArgumentParserNamespace(args); } catch (Throwable e) { - return; + return false; } String nameSpaceDataDirPath = null; @@ -469,23 +469,10 @@ public static void run(String[] args) throws Throwable { if (configInputStr != null) { buildDate = configInputStr; } -// } catch (FileNotFoundException ex) { -// // file does not exist -// Utility.registerMessage("3>error Configuration file does not exist. [config.properties]"); -// } catch (IOException ex) { -// // I/O error -// Utility.registerMessage("3>error Configuration file IO Exception. [config.properties]"); -// } finally { -// try { -// reader.close(); -// } catch (IOException|NullPointerException e) { -// // Do nothing -// } -// } // process second set of arguments; exit if return=false if (! processArgumentParserNamespacePhase2(argparse4jNamespace)) - return; + return false; // check the files checkRequiredFiles(); @@ -556,7 +543,14 @@ public static void run(String[] args) throws Throwable { Utility.registerMessage("0>info Next UID: " + DOMInfoModel.getNextUId()); printErrorMessages(); + boolean success = true; + if (lMessageErrorCount > 0 || lMessageFatalErrorCount > 0) { + success = false; + } + reset(); + + return success; } /********************************************************************************************************** diff --git a/model-lddtool/src/test/java/cucumber/LddToolRunner.java b/model-lddtool/src/test/java/cucumber/LddToolRunner.java index 3a08189b..8c377035 100644 --- a/model-lddtool/src/test/java/cucumber/LddToolRunner.java +++ b/model-lddtool/src/test/java/cucumber/LddToolRunner.java @@ -34,12 +34,14 @@ public static String runLddTool(String[] args, String outDirectory) throws Throw File f = new File(outDirectory); f.mkdirs(); DMDocument.setOutputDirPath(outDirectory + File.separatorChar); - DMDocument.run(args); + boolean success = DMDocument.run(args); + output = outContent.toString(); - } catch (Exception e) { - // Throw an exception if an error occurs while setting the SecurityManager - e.printStackTrace(); - throw new Exception("An error occurred while setting the SecurityManager in runLddTool", e); + + if (!success) { + throw new RuntimeException( + "LDDTool failed execution. See execution logs: \n" + output); + } } finally { restoreStreams(); // Restore the original System.out and System.err clearStreams(); // Clear the captured output and error streams diff --git a/model-lddtool/src/test/java/cucumber/ValidateStepDefs.java b/model-lddtool/src/test/java/cucumber/ValidateStepDefs.java index 01af9fce..3dc4b0e3 100644 --- a/model-lddtool/src/test/java/cucumber/ValidateStepDefs.java +++ b/model-lddtool/src/test/java/cucumber/ValidateStepDefs.java @@ -18,6 +18,8 @@ import gov.nasa.pds.tools.validate.CrossLabelFileAreaReferenceChecker; import gov.nasa.pds.tools.validate.ProblemType; import gov.nasa.pds.validate.ValidateLauncher; +import io.cucumber.java.Before; +import io.cucumber.java.Scenario; import io.cucumber.java.en.Given; import io.cucumber.java.en.Then; import io.cucumber.java.en.When; @@ -57,16 +59,23 @@ public class ValidateStepDefs { // The values of these variables should come from a row in the table in the // feature file. + private String testId; private String testName; private String testDir; + private String pds4Version; private int messageCount; - private String messageText; private String problemEnum; private String resourceDir; private String reportDir; private String commandArgs; private String refOutputValue; + + @Before + public void before(Scenario scenario) { + this.testId = scenario.getName(); + } + /** * @throws java.lang.Exception */ @@ -79,7 +88,6 @@ void setUp() throws Exception { this.reportDir = TestConstants.TEST_OUT_DIR; this.resourceDir = TestConstants.TEST_DATA_DIR; - } /** @@ -167,18 +175,22 @@ public void a_test_string_with_string(String testName, String testDir) { this.reportDir = this.reportDir + File.separatorChar + testDir; } - @Given("expected error\\/warning count {int} with expected error\\/warning text of {string} with expected error from ValidateProblems enumeration {string}") - public void with_test_property(int messageCount, String messageText, String problemEnum) { + @Given("expected error\\/warning count {int} with expected error from ValidateProblems enumeration {string}") + public void with_test_property(int messageCount, String problemEnum) { this.messageCount = messageCount; - this.messageText = messageText; this.problemEnum = problemEnum; LOG.debug("with_test_property:messageCount [" + Integer.toString(messageCount) - + "], messageText [" + messageText + "]"); + + "]"); } - @Given("the latest PDS4 schema\\/schematron is generated") - public void generate_pds4_schema() throws Exception { - StepDefs.exec_lddtool(DEFAULT_CORE_ARGS, + @Given("the latest PDS4 schema\\/schematron is generated for IM Version {string}") + public void generate_pds4_schema(String pds4Version) throws Exception { + String lddtoolArgs = DEFAULT_CORE_ARGS; + this.pds4Version = pds4Version; + if (!this.pds4Version.equals("")) { + lddtoolArgs += " -V " + this.pds4Version; + } + StepDefs.exec_lddtool(lddtoolArgs, TestConstants.TEST_OUT_DIR + File.separator + this.testDir); } @@ -187,8 +199,13 @@ public void generate_ldd(String ingestLDDFilename) throws Exception { if (!ingestLDDFilename.equals("")) { String ingestLDDPath = TestConstants.TEST_DATA_DIR + File.separator + this.testDir + File.separator + ingestLDDFilename; + + String lddtoolArgs = DEFAULT_LDDTOOL_ARGS + " " + ingestLDDPath; + if (!this.pds4Version.equals("")) { + lddtoolArgs += " -V " + this.pds4Version; + } LOG.info("Generating LDD from " + ingestLDDFilename); - StepDefs.exec_lddtool(DEFAULT_LDDTOOL_ARGS + " " + ingestLDDPath, + StepDefs.exec_lddtool(lddtoolArgs, TestConstants.TEST_OUT_DIR + File.separator + this.testDir); } } @@ -244,7 +261,9 @@ public void produced_output_from_validate_command_should_be_similar_to_reference + this.refOutputValue); // Compare the count from this test with the this.messageCount from test table. - assertEquals(this.messageCount, count, this.messageText + " " + reportJson.toString()); + assertEquals(this.messageCount, count, + this.testId + " failed. " + "Expected: " + this.messageCount + + " errors/warnings. Actual: " + count); assertEquals(0, this.getMessageCountBasedOnProblemType("INTERNAL_ERROR,ARRAY_INTERNAL_ERROR,TABLE_INTERNAL_ERROR", reportJson), "Required that internal errors do not occur."); } catch (ExitException e) { diff --git a/model-lddtool/src/test/resources/features/validate.feature b/model-lddtool/src/test/resources/features/validate.feature index b3fff20d..46c6b92b 100644 --- a/model-lddtool/src/test/resources/features/validate.feature +++ b/model-lddtool/src/test/resources/features/validate.feature @@ -2,9 +2,9 @@ Feature: pds4_information_model_validate_integration Scenario Outline: Given the test at directory - Given the latest PDS4 schema/schematron is generated + Given the latest PDS4 schema/schematron is generated for IM Version Given a new LDD is generated using the IngestLDDs - Given expected error/warning count with expected error/warning text of with expected error from ValidateProblems enumeration + Given expected error/warning count with expected error from ValidateProblems enumeration When execute validate command with as arguments Then produced output from validate command should be similar to reported JSON report or no error reported. @@ -15,15 +15,18 @@ Feature: pds4_information_model_validate_integration @v15.2.x #note: 'mvn test' choks if problem enum is blank or "" even if 0 messages Examples: -| testId | testName | testDir | messageCount | messageText | problemEnum | commandArgs | ingestLDDFileName | -| NASA-PDS/pds4-information-model#753 | "new Current units nA microA" | "github753" | 0 | "0 errors expected" | "SCHEMATRON_ERROR" | "-t {resourceDir}/github753/pc__d139.xml" | "PDS4_MARS2020_IngestLDD.xml" | -| NASA-PDS/pds4-information-model#784a | "Encoded_Video for Product_Ancillary" | "github784a" | 0 | "0 errors expected" | "SCHEMATRON_ERROR" | "-t {resourceDir}/github784/FUV2017032anc.xml" | "" | -| NASA-PDS/pds4-information-model#784b | "Encoded_Video for Product_Browse" | "github784b" | 0 | "0 errors expected" | "SCHEMATRON_ERROR" | "-t {resourceDir}/github784/FUV2017032brw.xml" | "" | -| NASA-PDS/pds4-information-model#794 | "new namespace vikinglander" | "github794" | 0 | "0 errors expected" | "SCHEMATRON_ERROR" | "-t {resourceDir}/github794/ORB_35_STAR_SCANNER.xml" | "PDS4_VIKINGLANDER_IngestLDD.xml" | -| NASA-PDS/pds4-information-model#795a | "reference_type Failures for all Data Types" | "github795" | 10 | "10 errors expected" | "SCHEMATRON_ERROR,INTERNAL_ERROR" | "-R pds4.bundle -t {resourceDir}/github795" | "" | -| NASA-PDS/pds4-information-model#795b | "reference_type Failures for Product_External" | "github795b" | 2 | "2 errors expected" | "SCHEMATRON_ERROR" | "-t {resourceDir}/github795b/occultation_prediction_som_manifest.xml" | "" | -| NASA-PDS/pds4-information-model#797 | "test schematron for kernel_type checks" | "github797" | 3 | "3 errors expected" | "SCHEMATRON_ERROR" | "-t {resourceDir}/github797/test_label1_FAIL.xml {resourceDir}/github797/u5.xml" | "PDS4_GEOM_IngestLDD.xml" | -| NASA-PDS/pds4-information-model#829 | "new unit mrad/pixels" | "github829" | 0 | "0 errors expected" | "SCHEMATRON_ERROR" | "-t {resourceDir}/github829/ORB_35_STAR_SCANNER.xml" | "PDS4_HST_IngestLDD.xml" | -| NASA-PDS/pds4-information-model#831 | "add Array_1D_Spectrum" | "github831" | 0 | "0 errors expected" | "SCHEMATRON_ERROR" | "-t {resourceDir}/github831/" | "" | - +| testId | testName | testDir | messageCount | problemEnum | commandArgs | ingestLDDFileName | pds4Version | +| NASA-PDS/pds4-information-model#753 | "new Current units nA microA" | "github753" | 0 | "totalErrors" | "-t {resourceDir}/github753/pc__d139.xml" | "PDS4_MARS2020_IngestLDD.xml" | "" | +| NASA-PDS/pds4-information-model#784a | "Encoded_Video for Product_Ancillary" | "github784a" | 0 | "totalErrors" | "-t {resourceDir}/github784/FUV2017032anc.xml" | "" | "" | +| NASA-PDS/pds4-information-model#784b | "Encoded_Video for Product_Browse" | "github784b" | 0 | "totalErrors" | "-t {resourceDir}/github784/FUV2017032brw.xml" | "" | "" | +#| NASA-PDS/pds4-information-model#794 | "new namespace vikinglander" | "github794" | 0 | "totalErrors" | "-t {resourceDir}/github794/ORB_35_STAR_SCANNER.xml" | "PDS4_VIKINGLANDER_IngestLDD.xml" | "" | +| NASA-PDS/pds4-information-model#795a | "reference_type Failures for all Data Types" | "github795" | 10 | "SCHEMATRON_ERROR,INTERNAL_ERROR" | "-R pds4.bundle -t {resourceDir}/github795" | "" | "" | +| NASA-PDS/pds4-information-model#795b | "reference_type Failures for Product_External" | "github795b" | 2 | "SCHEMATRON_ERROR" | "-t {resourceDir}/github795b/occultation_prediction_som_manifest.xml" | "" | "" | +#| NASA-PDS/pds4-information-model#797 | "test schematron for kernel_type checks" | "github797" | 3 | "SCHEMATRON_ERROR" | "-t {resourceDir}/github797/test_label1_FAIL.xml {resourceDir}/github797/u5.xml" | "PDS4_GEOM_IngestLDD.xml" | "" | +#| NASA-PDS/pds4-information-model#829 | "new unit mrad/pixels" | "github829" | 0 | "totalErrors" | "-t {resourceDir}/github829/ORB_35_STAR_SCANNER.xml" | "PDS4_HST_IngestLDD.xml" | "" | +| NASA-PDS/pds4-information-model#831 | "add Array_1D_Spectrum" | "github831" | 0 | "totalErrors" | "-t {resourceDir}/github831/" | "" | "" | +# Primary check is that LDDTool executes successfully, which it did not before +#| NASA-PDS/pds4-information-model#852a | "bug generating LDDs for 1C00" | "github852" | 2 | "totalErrors" | "-t {resourceDir}/github852/lcross_nir2_cal_20090622162743896.xml" | "PDS4_LCROSS_IngestLDD_1000.xml" | "1C00" | +#| NASA-PDS/pds4-information-model#852b | "bug generating LDDs for 1D00" | "github852" | 2 | "totalErrors" | "-t {resourceDir}/github852/lcross_nir2_cal_20090622162743896.xml" | "PDS4_LCROSS_IngestLDD_1000.xml" | "1C00" | +#| NASA-PDS/pds4-information-model#852c | "bug generating LDDs for 1E00" | "github852" | 2 | "totalErrors" | "-t {resourceDir}/github852/lcross_nir2_cal_20090622162743896.xml" | "PDS4_LCROSS_IngestLDD_1000.xml" | "1C00" | diff --git a/model-lddtool/src/test/resources/github753/PDS4_MARS2020_IngestLDD.xml b/model-lddtool/src/test/resources/github753/PDS4_MARS2020_IngestLDD.xml index d14a818a..0ae7db53 100644 --- a/model-lddtool/src/test/resources/github753/PDS4_MARS2020_IngestLDD.xml +++ b/model-lddtool/src/test/resources/github753/PDS4_MARS2020_IngestLDD.xml @@ -7050,24 +7050,6 @@ 0 1 - - img.Exposure - component_of - 0 - 1 - - - img.Subframe - component_of - 0 - 1 - - - img.High_Dynamic_Range - component_of - 0 - 1 - SuperCam_Ancillary_Header 1.0 diff --git a/model-lddtool/src/test/resources/github829/ORB_35_STAR_SCANNER.xml b/model-lddtool/src/test/resources/github829/ORB_35_STAR_SCANNER.xml index c50d9778..36d3c03e 100644 --- a/model-lddtool/src/test/resources/github829/ORB_35_STAR_SCANNER.xml +++ b/model-lddtool/src/test/resources/github829/ORB_35_STAR_SCANNER.xml @@ -6,7 +6,7 @@ 4.2e-05 . + 4.2e-05 OPUS 2008_5c diff --git a/model-lddtool/src/test/resources/github852/PDS4_LCROSS_IngestLDD_1000.xml b/model-lddtool/src/test/resources/github852/PDS4_LCROSS_IngestLDD_1000.xml new file mode 100644 index 00000000..c553a864 --- /dev/null +++ b/model-lddtool/src/test/resources/github852/PDS4_LCROSS_IngestLDD_1000.xml @@ -0,0 +1,779 @@ + + + + + + + + LCROSS Mission Dictionary + 1.0.0.0 + Mission + Jennifer Ward + geo + lcross + + The LCROSS mission dictionary contains a class with attributes specific to the + LCROSS mission and instruments. This dictionary was created for the migration + of LCROSS data products from PDS3 to PDS4. + + Built with: lddtool -plJ PDS4_LCROSS_IngestLDD.xml + + + 2024-11-20 + + + + + + product_type + 1.0 + lcross.product_type + false + Susan Slavney + + The product_type attributes identifies the type or category of a product within a + data set. + + + true + ASCII_Short_String_Collapsed + + Raw Image + A raw product. + + + Calibrated Image + A radiometrically calibrated product. + + + Raw Spectrum + A raw spectrum product. + + + Calibrated Spectrum + A radiometrically calibrated spectrum. + + + Raw Data + Raw output from an instrument, usually in DN. + + + Calibrated Data + Calibrated data from an instrument. + + + + + + producer_institution_name + 1.0 + lcross.producer_institution_name + false + Susan Slavney + + The producer_institution_name element identifies a university, research center, + NASA center or other institution associated with the production of a data set. + + + false + ASCII_Short_String_Collapsed + + + + + mission_phase_name + 1.0 + lcross.mission_phase_name + false + Susan Slavney + + The mission_phase_name element provides the commonly-used identifier of a mission phase. + + + true + ASCII_Short_String_Collapsed + + Quicklook + Quicklook + + + Starfield + Starfield + + + Swingby + Swingby + + + Earthlook1 + Earthlook1 + + + Mirlook + Mirlook + + + Earthlook2 + Earthlook2 + + + Separation + Separation + + + Preimpact + Preimpact + + + Impact + Impact + + + + + + spacecraft_clock_start_count + 1.0 + lcross.spacecraft_clock_start_count + false + GEO + The spacecraft_clock_start_count attribute provides the value + of the spacecraft clock at the beginning of a time period of + interest. + + + false + ASCII_Short_String_Collapsed + + + + + spacecraft_clock_stop_count + 1.0 + lcross.spacecraft_clock_stop_count + false + GEO + The spacecraft_clock_stop_count attribute provides the value of the spacecraft + clock at the end of a time period of interest. + + + false + ASCII_Short_String_Collapsed + + + + + intercept_point_latitude + 1.0 + lcross.intercept_point_latitude + false + Susan Slavney + The intercept_point_latitude attribute is the latitude of a point on the + surface of a body. + + false + ASCII_Real + -90.0 + 90.0 + Units_of_Angle + + + + + intercept_point_longitude + 1.0 + lcross.intercept_point_longitude + false + Susan Slavney + The intercept_point_longitude attribute is the longitude of a point on the + surface of a body. + + false + ASCII_Real + 0.0 + 360.0 + Units_of_Angle + + + + + instrument_temperature + 1.0 + lcross.instrument_temperature + false + Susan Slavney + The instrument_temperature attribute provides the temperature, in degrees Celsius + of an instrument or some part of an instrument. + + false + ASCII_Real + Units_of_Temperature + + + + + instrument_temperature_count + 1.0 + lcross.instrument_temperature_count + false + Susan Slavney + The instrument_temperature_count attribute provides the temperature + of an instrument in raw counts or DN values. + + + false + ASCII_Integer + + + + + + + instrument_gain_state + 1.0 + lcross.instrument_gain_state + false + Susan Slavney + The instrument_gain_state specifies the instrument gain state, either High or Low. + + + true + ASCII_Short_String_Collapsed + + High + High + + + Low + Low + + + + + + missing_packet_flag + 1.0 + lcross.missing_packet_flag + false + Susan Slavney + The missing_packet_flag indicates whether the image is missing data. A missing + packet appears as a horizontal bar 8 pixels high of zero data. + + + true + ASCII_Short_String_Collapsed + + Yes + Packets are missing. + + + No + No packets were missed. + + + + + + calibration_valid + 1.0 + lcross.calibration_valid + false + Susan Slavney + The response of the mid-IR cameras exhibited a startup transient. + The calibration is valid only after this transient had settled. This attribute + indicates whether the image was taken before or after this point. Values are + Yes or No. + + + true + ASCII_Short_String_Collapsed + + Yes + Calibration is valid. + + + No + Calibration is not valid. + + + + + + + + enhancement_mode + 1.0 + lcross.enhancement_mode + false + Susan Slavney + This attribute indicates whether onboard image stretching was enabled + or disabled. Values are On or Off. + + + true + ASCII_Short_String_Collapsed + + On + Onboard image enhancement was enabled. + + + Off + Onboard image enhancement was disabled. + + + + + + operating_setting_value + 1.0 + lcross.operating_setting_value + false + Susan Slavney + The operating setting value determines the integration time and gain. + Values range from 0 to 15. + + + false + ASCII_Integer + 0 + 15 + + + + + integration_time + 1.0 + lcross.integration_time + false + Susan Slavney + The integration time in msec. + + + false + ASCII_Integer + 0 + Units_of_Time + + + + + gain_value + 1.0 + lcross.gain_value + false + Susan Slavney + The focal plane sensitivity in electrons per count. Value is + approximate and inferred from the operating setting value and factory + definitions. + + + false + ASCII_Integer + 0 + + + + + + + saturation_flag + 1.0 + lcross.saturation_flag + false + Susan Slavney + Indicates whether a spectra is saturated based on a mechanical test. + + + true + ASCII_Short_String_Collapsed + + Yes + Saturation noted. + + + No + No saturation. + + + + + + boresight_to_sun_angle + 1.0 + lcross.boresight_to_sun_angle + false + Susan Slavney + Angle between the instrument boresight vector and the spacecraft to sun vector + in degrees. + + + false + ASCII_Real + Units_of_Angle + + + + + + + exposure_duration + 1.0 + lcross.exposure_duration + false + Susan Slavney + The time interval between the opening and closing of an instrument + aperture. + + + false + ASCII_Real + + + + + tec_setpoint + 1.0 + lcross.tec_setpoint + false + Susan Slavney + The setpoint temperature of the VSP thermo-electric cooler. + + + false + ASCII_Real + Units_of_Temperature + + + + + tec_temperature + 1.0 + lcross.tec_temperature + false + Susan Slavney + The measurement temperature of the VSP thermo-electric cooler. + + + false + ASCII_Real + Units_of_Temperature + + + + + packet_timestamp + 1.0 + lcross.packet_timestamp + false + Susan Slavney + A 32-bit unsigned integer representing time from the epoch + Jan 1, 1980 in milliseconds. This counter resets every approximately + 50 days. + + + false + ASCII_Integer + + + + + vsp_bracket_number + 1.0 + lcross.vsp_bracket_number + false + Susan Slavney + When in bracket mode, the VSP captures three spectra in quick + succession. The bracket number indicates which of the three spectra are captured.. + + + false + ASCII_Integer + + + + + + + + MIR_Instrument_State + 1.0 + lcross.MIR_Instrument_State + Susan Slavney + Class with attributes specific to the MIR instrument on LCROSS. + false + false + + lcross.instrument_gain_state + attribute_of + 0 + 1 + + + lcross.missing_packet_flag + attribute_of + 0 + 1 + + + lcross.calibration_valid + attribute_of + 0 + 1 + + + + + NIR_Instrument_State + 1.0 + lcross.NIR_Instrument_State + Susan Slavney + Class with attributes specific to the NIR instrument on LCROSS. + false + false + + lcross.enhancement_mode + attribute_of + 0 + 1 + + + lcross.operating_setting_value + attribute_of + 0 + 1 + + + lcross.integration_time + attribute_of + 0 + 1 + + + lcross.gain_value + attribute_of + 0 + 1 + + + + + NSP_Instrument_State + 1.0 + lcross.NSP_Instrument_State + Susan Slavney + Class with attributes specific to the NSP instrument on LCROSS. + false + false + + lcross.saturation_flag + attribute_of + 0 + 1 + + + lcross.boresight_to_sun_angle + attribute_of + 0 + 1 + + + + + VSP_Instrument_State + 1.0 + lcross.VSP_Instrument_State + Susan Slavney + Class with attributes specific to the VSP instrument on LCROSS. + false + false + + lcross.saturation_flag + attribute_of + 0 + 1 + + + lcross.exposure_duration + attribute_of + 0 + 1 + + + lcross.tec_setpoint + attribute_of + 0 + 1 + + + lcross.tec_temperature + attribute_of + 0 + 1 + + + lcross.packet_timestamp + attribute_of + 0 + 1 + + + lcross.vsp_bracket_number + attribute_of + 0 + 1 + + + + + Mission_Parameters + 1.0 + lcross.Mission_Parameters + Susan Slavney + Container class for mission level attributes (i.e., common across all or most + instruments) and instrument specific classes. + false + false + + lcross.product_type + attribute_of + 0 + 1 + + + lcross.producer_institution_name + attribute_of + 0 + 1 + + + lcross.mission_phase_name + attribute_of + 0 + 1 + + + lcross.spacecraft_clock_start_count + attribute_of + 0 + 1 + + + lcross.spacecraft_clock_stop_count + attribute_of + 0 + 1 + + + lcross.intercept_point_latitude + attribute_of + 0 + 1 + + + lcross.intercept_point_longitude + attribute_of + 0 + 1 + + + lcross.instrument_temperature + attribute_of + 0 + 1 + + + lcross.instrument_temperature_count + attribute_of + 0 + 1 + + + + + LCROSS_Parameters + 1.0 + lcross.LCROSS_Parameters + Susan Slavney + Top level container class. + false + true + + lcross.Mission_Parameters + component_of + 1 + 1 + + + lcross.MIR_Instrument_State + component_of + 0 + 1 + + + lcross.NIR_Instrument_State + component_of + 0 + 1 + + + lcross.NSP_Instrument_State + component_of + 0 + 1 + + + lcross.VSP_Instrument_State + component_of + 0 + 1 + + + + + \ No newline at end of file diff --git a/model-lddtool/src/test/resources/github852/PDS4_LCROSS_IngestLDD_1100.xml b/model-lddtool/src/test/resources/github852/PDS4_LCROSS_IngestLDD_1100.xml new file mode 100644 index 00000000..a30ca57a --- /dev/null +++ b/model-lddtool/src/test/resources/github852/PDS4_LCROSS_IngestLDD_1100.xml @@ -0,0 +1,942 @@ + + + + + + + + LCROSS Mission Dictionary + 1.1.0.0 + Mission + Jennifer Ward + geo + lcross + + The LCROSS mission dictionary contains a class with attributes specific to the + LCROSS mission and instruments. This dictionary was created for the migration + of LCROSS data products from PDS3 to PDS4. + + Built with: lddtool -plJ PDS4_LCROSS_IngestLDD_1100.xml + + + 2024-11-20 + + + + + + product_type + 1.0 + lcross.product_type + false + Susan Slavney + + The product_type attributes identifies the type or category of a product within a + data set. + + + true + ASCII_Short_String_Collapsed + + Raw Image + A raw image product. + + + Calibrated Image + A radiometrically calibrated image product. + + + Raw Spectrum + A raw spectrum product. + + + Calibrated Spectrum + A radiometrically calibrated spectrum product. + + + Raw Data + Raw output from an instrument, usually in DN. + + + Calibrated Data + Calibrated data from an instrument. + + + + + + producer_name + 1.0 + lcross.producer_name + false + Susan Slavney + The name of the person who produced the data product. + + false + ASCII_Short_String_Collapsed + + + + + producer_institution_name + 1.0 + lcross.producer_institution_name + false + Susan Slavney + + The producer_institution_name element identifies a university, research center, + NASA center or other institution associated with the production of a data set. + + + false + ASCII_Short_String_Collapsed + + + + + mission_phase_name + 1.0 + lcross.mission_phase_name + false + Susan Slavney + + The mission_phase_name element provides the commonly-used identifier of a mission phase. + + + true + ASCII_Short_String_Collapsed + + Quicklook + Quicklook + + + Starfield + Starfield + + + Swingby + Swingby + + + Earthlook1 + Earthlook1 + + + Mirlook + Mirlook + + + Earthlook2 + Earthlook2 + + + Separation + Separation + + + Preimpact + Preimpact + + + Impact + Impact + + + + + + spacecraft_clock_start_count + 1.0 + lcross.spacecraft_clock_start_count + false + GEO + The spacecraft_clock_start_count attribute provides the value + of the spacecraft clock at the beginning of a time period of + interest. + + + false + ASCII_Short_String_Collapsed + 15 + 15 + + + + + spacecraft_clock_stop_count + 1.0 + lcross.spacecraft_clock_stop_count + false + GEO + The spacecraft_clock_stop_count attribute provides the value of the spacecraft + clock at the end of a time period of interest. + + + false + ASCII_Short_String_Collapsed + + + + + intercept_point_latitude + 1.0 + lcross.intercept_point_latitude + false + Susan Slavney + The intercept_point_latitude attribute is the latitude of a point on the + surface of a body. + + false + ASCII_Real + -90.0 + 90.0 + Units_of_Angle + + + + + intercept_point_longitude + 1.0 + lcross.intercept_point_longitude + false + Susan Slavney + The intercept_point_longitude attribute is the longitude of a point on the + surface of a body. + + false + ASCII_Real + 0.0 + 360.0 + Units_of_Angle + + + + + instrument_temperature + 1.0 + lcross.instrument_temperature + false + Susan Slavney + The instrument_temperature attribute provides the temperature, in degrees Celsius + of an instrument or some part of an instrument. + + false + ASCII_Real + Units_of_Temperature + + + + + instrument_temperature_count + 1.0 + lcross.instrument_temperature_count + false + Susan Slavney + The instrument_temperature_count attribute provides the temperature + of an instrument in raw counts or DN values. + + + false + ASCII_Integer + + + + + + + instrument_gain_state + 1.0 + lcross.instrument_gain_state + false + Susan Slavney + The instrument_gain_state specifies the instrument gain state, either High or Low. + + + true + ASCII_Short_String_Collapsed + + High + High + + + Low + Low + + + + + + missing_packet_flag + 1.0 + lcross.missing_packet_flag + false + Susan Slavney + The missing_packet_flag indicates whether the image is missing data. A missing + packet appears as a horizontal bar 8 pixels high of zero data. + + + true + ASCII_Short_String_Collapsed + + Yes + Packets are missing. + + + No + No packets were missed. + + + + + + calibration_valid + 1.0 + lcross.calibration_valid + false + Susan Slavney + The response of the mid-IR cameras exhibited a startup transient. + The calibration is valid only after this transient had settled. This attribute + indicates whether the image was taken before or after this point. Values are + Yes or No. + + + true + ASCII_Short_String_Collapsed + + Yes + Calibration is valid. + + + No + Calibration is not valid. + + + + + + + + enhancement_mode + 1.0 + lcross.enhancement_mode + false + Susan Slavney + This attribute indicates whether onboard image stretching was enabled + or disabled. Values are On or Off. + + + true + ASCII_Short_String_Collapsed + + On + Onboard image enhancement was enabled. + + + Off + Onboard image enhancement was disabled. + + + + + + operating_setting_value + 1.0 + lcross.operating_setting_value + false + Susan Slavney + The operating setting value determines the integration time and gain. + Values range from 0 to 15. + + + false + ASCII_Integer + 0 + 15 + + + + + integration_time + 1.0 + lcross.integration_time + false + Susan Slavney + The integration time in msec. + + + false + ASCII_Integer + 0 + Units_of_Time + + + + + gain_value + 1.0 + lcross.gain_value + false + Susan Slavney + The focal plane sensitivity in electrons per count. Value is + approximate and inferred from the operating setting value and factory + definitions. + + + false + ASCII_Integer + 0 + + + + + + + saturation_flag + 1.0 + lcross.saturation_flag + false + Susan Slavney + Indicates whether a spectra is saturated based on a mechanical test. + + + true + ASCII_Short_String_Collapsed + + Yes + Saturation noted. + + + No + No saturation. + + + + + + boresight_to_sun_angle + 1.0 + lcross.boresight_to_sun_angle + false + Susan Slavney + Angle between the instrument boresight vector and the spacecraft to sun vector + in degrees. + + + false + ASCII_Real + Units_of_Angle + + + + + + + exposure_duration + 1.0 + lcross.exposure_duration + false + Susan Slavney + The time interval between the opening and closing of an instrument + aperture. + + + false + ASCII_Real + + + + + tec_setpoint + 1.0 + lcross.tec_setpoint + false + Susan Slavney + The setpoint temperature of the VSP thermo-electric cooler. + + + false + ASCII_Real + Units_of_Temperature + + + + + tec_temperature + 1.0 + lcross.tec_temperature + false + Susan Slavney + The measurement temperature of the VSP thermo-electric cooler. + + + false + ASCII_Real + Units_of_Temperature + + + + + packet_timestamp + 1.0 + lcross.packet_timestamp + false + Susan Slavney + A 32-bit unsigned integer representing time from the epoch + Jan 1, 1980 in milliseconds. This counter resets every approximately + 50 days. + + + false + ASCII_Integer + + + + + vsp_bracket_number + 1.0 + lcross.vsp_bracket_number + false + Susan Slavney + When in bracket mode, the VSP captures three spectra in quick + succession. The bracket number indicates which of the three spectra are captured.. + + + false + ASCII_Integer + + + + + + + right_ascension_angle + 1.0 + lcross.right_ascension + false + Susan Slavney + The right_ascension_angle attribute provides the + value of right ascension (RA) as an angle. Right ascension is + measured from the vernal equinox or the first point of Aries, + which is the place on the celestial sphere where the Sun crosses + the celestial equator from south to north at the March equinox. + Right ascension is measured continuously in a full circle from + that equinox towards the east. Right ascension is used in + conjunction with the declination attribute to specify a point on + the sky. + + false + ASCII_Real + Units_of_Angle + + + + + declination + 1.0 + lcross.declination + false + Susan Slavney + The declination_angle (Dec) attribute provides + the value of an angle on the celestial sphere, measured north + from the celestial equator to the point in question. (For points + south of the celestial equator, negative values are used.) + Declination is used in conjunction with right ascension + (right_ascension_angle) to specify + a point on the sky. + + false + ASCII_Real + Units_of_Angle + + + + + exposure_length + 1.0 + lcross.exposure_length + false + Susan Slavney + Provides the length of time for an exposure. + + false + ASCII_Real + Units_of_Time + + + + + + filter_name + 1.0 + lcross.filter_name + false + Susan Slavney + The commonly used name of a filter the is part of an imaging system. + + false + ASCII_Short_String_Collapsed + + + + + center_filter_wavelength + 1.0 + lcross.center_filter_wavelength + false + Susan Slavney + The center wavelength of a filter used in an imaging system. + + false + ASCII_Real + Units_of_Length + + + + + + + + + MIR_Instrument_State + 1.0 + lcross.MIR_Instrument_State + Susan Slavney + Class with attributes specific to the MIR instrument on LCROSS. + false + false + + lcross.instrument_gain_state + attribute_of + 0 + 1 + + + lcross.missing_packet_flag + attribute_of + 0 + 1 + + + lcross.calibration_valid + attribute_of + 0 + 1 + + + + + NIR_Instrument_State + 1.0 + lcross.NIR_Instrument_State + Susan Slavney + Class with attributes specific to the NIR instrument on LCROSS. + false + false + + lcross.enhancement_mode + attribute_of + 0 + 1 + + + lcross.operating_setting_value + attribute_of + 0 + 1 + + + lcross.integration_time + attribute_of + 0 + 1 + + + lcross.gain_value + attribute_of + 0 + 1 + + + + + NSP_Instrument_State + 1.0 + lcross.NSP_Instrument_State + Susan Slavney + Class with attributes specific to the NSP instrument on LCROSS. + false + false + + lcross.saturation_flag + attribute_of + 0 + 1 + + + lcross.boresight_to_sun_angle + attribute_of + 0 + 1 + + + + + VSP_Instrument_State + 1.0 + lcross.VSP_Instrument_State + Susan Slavney + Class with attributes specific to the VSP instrument on LCROSS. + false + false + + lcross.saturation_flag + attribute_of + 0 + 1 + + + lcross.exposure_duration + attribute_of + 0 + 1 + + + lcross.tec_setpoint + attribute_of + 0 + 1 + + + lcross.tec_temperature + attribute_of + 0 + 1 + + + lcross.packet_timestamp + attribute_of + 0 + 1 + + + lcross.vsp_bracket_number + attribute_of + 0 + 1 + + + + + Ground_Based_Parameters + 1.0 + lcross.Ground_Based_Parameters + Susan Slavney + Container class for ground-based observation parameters. + false + false + + lcross.right_ascension + attribute_of + 0 + 1 + + + lcross.declination + attribute_of + 0 + 1 + + + lcross.exposure_length + attribute_of + 0 + 1 + + + lcross.filter_name + attribute_of + 0 + 1 + + + lcross.center_filter_wavelength + attribute_of + 0 + 1 + + + + + Mission_Parameters + 1.0 + lcross.Mission_Parameters + Susan Slavney + Container class for mission level attributes (i.e., common across all or most + instruments) and instrument specific classes. + false + false + + lcross.product_type + attribute_of + 0 + 1 + + + lcross.producer_name + attribute_of + 0 + 1 + + + lcross.producer_institution_name + attribute_of + 0 + 1 + + + lcross.mission_phase_name + attribute_of + 0 + 1 + + + lcross.spacecraft_clock_start_count + attribute_of + 0 + 1 + + + lcross.spacecraft_clock_stop_count + attribute_of + 0 + 1 + + + lcross.intercept_point_latitude + attribute_of + 0 + 1 + + + lcross.intercept_point_longitude + attribute_of + 0 + 1 + + + lcross.instrument_temperature + attribute_of + 0 + 1 + + + lcross.instrument_temperature_count + attribute_of + 0 + 1 + + + + + LCROSS_Parameters + 1.0 + lcross.LCROSS_Parameters + Susan Slavney + Top level container class. + false + true + + lcross.Mission_Parameters + component_of + 1 + 1 + + + lcross.MIR_Instrument_State + component_of + 0 + 1 + + + lcross.NIR_Instrument_State + component_of + 0 + 1 + + + lcross.NSP_Instrument_State + component_of + 0 + 1 + + + lcross.VSP_Instrument_State + component_of + 0 + 1 + + + lcross.Ground_Based_Parameters + component_of + 0 + 1 + + + + + \ No newline at end of file diff --git a/model-lddtool/src/test/resources/github852/lcross_nir2_cal_20090622162743896.xml b/model-lddtool/src/test/resources/github852/lcross_nir2_cal_20090622162743896.xml new file mode 100644 index 00000000..64f3c5c7 --- /dev/null +++ b/model-lddtool/src/test/resources/github852/lcross_nir2_cal_20090622162743896.xml @@ -0,0 +1,142 @@ + + + + + + + + + urn:nasa:pds:lcross_impactor:data_nir2:lcross_nir2_cal_20090622162743896 + 1.0 + LCROSS NIR2 Calibrated Image: lcross_nir2_cal_20090622162743896 + 1.13.0.0 + Product_Observational + + + 2020-08-28 + 1.0 + Initial version migrated from PDS3. + + + + + + 2009-06-22T16:27:43.880Z + 2009-06-22T16:27:43.896Z + + + Lunar Crater Observation and Sensing Satellite + Mission + + urn:nasa:pds:context:investigation:mission.lunar_crater_observation_and_sensing_satellite + data_to_investigation + + + + + Lunar Crater Observation and Sensing Satellite + Spacecraft + + urn:nasa:pds:context:instrument_host:spacecraft.lcross + is_instrument_host + + + + Near Infrared Camera 2 + Instrument + + urn:nasa:pds:context:instrument:nir2.lcross + is_instrument + + + + + Calibration + Calibrator + + + + + + Calibrated Image + Ames Research Center + Starfield + 000002650520880 + 000002650520896 + 20.91 + 3064 + + + Off + 15 + 16240 + 18 + + + + + + + + Image_Object + display_settings_to_array + + + Sample + Left to Right + Line + Top to Bottom + + + + + + + + lcross_nir2_cal_20090622162743896.img + 2009-06-22T16:27:43.896 + + + Image_Object + 0 + 2 + Last Index Fastest + + IEEE754LSBSingle + WATT*M**-2*SR**-1 + 1 + 0 + + + Line + 486 + 1 + + + Sample + 720 + 2 + + + + + + + lcross_nir2_cal_20090622162743896.lbl + + + 0 + PDS3 + Original PDS3 label + Carriage-Return Line-Feed + + +