TRIMMER
Category DART |
Version 1.0 |
Description
TRIMMER is designed for a flyby situation where some parts of the body are never seen in any of the images. It uses the sumfiles for each image in an input list to identify what parts of the image are visible to the camera and which parts of the image are illuminated. TRIMMER determines where the shape model is visible and illuminated but, according to the images and their sumfiles, shouldn’t be (i.e., things that stick up too far). After identifying these areas, TRIMMER trims them down in the radial direction by a specified amount. It whittles down the shape until the areas of the shape model that are supposed to be in the dark are indeed in the dark. TRIMMER can also “pump” up areas of the shape that are too low, but Bob says that you can get in trouble using this feature and it has not been tested for DART.
TRIMMER does not affect maplets; it only affects the shape model. The trimmed shape model can then be dumbed down and used in densify, for example. However, TRIMMER distinguishes between areas of the shape covered by maplets vs. areas with no maplet coverage. TRIMMER relies on COVERAGE.TXT for maplet coverage, so you can fool TRIMMER into thinking that an area is not covered by maplets by changing the inputs to shape_coverage. In order to TRIMMER to fully operate on all parts of the shape, shape_coverage must find no maplets. If you quit and restart TRIMMER and want to pick up where you left off, you must run shape_coverage on SHAPEX.TXT before restarting trimming.
From the code:
C TRIMMER determines where the shape model is visible C and illuminated but, according to the images and their sumfiles, C shouldn’t be (i.e., things that stick up too far). After identifying C these areas, TRIMMER trims them down in the radial direction by a specified amount. C C TRIMMER can also “pump” up areas of the shape that are too low, but C Bob says that you can get in trouble using this feature and it has C not been tested for DART. C C TRIMMER does not affect maplets; it only affects the shape model. The C trimmed shape model can then be dumbed down and used in densify, for example. C However, TRIMMER distinguishes between areas of the shape covered by maplets C vs. areas with no maplet coverage. TRIMMER relies on COVERAGE.TXT for maplet C coverage, so you can fool TRIMMER into thinking that an area is not covered C by maplets by changing the inputs to shape_coverage. In order to TRIMMER to C fully operate on all parts of the shape, shape_coverage must find no maplets.
Input Files
SHAPEFILES/COVERAGE.TXT. TRIMMER reads this file uses this file to determine where maplets exist. COVERAGE.TXT must exist in order to run TRIMMER, so running shape_coverage is a prerequisite.
TRIMMER.TXT. A text file that lists all images you want to use for TRIMMER. Usually, this is all registered images, but a more restricted approach would be to only use images that contain LMKs. The image names need to be preceded by a space. The last line is END (no leading space).
SHAPEFILES/SHAPEX.TXT. TRIMMER operates on SHAPEX.TXT. It does not affect SHAPE.TXT. Before starting TRIMMER, copy the shape you want to trim to SHAPEX.TXT. SHAPE1.TXT (Q = 128) is often a good shape to start with, especially early in the shape modeling process. The higher the Q value of the shape, the longer TRIMMER will take to run. If you have a very mature model that you are trying to polish, running on a higher-resolution model may be appropriate.
Output files
SHAPEFILES/ILLUM.TXT. Use as an input to shape2mapsA to show areas of the shape that are illuminated.
SHAPEFILES/VISIBLE.TXT. Use as an input to shape2mapsA to show areas of the shape that are visible in the images.
SHAPEFILES/V_AND_I.TXT. Use as an input to shape2mapsA to show areas of the shape that are both visible and illuminated in the images.
SHAPEFILES/SHAPEX.TXT. The trimmed shape.
Using '''TRIMMER'''
1. Verify that you have copied whatever shape model you wish to trim into SHAPEFILES/SHAPEX.TXT.
2. Run shape_coverage using SHAPEFILES/SHAPEX.TXT as the input shape and the desired set of input parameters. See shape_coverage. The most aggressive option is to run shape_coverage with inputs that result in no landmarks matching the parameters. TRIMMER would then operate freely across the entire shape, rather than holding back in areas with maplet coverage.
shape_coverage SHAPEFILES/SHAPEX.TXT 0 .01 .1 0
3. Run shape2mapsA so that TRIMMER knows which areas are covered by maplets that meet the criteria used in shape_coverage.
echo SHAPEFILES/COVERAGE.TXT | shape2mapsA
4. Run TRIMMER. In Terminal in the main SPC directory for the body you want to trim, type:
TRIMMER
The program then prompts you:
ENTER PLIM -1 #setting this to -1 turns off the “pumping” option
Then you wait for a while. The program is going through all of the images in TRIMMER.TXT and identifying all of the places in each image that are illuminated (based on a 1.5*DN threshold criterion) and visible.
The program then prints three things to the screen, which you can copy and paste into Terminal.
shape2mapsA # shows the areas of the shape SHAPEFILES/ILLUM.TXT # model that are illuminated shape2mapsA # shows the areas that are visible SHAPEFILES/VISIBLE.TXT # in the images we have shape2mapsA # this shows visible areas that are also illuminated. SHAPEFILES/V_AND_I.TXT # Brighter areas are also covered by maps.
To actually see these, you need to run shape2mapsA in the main SPC directory for the body, but in a separate Terminal. Copy and paste those commands. Don’t quit TRIMMER to make the images because otherwise when you re-start TRIMMER you’ll have to wait again while the program processes the images. The following scripts make each these views puts them in the SHAPEVIEWS directory. These are:
- trimmerIllumViews.sh
- trimmerVisViews.sh
- trimmerVIViews.sh
Next, TRIMMER asks you to enter the trim step in kilometers. This trim step is the increment by which the shape model will be shaved down in the areas that, according to the images, are not illuminated. The trim step needs to be tailored for each body based on the size of the body and how much needs trimmed off. 1% of the body seems to be a reasonable starting point.
ENTER TRIM STEP IN KM 0.001 # a user-specified number.
The program then prints to the screen
shape2maps SHAPEFILES/SHAPEX.TXT CONTINUE? (Y/N)
Copy/paste those lines into another Terminal window and then use viewShape.sh to look at the trimmed-down shape.
If you enter “Y”, the program will prompt you to enter the trim step (you could use a new value for the trim step, if desired) and then do another round of trimming. The program doesn’t trim down the previously trimmed edge. In practice, you often copy and paste the trim step and “y” as a script into TRIMMER. For example, as part of a DART test,
TRIMMER -1 0.001 y 0.001 y 0.001 y 0.001 y 0.001 y 0.001 y 0.001 y 0.001 y 0.001 y 0.001 n
It can take several minutes to do each step. That is the end of TRIMMER itself, but in practice the trimmed shape is often dumbed down and then used in densify.