<?xml version="1.0" encoding="utf-8"?>
<?xml-model
    href="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1J00.sch"
	  schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-model href="https://pds.nasa.gov/pds4/proc/v1/PDS4_PROC_1J00_1300.sch"
      schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-model href="https://pds.nasa.gov/pds4/mission/clps/v1/PDS4_CLPS_1J00_1100.sch"
    schematypens="http://purl.oclc.org/dsdl/schematron"?>

<Product_Observational
	xmlns="http://pds.nasa.gov/pds4/pds/v1"
    xmlns:proc="http://pds.nasa.gov/pds4/proc/v1"
    xmlns:clps="http://pds.nasa.gov/pds4/mission/clps/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_1J00.xsd
                        http://pds.nasa.gov/pds4/proc/v1
                        https://pds.nasa.gov/pds4/proc/v1/PDS4_PROC_1J00_1300.xsd
                        http://pds.nasa.gov/pds4/mission/clps/v1
                        https://pds.nasa.gov/pds4/mission/clps/v1/PDS4_CLPS_1J00_1100.xsd
                        ">
  <Identification_Area>
    <logical_identifier>urn:nasa:pds:clps_to_2ab_nss:data_science_raw:nss_sci_raw_20240114_205151</logical_identifier>
    <version_id>1.0</version_id>
    <title>TO2-AB Raw NSS Spectra: nss_sci_raw_20240114_205151</title>
    <information_model_version>1.19.0.0</information_model_version>
    <product_class>Product_Observational</product_class>

  <Modification_History>
    <Modification_Detail>
      <modification_date>2024-07-19</modification_date>
      <version_id>1.0</version_id>
      <description>First release of TO-2AB NSS data.</description>
    </Modification_Detail>
  </Modification_History>
  </Identification_Area>

  <Observation_Area>
    <Time_Coordinates>
      <start_date_time>2024-01-14T20:51:50.521Z</start_date_time>
      <stop_date_time>2024-01-14T22:53:27.492Z</stop_date_time>
    </Time_Coordinates>

    <Investigation_Area>
      <name>CLPS Task Order 2AB</name>
      <type>Mission</type>
      <Internal_Reference>
        <lid_reference>urn:nasa:pds:context:investigation:mission.clps_to_2ab</lid_reference>
        <reference_type>data_to_investigation</reference_type>
      </Internal_Reference>
    </Investigation_Area>

    <Observing_System>
      <Observing_System_Component>
        <name>Peregrine Lunar Lander</name>
        <type>Host</type>
        <description>Astrobotic Peregrine Lunar Lander (TO2-AB)</description>
        <Internal_Reference>
          <lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.clps_to_2ab_pll</lid_reference>
          <reference_type>is_instrument_host</reference_type>
        </Internal_Reference>
      </Observing_System_Component>
      <Observing_System_Component>
        <name>CLPS Task Order 2AB Neutron Spectrometer System (NSS)</name>
        <type>Instrument</type>
        <description>Neutron Spectrometer System (NSS) on TO2-AB lander</description>
        <Internal_Reference>
          <lid_reference>urn:nasa:pds:context:instrument:clps_to_2ab_pll.nss</lid_reference>
          <reference_type>is_instrument</reference_type>
        </Internal_Reference>
      </Observing_System_Component>
    </Observing_System>

    <Target_Identification>
      <name>Moon</name>
      <type>Satellite</type>
      <Internal_Reference>
        <lid_reference>urn:nasa:pds:context:target:satellite.earth.moon</lid_reference>
        <reference_type>data_to_target</reference_type>
      </Internal_Reference>
    </Target_Identification>

    <Mission_Area>
      <clps:CLPS_Parameters>
        <clps:CLPS_Delivery_Information>
          <clps:nasa_delivery_name>TO_2AB</clps:nasa_delivery_name>
          <clps:vendor>Astrobotic</clps:vendor>
          <clps:vendor_mission_name>Peregrine Mission 1</clps:vendor_mission_name>
          <clps:lunar_lander_name>Peregrine Lunar Lander</clps:lunar_lander_name>
          <clps:project_scientist>Paul Niles</clps:project_scientist>
        </clps:CLPS_Delivery_Information>
        <clps:CLPS_Observation_Information>
          <clps:release_number>0001</clps:release_number>
          <clps:mission_phase_name>CRUISE AND APPROACH</clps:mission_phase_name>
          <clps:producer_institution_name>Applied Physics Laboratory</clps:producer_institution_name>
        </clps:CLPS_Observation_Information>
      </clps:CLPS_Parameters>
    </Mission_Area>

    <Discipline_Area>
      <proc:Processing_Information>
        <Local_Internal_Reference>
          <local_identifier_reference>data_science_raw</local_identifier_reference>
          <local_reference_type>processing_information_to_data_object</local_reference_type>
        </Local_Internal_Reference>
        <proc:Process>
          <proc:Software>
            <proc:name>ASTROBOTIC_NSS_RAW_PIPELINE</proc:name>
            <proc:software_version_id>Version 1.0</proc:software_version_id>
          </proc:Software>
        </proc:Process>
      </proc:Processing_Information>
    </Discipline_Area>
  </Observation_Area>

  <Reference_List>
    <Internal_Reference>
      <lid_reference>urn:nasa:pds:clps_to_2ab_nss:document:clps_to_2ab_nss_ug</lid_reference>
      <reference_type>data_to_document</reference_type>
      <comment>CLPS TO_2AB NSS User Guide document which describes the data
         products in this collection.</comment>
    </Internal_Reference>
    <Internal_Reference>
      <lidvid_reference>urn:nasa:pds:clps_to_2ab_nss:data_science_cal:hv_table::1.0</lidvid_reference>
      <reference_type>data_to_calibration_product</reference_type>
      <comment>High-Voltage (HV) lookup table used in NSS calibration pipeline.</comment>
    </Internal_Reference>
    <Internal_Reference>
      <lidvid_reference>urn:nasa:pds:clps_to_2ab_nss:data_science_cal:thermistor_table::1.0</lidvid_reference>
      <reference_type>data_to_calibration_product</reference_type>
      <comment>Thermistor lookup table used in NSS calibration pipeline.</comment>
    </Internal_Reference>
  </Reference_List>

  <File_Area_Observational>
    <File>
      <file_name>nss_sci_raw_20240114_205151.csv</file_name>
      <comment>File containing raw NSS Science data with ASCII header</comment>
    </File>
    <Header>
      <offset unit="byte">0</offset>
      <object_length unit="byte">1158</object_length>
      <parsing_standard_id>7-Bit ASCII Text</parsing_standard_id>
      <description>Column headings</description>
    </Header>
    <Table_Delimited>
      <local_identifier>data_science_raw</local_identifier>
      <offset unit="byte">1158</offset>
      <parsing_standard_id>PDS DSV 1</parsing_standard_id>
      <description>
        Raw Science Data from NSS aboard Astrobotic Peregrine Mission-1 Lander
      </description>
      <records>7298</records>
      <record_delimiter>Carriage-Return Line-Feed</record_delimiter>
      <field_delimiter>Comma</field_delimiter>

      <Record_Delimited>
        <fields>10</fields>
        <groups>2</groups>

        <Field_Delimited>
          <name>datetime</name>
          <field_number>1</field_number>
          <data_type>ASCII_Date_Time_YMD</data_type>
          <description>
            UTC Date time when record was collected, YYYY-MM-DDTHH:mm:ss.fffZ format,  example : 2024-01-08T14:02:31.595Z
          </description>
        </Field_Delimited>

        <Group_Field_Delimited>
          <name>Det1_PHA_channels</name>
          <group_number>1</group_number>
          <repetitions>32</repetitions>
          <fields>1</fields>
          <groups>0</groups>
          <description>Number of events recorded per spectral channel. Note: this field is repeated 32 times,
            one for each of 32 channels corresponding to deposited energy in Detector 1.
            “chXX” refers to each channel, starting from 0.</description>
          <Field_Delimited>
            <name>Det1_PHA_channels</name>
            <data_type>ASCII_Integer</data_type>
            <unit>counts/bin</unit>
          </Field_Delimited>
        </Group_Field_Delimited>

        <Group_Field_Delimited>
          <name>Det2_PHA_channels</name>
          <group_number>2</group_number>
          <repetitions>32</repetitions>
          <fields>1</fields>
          <groups>0</groups>
          <description>Number of events recorded per spectral channel. Note: this field is repeated 32 times,
            one for each of 32 channels corresponding to deposited energy in Detector 2.
            “chXX” refers to each channel, starting from 0.</description>

          <Field_Delimited>
            <name>Det2_PHA_channels</name>
            <data_type>ASCII_Integer</data_type>
            <unit>counts/bin</unit>
          </Field_Delimited>
        </Group_Field_Delimited>

        <Field_Delimited>
          <name>Det1_ScalarCounts</name>
          <field_number>2</field_number>
          <data_type>ASCII_Integer</data_type>
          <description>
            Number of events crossing a commanded threshold discriminator level.
          </description>
        </Field_Delimited>

        <Field_Delimited>
          <name>Det2_ScalarCounts</name>
          <field_number>3</field_number>
          <data_type>ASCII_Integer</data_type>
          <description>
            Number of events crossing a commanded threshold discriminator level.
          </description>
        </Field_Delimited>

        <Field_Delimited>
          <name>Det1_Threshold_Index</name>
          <field_number>4</field_number>
          <data_type>ASCII_Integer</data_type>
          <description>
            Discriminator threshold for Detector 1 events.  Extracted bits 2 – 0 from byte 72.
            Values are transformed to keV in calibrated processing.
          </description>
        </Field_Delimited>

        <Field_Delimited>
          <name>Det2_Threshold_Index</name>
          <field_number>5</field_number>
          <data_type>ASCII_Integer</data_type>
          <description>
            Discriminator threshold for Detector 1 events.  Extracted bits 2 – 0 from byte 72.
            Values are transformed to keV in calibrated processing.
          </description>
        </Field_Delimited>

        <Field_Delimited>
          <name>High_Voltage_Setting_line_number</name>
          <field_number>6</field_number>
          <data_type>ASCII_Integer</data_type>
          <description>
            Line number in the NSS high-voltage parameter lookup table, hv_table.csv, of the commanded HV setting.
          </description>
        </Field_Delimited>

        <Field_Delimited>
          <name>High_Voltage_value_line_number</name>
          <field_number>7</field_number>
          <data_type>ASCII_Integer</data_type>
          <description>
            Line number in the NSS high-voltage parameter lookup table, hv_table.csv, of the actual HV value.
          </description>
        </Field_Delimited>

        <Field_Delimited>
          <name>Sensor_Module_Board_Temperature_line_number</name>
          <field_number>8</field_number>
          <data_type>ASCII_Integer</data_type>
          <description>
            Line number in the NSS thermistor lookup table, thermistor_table.csv. The index starts at 0,
            hence a value of 0 corresponds to the first line in the lookup table, a value of 1 corresponds to the
            second line in the lookup table, etc.
          </description>
        </Field_Delimited>

        <Field_Delimited>
          <name>Data_Processing_Module_Board_Temperature_line_number</name>
          <field_number>9</field_number>
          <data_type>ASCII_Integer</data_type>
          <description>
            Line number in the NSS thermistor lookup table, thermistor_table.csv. The index starts at 0,
            hence a value of 0 corresponds to the first line in the lookup table, a value of 1 corresponds to the
            second line in the lookup table, etc.
          </description>
        </Field_Delimited>

        <Field_Delimited>
          <name>quality_flag</name>
          <field_number>10</field_number>
          <data_type>ASCII_String</data_type>
          <description>
            Number indicating any off-nominal conditions during the measurement. If present, multiple values will be encoded as a comma-separated list. Possible values are:
            0: Sensor module powered off
            1: Nominal operations
            2: Watchdog reset toggle at 1
            3: Off nominal SM temperature (outside of AFT)
            4: Off nominal DPM temperature (outside of AFT)
            5: Off nominal high voltage (+/- 20 V)
            6: Off nominal component voltage (+/- 1 V)
            7: Solar particle event
            8: Missing data packets
            9: Commanded parameter change causes high voltage change

            Any data with a value other than 1 should be treated with caution when used for scientific interpretation.
          </description>
        </Field_Delimited>

      </Record_Delimited>
    </Table_Delimited>
  </File_Area_Observational>
</Product_Observational>