Differences between revisions 1 and 49 (spanning 48 versions)
Revision 1 as of 2018-05-10 15:41:06
Size: 4600
Editor: EricPalmer
Comment:
Revision 49 as of 2018-06-19 09:03:48
Size: 13158
Editor: EricPalmer
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= 1st Annual PRI Workshop on Image-BAsed Modeling and Navigation for Space Applications = = 1st Annual PRI Workshop on Image-Based Modeling and Navigation for Space Applications =
Line 4: Line 4:
Welcome to the 1st Annual RPI Workshop on Image-Based Modeling and Navigation for Space Applications. This is a persistent webpages (will continue to exists after the training) that contains the information you need to get ready and the lesson info.

----
Line 7: Line 9:
 Goals
* Bring the students to the "SPC Training Level 2"
  * Provide enough training to new personal to be able to directly and substantively help an experienced person build a shape model
 * Bring the students to the "SPC Training Level 2" [[TrainingLevels]]
  * Provide enough SPC hand-on skills that basic shape models can be built
Line 11: Line 12:
  * Provide a systematic review of key SPC concepts and techniques to aid more experienced users understand subtle, but important, SPC dependencies
  * It will be insufficient to fully train new personal to a level in which they could run the Hayabusa 2 encounter without support, but it will go along way to improving their confidence with the program
  * It will be insufficient to fully train new personal to a level in which they could run an entire mission without support
Line 17: Line 17:
  * Perform tiling   * Perform tiling (both globally and BIGMAP)
Line 20: Line 20:

 * Optional, depending on time and understanding
Line 25: Line 23:
 * Practice
  * Create landmarks
  * Try out error-injected images into the calibration test



 * Practice. A key component of this training is to practice. The practice allows for key concepts to become understood at a sufficient level to allow for more advanced concepts to make sense.



----
Line 34: Line 30:
 * Stuff to read Because class time is limited, it is important to get the software and data installed before you show up to the conference. I will be available during the conference to help troubleshoot problems and help get your system functional before the class starts Wednesday morning. Once the class starts, I won't be able to ignore everyone else in the class to fix an install.

To maximize your learning in the class, I provide some information that will be beneficial to review.

 * Stuff to read (links below)
Line 36: Line 36:
   * Palmer's basic write up    * Palmer's 2016, sections 2.4 and 5

