Skip to content

DSWx‐S1 Beta Acceptance Test Instructions

Scott Collins edited this page Jan 17, 2024 · 1 revision

This page contains instructions for performing Acceptance Testing for the DSWx-S1 Beta delivery from the OPERA-ADT team. These instructions assume the user has access to the JPL FN-Artifactory, and Docker is installed on their local machine. Optionally, access to the opera-dev-pge AWS machine allows for significantly faster downloads from Artifactory.

Acquiring the DSWx-S1 Interface Docker Image

The image is currently hosted on JPL FN-Artifactory, which requires JPL VPN access and JPL credentials. You may also need to be added to the gov.nasa.jpl.opera.adt organization.

Once you have access, the container tarball delivery is available under general/gov/nasa/jpl/opera/adt/dswx_s1/r2.1/beta/dockerimg_dswx_s1_beta_0.2.1.tar. Sample inputs and outputs are available under general/gov/nasa/jpl/opera/adt/dswx_s1/r2.1/interface/sample_data.zip. Useful background documentation is also available under general/gov/nasa/jpl/opera/adt/dswx_s1/r1/beta/documents.

Download both images to a location on your local machine. This location will be referred to throughout this instructions as <DSWX-S1_DIR> Note that the sample data is quite large, so the download from Artifactory can take some time.

Loading the image into Docker

The first step in running the DSWx-S1 image is to load it into Docker via the following command:

    docker load -i <DSWX-S1_DIR>/dockerimg_dswx_s1_beta_0.2.1.tar

Use the following command to verify the Docker image with the name opera/dswx-s1 and the tag beta_0.2.1 has been added to your Docker repository:

    docker image ls 

Preparing the test data

Once the sample_data.zip file is downloaded to your local machine, unpack it to <DSWX-S1_DIR>:

    cd <DSWX-S1_DIR>; unzip sample_data.zip

This will create a sample_data directory within <DSWX-S1_DIR> containing the following files/directories:

    expected_output/
    input_data/
    output_dir/
    reconfig/
    scratch/
    scratch_dir/
    dswx_s1.yaml

In order to execute the SAS, the input file directory, runconfig, scratch and output locations will be mounted into the container instance as Docker Volumes. To help streamline this process, we recommend making the following changes within the interface_share directory:

  • Create a directory named runconfig, and copy the existing runconfig YAML file into it:

      `mkdir -p <DSWX-S1_DIR>/sample_data/runconfig`
    
      `cp <DSWX-S1_DIR>/sample/dswx_s1.yaml <DSWX-S1_DIR>/sample_data/runconfig/dswx_s1.yaml`
    
  • Make sure the output and scratch directories have write permissions set

      `chmod ga+w output_dir/ scratch/`
    

Executing the DSWx-S1 container on the sample datasets

We're now ready to execute the DSWX-S1 Interface. Run the following the command to kick off execution with the test assets:

    docker run --rm -u $(id -u):$(id -g) \
      -v <DSWX-S1_DIR>/sample_data/runconfig:/home/dswx_user/runconfig:ro \
      -v <DSWX-S1_DIR>/sample_data/input_data:/home/dswx_user/input_data:ro \
      -v <DSWX-S1_DIR>/sample_data/output_dir:/home/dswx_user/output_dir \
      -v <DSWX-S1_DIR>/sample_data/input_dir:/home/dswx_user/scratch/input_dir \
      -v <DSWX-S1_DIR>/sample_data/scratch:/home/dswx_user/scratch \
      -i --tty opera/dswx-s1:beta_0.2.1 sh -ci "dswx_s1.py /home/dswx_user/scratch/runconfig/dswx_s1.yaml \
         --log /home/dswx_user/scratch/output_dir/dswx_s1_0.2.1.log"

Execution should be complete in under 5 minutes. Once complete, you should see 24 files in <DSWX-S1_DIR>/sample_data/output_dir. Files can be categorized into sets of three GeoTIFF files sharing the same time stamps (for more information see OPERA_DSWX_S1_SAS_Design_Doc_IF.docx in the 'documents' directory, optionally downloaded from Artifactory):

      OPERA_L3_DSWx-S1_T18MVT_20200702T231843Z_20231018T194737Z_S1B_30_v0.1_B01_BWTR.tif
      OPERA_L3_DSWx-S1_T18MVT_20200702T231843Z_20231018T194737Z_S1B_30_v0.1_B02_WTR.tif
      OPERA_L3_DSWx-S1_T18MVT_20200702T231843Z_20231018T194737Z_S1B_30_v0.1_B03_CONF.tif

With this version a log file (dswx_s1.0.2.1.log) is written to the output_dir.

There is a comparison script available. It is located inside the docker image, opera/dswx-s1,

in the directory /home/dswx_user/OPERA/DSWX-SAR/src/dswx_sar/dswx_comparison.py.

If you are running on opera-dev-pge you can fetch it into your local file system. In order to accomplish that you must do the following using two separate terminal sessions on opera-dev-pge.

         In the first terminal session you do the following steps: (The outputs are representative)
         %  docker container ls -a
         CONTAINER ID          IMAGE                   COMMAND               CREATED       STATUS                    PORTS     NAMES
        6a57f0d95eaf   opera/dswx-s1:beta_0.2.1   "conda run --no-capt…"   3 weeks ago   Exited (130) 3 weeks ago           52e0f6615238
         $ docker run -it --name=6a57f0d95eaf  opera/dswx-s1:beta_0.2.1  /bin/bash% 
         (DSWX-SAR) [dswx_user@afaccc0f30ae scratch]$ ls OPERA/DSWX-SAR/src/dswx_sar/
         many files
         dswx_comparison.py

         In the second terminal session you do the following steps:
         $ cd /data/<user>
         $ mkdir from_docker
         $ cd from_docker
         $ docker cp 6a57f0d95eaf:/home/dswx_user/OPERA/DSWX-SAR/src/dswx_sar/dswx_comparison.py .
                                           Successfully copied 9.73kB to /data/rjb/from_docker/.
         $ ls -l
         total 8
          -rw-r--r-- 1 rjb 7750 Oct  5 22:01 dswx_comparison.py

        [Now the comparison script is on your local file system)
         copy it to the directory you want do the validation test on sample_data, say
         /data/<user>/dswx_s1_0.2.1 
        You are ready to process.

Running the Quality Assurance Test

The comparison script can be run on the opera-dev-pge linux box or transferred to you local computer. In either case, the directory structure for testing will be as described above in "Preparing the test data"

     cd to <DSWX-S1_DIR>/sample_data
     cp dswx_comparison.py into it
     cp dswx_diff_files.py into it from ???

Your structure should look like:

     ls -1 <DSWX-S1_DIR>
         diff_dswx_files.py
         dswx_comparison.py
         sample_data/
     ls -1 <DSWX_S1_DIR>/sample_data
         dswx_s1.yaml
         expected_output/
         input_data/
         input_dir/
         output_dir/
         runconfig/
         scratch/
         scratch_dir/

perform the test by executing

         $ python3 diff_dswx_files.py sample_data/expected_output  sample_data/output_dir
             (the test results will scroll down)
             indicating  [OK] for Pass
                         [FAIL] for Fail

          or if you want a text file log called result.log:
         $ python3 diff_dswx_files.py sample_data/expected_output  sample_data/output_dir 2>&1 results.log

Known Issues with this version

  • On running the above tests 3 FAILS were noted:

          Comparing files:
            file 1: sample_data/expected_output/OPERA_L3_DSWx-S1_T18MWU_20200702T231843Z_20231005T233435Z_S1B_30_v0.1_B01_BWTR.tif
            file 2: sample_data/output_dir/OPERA_L3_DSWx-S1_T18MWU_20200702T231843Z_20231018T194737Z_S1B_30_v0.1_B01_BWTR.tif
          [OK]Comparing number of bands
          Comparing DSWx bands...
          [**FAIL**]     Band 1 - Binary Water classification (BWTR)"
           * input 1 has value "1" in position (x: 1517, y: 606) whereas input 2 has value "0" in the same position.
          [OK]Comparing geotransform
          [OK]Comparing projection
          [OK]Comparing metadata
    
          Comparing files:
            file 1: sample_data/expected_output/OPERA_L3_DSWx-S1_T18MWU_20200702T231843Z_20231005T233435Z_S1B_30_v0.1_B02_WTR.tif
            file 2: sample_data/output_dir/OPERA_L3_DSWx-S1_T18MWU_20200702T231843Z_20231018T194737Z_S1B_30_v0.1_B02_WTR.tif
          [OK]Comparing number of bands
          Comparing DSWx bands...
          [**FAIL**]     Band 1 - Water classification (WTR)"
          * input 1 has value "1" in position (x: 1517, y: 606) whereas input 2 has value "0" in the same position.
          [OK]Comparing geotransform
          [OK]Comparing projection
          [OK]Comparing metadata
    
          Comparing files:
            file 1: sample_data/expected_output/OPERA_L3_DSWx-S1_T18MWU_20200702T231843Z_20231005T233435Z_S1B_30_v0.1_B03_CONF.tif
            file 2: sample_data/output_dir/OPERA_L3_DSWx-S1_T18MWU_20200702T231843Z_20231018T194737Z_S1B_30_v0.1_B03_CONF.tif
          [OK]Comparing number of bands
          Comparing DSWx bands...
          [**FAIL**]     Band 1 - Confidence values (CONF)"
          * input 1 has value "54" in position (x: 1445, y: 470) whereas input 2 has value "53" in the same position.
         [OK]Comparing geotransform
         [OK]Comparing projection
         [OK]Comparing metadata
    
Clone this wiki locally