== Required Tasks To Complete Before Class Starts ==

 * Sign the Licensing Agreement. This must be on file before the software can be distributed. //Complete//
 * Download SPC software -- encrypted link will be sent only to class attendees
 * Compile and install SPC. [[https://oort.psi.edu/public/1a09b8/dl/spc_v3.1B2.zip]] (password will be sent via a separate email)
   * [[Installing SPC Instructions]]
 * Download sample data. The data volume is large, so it is important to do it ahead of time. Some of the files need to be expanded and moved.

   * Starting directory & SPICE (600MB)
     * You can put this directory anywhere (called topSPC). It is the base directory for the SPC work.
     * https://oort.psi.edu/public/98a344
     * You can go into the topSPC/ORex/DATA directory and uncompress the files using "gunzip *.gz"

   * Images:
     * I've broken them up into two parts to make them easier to download and compressed them. These <filename>.DAT files need to be moved into the topSPC/IMAGEFILES directory.
     * Approach (300MB): https://oort.psi.edu/public/1b733b
     * Preliminary Survey (1GB): https://oort.psi.edu/public/d0e1ec
     * You can uncompress the files using "uncompress *.Z"

   * Support Tools:
     * Over time, I have found that there are many nice helpers for SPC that do well if organized into its own area. They include scripts, programs and image lists. I've included some here. I suggest putting these two directories in /opt/local/spc/
     * https://oort.psi.edu/public/67588b



== Extra software that is useful ==
Line 39: Line 66:
   * XCode - Apple's main compiler for OS X. It has many libraries you need. - https://developer.apple.com/xcode/
   * gfortran - https://gcc.gnu.org/wiki/GFortranBinaries#MacOS
   * spicelib - http://naif.jpl.nasa.gov/naif/toolkit_FORTRAN.html
Line 46: Line 70:




== Activities ==
 * Day 1, Wednesday

  * Introductions and facilities
   * [[attachment:NDA.doc]]
   * Check the install the software and test cases
   * Introduce SPC and Bob

  * Intro SPC [[attachment:Lesson_1.pdf]]
   * Show wiki
   * Provide documentations, unix help

  * Theory of SPC

  * Basic SPC operation
   * Build landmarks [[Lesson 2]]
   * Fixing landmarks
   * Landmark management
   * [[Notes from day 1]]

 * Day 2, Thursday
  * Discuss training levels [[Training_Notes#Training_levels]]

  * Review SPC from yesterday
   * Make more landmarks [[Notes Day 2]]
   * Manual shift
   * Global shift

  * Install spc_tools and [[updateDisplay]]
   * Batch shift

  * Introduce Lat/Lon tiling
   * [[make_scriptT]]
   * [[find_nofitT]]

  * Show
   *"find" in lithos
   * Show [[register]]

 * Day 3, Thursday
 * SPC tools - This is a suite of tools that make measuring pixel/line locations and offsets easier. This is not required and class time won't be used for installing this. Install instructions are coming soon
   * apache -- The is installed as default for most UNIX (and Mac) systems.
   * spc_tool javascript libraries
   * updateDisplay.sh - script to convert SPC output to a web-accessible format
   * How to install and run - [[SPC-GUI-tools]]
  
----

== Day 1 ==

 * Introductions

 *Discussion of the Wiki/User’s manual
 *Unix file layout and paths -- [[File System Setup]]
 * executables
 * source code
 * helpers
 * scripts
 * support
 
 * SPC files
 * working
 * mapfile/landmark files
 * kernels
 * images

 * Show Theory of SPC -- https://sbib.psi.edu/spc_wiki/Training_JAXA_Aug2016?action=AttachFile&do=view&target=Lesson_1.pdf

== Day 1 Practical - It's all about LITHOS ==

 * Topics
 * display landmark
 * landmark management
  * create
  * delete
  * rename
 * images
  * add images
  * remove images - auto and manual
  * select useable, correlation and manual
  * adjust image position, auto, manual
 * global shift
 * build template
 * find height
  * options


The core of SPC is [[lithos]]. That tool lets you create landmarks, associate images, align images, determine the 3D position of the landmark and create topography.


Fixing landmarks, using [[Input landmark]]

 * START1 - nominal
 * START2 - simple autoalign [[Align landmarks]]
 * START3 - align with an images [[Align landmarks]]
 * START4 - manually align a single image [[Align landmarks]]

Building a landmark [[Create new landmark]] and [[How To Build A Landmark]]
 * Name: START5
 * Lat/Lon: -10/350
 * Res: 0.001
 * Q-size: 49

=== Template ===

 * START6 - using correlation and template [[Find template]]

=== Topography ===

Once all the images are aligned (the center pixel of every image is at the exact same feature of the surface), then you can build topography using photoclinometry with some conditions. [[Find heights]]

[[toposcript]]


=== State ===
A key diagnostic tool for SPC is understanding the state of the system. By state, I mean what are the conditions (the health or quality) of the landmark. There is no one parameter that tells you all of this, but it is looking at a wide set of details that tells you if there are problems.

See [[Notes from day 1]]

=== Tile 120 ===
Tiling is the process of batch creating landmarks in a systamatic order around the surface. Unlike "features", which I use to describe regions of the surface that is selected because of its topographic characteristics, landmarks cover the surface at a set interval to create an overlapping grid over the surface.

 * [[make_scriptT.in]]
        * scripts/XXX120.seed -- [[make_scriptT.seed]]
 * [[make_scriptT]]
 * sh [[run_script.b]]
 * [[find_nofit]]
 * [[TESTFILES]], [[TESTFILES1]]
 


----

== Day 2 ==

=== New files for today ===
 * Raw FITS Images
   * Copy these to topSPC/ORex/NEW_IMAGES/
   * https://oort.psi.edu/public/3b2435
 * Updates to support files
   * Copy these to /opt/local/spc/rpi/support
   * https://oort.psi.edu/public/60cb53



=== First - let's clean some of the landmarks from lastnight ===
 * FP0001
 * GL0001
 * GL0002
 * ER0001
 * EQ0001
 * FQ0002
 * EO0001
 * FB0001
 * EA0001


=== Blocks ===
We have provided some procedural blocks for different tasks. They include some additional log and configuration that will be different from you, but the main SPC steps are the same. Additionally, Bob has some "PROCEDURES" directory with his source code. There are instructions there and copy/paste commands.

[[SPC Blocks, V2]]


=== Let's talk about images ===

[[Block 2 - Ingest v2]]

 * Converting images into SPC format
 * [[process_fits]]
 * [[make_sumfiles.in]]
 * Converting geometric information into body-fixed frame
 * [[make_sumfiles]]

=== Register ===

[[Block 3 - Register v2]]

 * Each images should be aligned with the shape model at a course level.
   * [[register]]
 * Practice - P596677257F2
 * Batch
          * Clear out old [[TESTFILES]] and [[TESTFILES1]]
            * rm TESTFILES*/*
          * [[make_script.in]]
            * This must be created from the new list of images
            * Make a file of new image names and write them into make_script.in (with a proceeding space and the last line "END")
          * ln -s scripts/make_scriptR_01.seed make_scriptR.seed
          * [[make_scriptR]]
          * sh run_script.b
          * find_nofit

=== Support Files ===
While batch [[register]] is running, we will discuss some support files

 * Review metadata and data files
   * [[IMAGEFILES]]
 * format -- 8bit, 16bit, 32bit
   * [[NOMINALS]]
   * [[SUMFILES]]
   * [[make_sumfiles.txt]]
   * [[INIT_LITHOS.TXT]]
   * [[LMKFILES]]

=== Autoregister ===

[[Block 4 - Autoregister v2]]

 * Batch associate existing landmarks to new images
    * When you bring in new images, they have no landmarks. While you can add them into landmarks using [[lithos]], that is not very productive. Thus, we use a program [[autoregister]] that loads all of the landmarks into the image you are working with.
    * [[autoregister]]
        * [[make_lmrklistX]]
 * Practice - P596677257F2
    * Batch
          * [[make_script.in]] -- This must be created from the new list of images
          * ln -s scripts/make_scriptA.seed make_scriptA.seed
          * [[make_scriptA]]
          * sh run_script.b

=== Iterate ===

Now that we've pulled in extra information, we need to iterate to get the information propagated to all the files

[[Block 5 - Iterate v2]]

 * Iteration
 * Setup
                * [[INIT_LITHOS.TXT]] - Update Max processors
                * [[make_lmrklistX]]
  * cp LMRKLIST.TXT LIST.TXT
                * [[duplicates]]
  * ln -s <whatever> [[make_scriptP.seed]]
  * [[make_scriptP]] > run.sh
 * Running
  * sh run.sh
  * find_nofitP

=== Build a shape model ===
 * ICQ format
 * DENSIFY.TXT
 * [[densify]]
 * [[dumer]]
 * buildShape.sh - runs all of the commands as needed


=== Create a higher resolution ===

[[Block 6A - Lat/Lon Tiling v2]]

 * Tile 75
 * Setup
  * ln -s script/make_scriptT_75.in make_scriptT.in
  * [[make_scriptT]]
 * Running
  * sh run_script.b
                * [[find_nofitT]]


----
== Day 3 ==

 * Clean up from 75cm tiling

 * SPC Technical Info - Gaskell
 * Discussion of SPC Design
 * Technical details
 * Issues and complexities

=== Tiling by BIGMAP ===

[[Block 6B - Bigmap Tiling v2]]

 * Making a [[bigmap]]
    * Criteria for size, scale
      * Lat: -10
      * Lon: 350
      * Q size: 500
      * GSD: 25
    * Create support/[[RPI001.in]]



 Note - we use XXXXXX.MAP to allow for scripting. I use symbolic links to aid in keeping track of progress. By running [[showmap]] after building and linking the bigmap, you can prove that you have the correct map.


{{{
  bigmap < support/RPI001.in
  cd MAPFILES
  ln -s RPI001.MAP XXXXXX.MAP
  cd ..
  echo XXXXXX | SHOWMAP
  convert XXXXXX.pgm lowMap.jpg
}}}




=== Checking for existing maplets ===
{{{
  map_coverage
  XXXXXX
  0 .0005
  convert coverage_m.pgm preCoverage.jpg
}}}

=== Building the make_scriptT.in file ===

  * Build the [[make_scriptT.in]] file
    * This includes some shell commands to make something you can copy/paste. Or you can use a text editor to build the [[make_scriptT.in]], just make sure it follows the correct format for map-based referencing.
{{{
  echo N | make_tilefile > tmp
  echo XXXXXX > support/bigmap_tile.in
  echo scripts/XXX035.seed >> support/bigmap_tile.in
  sed 1d tmp >> support/bigmap_tile.in
  ln -s support/bigmap_tile.in make_scriptT.in
}}}


=== Run Tiling ===
  * Run the tiling script. Once you make the INN files, you can track the progress *.OOT files.
{{{
    make_scriptT
    sh run_script.b
    find_nofitT
}}}


=== Evaluation of the bigmap ===

Now that it is done, you can rebuild the bigmap and see the difference

{{{
  bigmap < support/RPI001.in
  echo RPI001 | SHOWMAP
  convert RPI001.pgm highMap.jpg

map_coverage
RPI001
0 .0005
convert coverage_m.pgm postCoverage.jpg
}}}


   * [[SIGMAS.TXT]]
   * [[SIGMAS.pgm]]

=== System Evaluation ===
   * [[RESIDUALS.TXT]]
   * [[MAPINFO.TXT]]
   * [[PICINFO.TXT]]

=== Iterate over region ===

This uses the fact that you recently made a bigmap as inputs for running a region-specific iteration. Remember, duplicates takes whatever list of landmarks in [[LIST.TXT]], sorts them, removes duplicates and replaced [[make_script.in]]. [[USED_MAPS]] is created by [[bigmap]], along with [[USED_PICTS]]. This contains all of the mapfiles that were used in building the bigmap.
{{{
  make_lmrklistX
  rm TESTFILES*/*
  cp USED_MAPS.TXT LIST.TXT
  duplicates
  make_scriptP > run.sh
  sh run.sh
  find_nofitP
}}}

=== Questions ===

 * How are shape models used in navigation?

See
  * [[Notes from day 1]]
  * [[Notes Day 2]]
Line 93: Line 402:
  * Work with the new model
   * Correct landmarks that threw errors
   * Build the Shape model
   * [[bigmap]]
     * Define a big map
     * Show how to generate
     * Show how to display

  * Setup and run a Standard_iteration [[Block 5 - Iterate]]
   * [[make_scriptP]]
   * [[find_nofitP]]

  * [[bigmap]] part 2
   * [[coverage_p]]
   * Build maplets using a map
   * Overlaps

  * Practice
   * Register
   * Fixing landmarks

  * Introduce [[autoregister]]


 * [[Notes, Day 4]]

 * Iteration (continuation from yesterday)
   * Fix landmarks from the iterate
   * Clean up the directory using rem_script.b

 * Build shape model -- Call it H2-Test2-
  * Change the support/buildShape.sh file
  * Install the shape model

 * Add Preliminary Survey images to the shape model
  * Register -- done
  * Autoregister the new images -- see notes
  * Iterate over the north pole landmarks
  * Build shape model -- Call it H2-Test3-

 * Tile the TAG site at 75 cm -- see notes
 
  * Review tools and technique to describe errors
   * CompareOBJ
   * Other tools

  * Error analysis
   * residuals
   * Shape model evaluation criteria [[Processing States]]



== Information Needed ==
 * [[TAG site definition]]
 * [[standard_build_topography_script]]
 * [[standard_register_script]]
 * [[standard_autoregister_script]]
 * [[tile_120cm_seed]] - the seed file to tile at 120cm
 * [[tile_75cm_seed]] - the seed file to tile at 75cm
 * [[tile_30cm_seed]] - the seed file to tile at 30cm
 * [[make_scriptT_120.in]] - the list of latitude/longitudes needed to tile at the 120 cm level
 * [[make_scriptT_075.in]] - the list of latitude/longitudes needed to tile at the 75 cm level
 * [[make_scriptT_030.in]] - the list of latitude/longitudes needed to tile at the 30 cm level
----
= Support Files =
 * {{attachment:gaskell-2008-paper.pdf}}
 * {{attachment:Palmer-2016.pdf}}

1st Annual PRI Workshop on Image-Based Modeling and Navigation for Space Applications

  • June 6-8 Short Course

Welcome to the 1st Annual RPI Workshop on Image-Based Modeling and Navigation for Space Applications. This is a persistent webpages (will continue to exists after the training) that contains the information you need to get ready and the lesson info.


Goals

  • Bring the students to the "SPC Training Level 2" TrainingLevels

    • Provide enough SPC hand-on skills that basic shape models can be built
    • Provides enough background so that additional practice and instruction can occur
    • It will be insufficient to fully train new personal to a level in which they could run an entire mission without support
  • Specific things to learn
    • Be able to create landmarks and add images
    • Basic trouble shooting and fixing mis-registration
    • Perform tiling (both globally and BIGMAP)
    • Do iterations
    • Run residuals, geometry
    • Register images to shape model or maps
    • Autoregister
  • Practice. A key component of this training is to practice. The practice allows for key concepts to become understood at a sufficient level to allow for more advanced concepts to make sense.


Student Prep

Because class time is limited, it is important to get the software and data installed before you show up to the conference. I will be available during the conference to help troubleshoot problems and help get your system functional before the class starts Wednesday morning. Once the class starts, I won't be able to ignore everyone else in the class to fix an install.

To maximize your learning in the class, I provide some information that will be beneficial to review.

  • Stuff to read (links below)
    • Gaskell's 2008
    • Palmer's 2016, sections 2.4 and 5

Required Tasks To Complete Before Class Starts

  • Sign the Licensing Agreement. This must be on file before the software can be distributed. //Complete//
  • Download SPC software -- encrypted link will be sent only to class attendees
  • Compile and install SPC. https://oort.psi.edu/public/1a09b8/dl/spc_v3.1B2.zip (password will be sent via a separate email)

  • Download sample data. The data volume is large, so it is important to do it ahead of time. Some of the files need to be expanded and moved.
    • Starting directory & SPICE (600MB)

      • You can put this directory anywhere (called topSPC). It is the base directory for the SPC work.
      • https://oort.psi.edu/public/98a344

      • You can go into the topSPC/ORex/DATA directory and uncompress the files using "gunzip *.gz"
    • Images:
    • Support Tools:
      • Over time, I have found that there are many nice helpers for SPC that do well if organized into its own area. They include scripts, programs and image lists. I've included some here. I suggest putting these two directories in /opt/local/spc/
      • https://oort.psi.edu/public/67588b

Extra software that is useful


Day 1

Day 1 Practical - It's all about LITHOS

  • Topics
    • display landmark
    • landmark management
      • create
      • delete
      • rename
    • images
      • add images
      • remove images - auto and manual
      • select useable, correlation and manual
      • adjust image position, auto, manual
    • global shift
    • build template
    • find height
      • options

The core of SPC is lithos. That tool lets you create landmarks, associate images, align images, determine the 3D position of the landmark and create topography.

Fixing landmarks, using Input landmark

Building a landmark Create new landmark and How To Build A Landmark

  • Name: START5
  • Lat/Lon: -10/350
  • Res: 0.001
  • Q-size: 49

Template

Topography

Once all the images are aligned (the center pixel of every image is at the exact same feature of the surface), then you can build topography using photoclinometry with some conditions. Find heights

toposcript

State

A key diagnostic tool for SPC is understanding the state of the system. By state, I mean what are the conditions (the health or quality) of the landmark. There is no one parameter that tells you all of this, but it is looking at a wide set of details that tells you if there are problems.

See Notes from day 1

Tile 120

Tiling is the process of batch creating landmarks in a systamatic order around the surface. Unlike "features", which I use to describe regions of the surface that is selected because of its topographic characteristics, landmarks cover the surface at a set interval to create an overlapping grid over the surface.


Day 2

New files for today

First - let's clean some of the landmarks from lastnight

  • FP0001
  • GL0001
  • GL0002
  • ER0001
  • EQ0001
  • FQ0002
  • EO0001
  • FB0001
  • EA0001

Blocks

We have provided some procedural blocks for different tasks. They include some additional log and configuration that will be different from you, but the main SPC steps are the same. Additionally, Bob has some "PROCEDURES" directory with his source code. There are instructions there and copy/paste commands.

SPC Blocks, V2

Let's talk about images

Block 2 - Ingest v2

Register

Block 3 - Register v2

  • Each images should be aligned with the shape model at a course level.
    • register

      • Practice - P596677257F2

      • Batch
        • Clear out old TESTFILES and TESTFILES1

          • rm TESTFILES*/*
        • make_script.in

          • This must be created from the new list of images
          • Make a file of new image names and write them into make_script.in (with a proceeding space and the last line "END")
        • ln -s scripts/make_scriptR_01.seed make_scriptR.seed
        • make_scriptR

        • sh run_script.b
        • find_nofit

Support Files

While batch register is running, we will discuss some support files

Autoregister

Block 4 - Autoregister v2

  • Batch associate existing landmarks to new images
    • When you bring in new images, they have no landmarks. While you can add them into landmarks using lithos, that is not very productive. Thus, we use a program autoregister that loads all of the landmarks into the image you are working with.

    • autoregister

    • Batch
      • make_script.in -- This must be created from the new list of images

      • ln -s scripts/make_scriptA.seed make_scriptA.seed
      • make_scriptA

      • sh run_script.b

Iterate

Now that we've pulled in extra information, we need to iterate to get the information propagated to all the files

Block 5 - Iterate v2

Build a shape model

  • ICQ format
  • DENSIFY.TXT
  • densify

  • dumer

  • buildShape.sh - runs all of the commands as needed

Create a higher resolution

Block 6A - Lat/Lon Tiling v2


Day 3

  • Clean up from 75cm tiling
  • SPC Technical Info - Gaskell
    • Discussion of SPC Design
    • Technical details
    • Issues and complexities

Tiling by BIGMAP

Block 6B - Bigmap Tiling v2

  • Making a bigmap

    • Criteria for size, scale
      • Lat: -10
      • Lon: 350
      • Q size: 500
      • GSD: 25
    • Create support/RPI001.in

    Note - we use XXXXXX.MAP to allow for scripting. I use symbolic links to aid in keeping track of progress. By running showmap after building and linking the bigmap, you can prove that you have the correct map.

  bigmap < support/RPI001.in
  cd MAPFILES
  ln -s RPI001.MAP XXXXXX.MAP
  cd ..
  echo XXXXXX | SHOWMAP
  convert XXXXXX.pgm lowMap.jpg

Checking for existing maplets

  map_coverage
  XXXXXX
  0 .0005
  convert coverage_m.pgm preCoverage.jpg

Building the make_scriptT.in file

  • Build the make_scriptT.in file

    • This includes some shell commands to make something you can copy/paste. Or you can use a text editor to build the make_scriptT.in, just make sure it follows the correct format for map-based referencing.

  echo N | make_tilefile > tmp
  echo XXXXXX > support/bigmap_tile.in
  echo scripts/XXX035.seed >> support/bigmap_tile.in
  sed 1d tmp >> support/bigmap_tile.in
  ln -s support/bigmap_tile.in make_scriptT.in

Run Tiling

  • Run the tiling script. Once you make the INN files, you can track the progress *.OOT files.

    make_scriptT
    sh run_script.b
    find_nofitT

Evaluation of the bigmap

Now that it is done, you can rebuild the bigmap and see the difference

  bigmap < support/RPI001.in
  echo RPI001 | SHOWMAP
  convert RPI001.pgm highMap.jpg

map_coverage
RPI001
0 .0005
convert coverage_m.pgm postCoverage.jpg

System Evaluation

Iterate over region

This uses the fact that you recently made a bigmap as inputs for running a region-specific iteration. Remember, duplicates takes whatever list of landmarks in LIST.TXT, sorts them, removes duplicates and replaced make_script.in. USED_MAPS is created by bigmap, along with USED_PICTS. This contains all of the mapfiles that were used in building the bigmap.

  make_lmrklistX
  rm TESTFILES*/*
  cp USED_MAPS.TXT LIST.TXT
  duplicates
  make_scriptP > run.sh
  sh run.sh
  find_nofitP

Questions

  • How are shape models used in navigation?

See


Support Files

  • gaskell-2008-paper.pdf

  • Palmer-2016.pdf

Image-Based-Modeling (last edited 2018-06-19 09:03:48 by EricPalmer)