-
Notifications
You must be signed in to change notification settings - Fork 169
Exercises_1
Exercises 1 ¶
The purpose behind these exercises is to help programmers become familiar with the ISIS3 environment, the ISIS3 API, and ISIS3 standards.
-
Exercises 1
- Before We Start
- Setup
- Task 1 - Get Familiar with ISIS3
- Task 2 - Examine the ISIS3 mirror Application and Modify it
- Task 3 - Modify the mirror Application
- Task 4 - Add a Parameter to the mirror Application
- Task 5 - Allow User to Decide if Alternating Lines or Samples are Set to 0 or NULL
- Task 6 - Provide Information to the User
- Task 7 - Modify the Cube Labels
- Task 8 - Create Documentation
Before We Start ¶
This workshop does not attempt to teach basic Linux command line usage. If you do not have a basic knowledge of the Linux command line please search the internet for tutorials about "Linux commands" and learn them before attempting this workshop.
Download a test image, Peaks.cub.gz (you must uncompress this image). This image is 1024x1024 with 7 bands and it has 19 LRS special pixels.
Setup ¶
Initialize your environment to run the ISIS3 applications. Set the ISISROOT environment variable using a command like: setenv ISISROOT THE/LOCATION/OF/THE/MAIN/ISIS/DIRECTORY
Example:
setenv ISISROOT /usgs/pkgs/isis3/isis
NOTE : The last directory in the path must be "isis"
Run the ISIS3 initialization script:
source $ISISROOT/scripts/isis3Startup.csh
NOTE : Astrogeology ISIS3 users should set an alias:
alias setisis source /home/isis3mgr/bin/initIsis.csh
setisis /usgs/pkgs/isis3/isis
Verify your ISIS3 environment is working by examining the test cube (downloaded above) using the ISIS3 application qview
qview Peaks.cub
Task 1 - Get Familiar with ISIS3 ¶
- Browse the ISIS Website
- Examine the user documentation
- Examine the programmer documentation (Technical documents)
- Look at the ISIS3 directory structure
- Look at $ISISROOT/src
- Look at $ISISROOT/src/base
- Look at $ISISROOT/src/base/apps
- Look at $ISISROOT/src/base/objs
- Look at $ISISROOT/src/mgs ...
- Look at $ISISROOT/bin
Questions:
What is a "Cube Attribute?"
What are the two pixel storage orders ISIS3 supports?
Name one reserved ISIS3 command line parameter.
What is the general indenting scheme for ISIS3?
What is the naming convention for local variables?
What is an include guard?
What are the names of the three dimensions of an ISIS3 cube?
How would you specify the string "Hello World" for a parameter named
"comment" in an application called diff on the command line?
Task 2 - Examine the ISIS3 mirror Application and Modify it ¶
- Create the following directory path under your home area: isis3/isis/src/base/apps/mirror
- Copy the mirror application(mirror.cpp, mirror.xml, Makefile) from $ISISROOT/src/base/apps/mirror into the new directory
- Type ' make ' to build the program
- Run mirror using the input file Peaks.cub downloaded above (the image must be uncompressed prior to this step).
- Look at the results with qview
- Modify the mirror program so that instead of mirroring, every other sample in the image is set to zero. You may want to save the mirroring code for later in a comment instead of deleting it.
- Verify the results with qview
Task 3 - Modify the mirror Application ¶
- Modify the your copy of the mirror program so instead of mirroring and/or setting every other sample to zero, have it set every other line to zero. You may want to save previous code in a comment instead of deleting it.
- Verify the results with qview
Task 4 - Add a Parameter to the mirror Application ¶
- Add a parameter to the mirror application so the user can pick either zero or Isis::Null as the output DN for the blank lines and/or samples. You will need to modify the xml file to accomplish this Hint: Look at other ISIS3 applications for examples or the ISIS XML documentation
- Verify the results with qview
Task 5 - Allow User to Decide if Alternating Lines or Sles are Set to 0 or NULL ¶
- Combining what you did in Task 3 and Task 4, modify the mirror application again to allow the user to decide both if the program changes the value of every other line or every other sample and if the value should be changed to 0 or Isis::NULL.
- You will need to again modify the xml file.
- Hint : you may need to use C++ polymorphism and class inheritance. If you are unfamiliar with these concepts, now would be a great time to learn!
Task 6 - Provide Information to the User ¶
- Modify the program to compute the average and standard deviation of the output image. To start with just write the values using the C++ cout stream. [Hint: See the Statistics class]
- Next put the average and standard deviation in a PvlGroup and write it to the log file(print.prt) [Hint: See the Application class]
Task 7 - Modify the Cube Labels ¶
- Use the ' more ' utility to look at the labels in the beginning of the cube
- Modify the program to add the average and standard deviation to the labels [Hint: Look at the Process and Cube classes]
Task 8 - Create Documentation ¶
- You may have noticed some xml tags in mirror.xml look like comments.
Tags like
<brief>
,<description>
, and<example>
help programmers get contextual information when reading or editing source code. They also serve to generate documentation. To see what your application's documentation looks like, go to the application's directory and type ' make html ' to build the documentation. Open the .html file it creates in a web browser to see what it looks like. - Look at other applications in ISIS3 for examples of documentation and read the ISIS Application Examples How-to
- Modify the xml for your application and use ' make html ' to verify the results.
Peaks.cub.gz (5.76 MB) Makayla Shepherd, 2016-06-01 10:30 AM
- Building
- Writing Tests
- Test Data
- Start Contributing
- Public Release Process
- Continuous Integration
- Updating Application Documentation
- Deprecating Functionality
- LTS Release Process and Support
- RFC1 - Documentation Delivery
- RFC2 - ISIS3 Release Policy
- RFC3 - SPICE Modularization
- RFC3 - Impact on Application Users
- RFC4 - Migration of ISIS Data to GitHub - Updated Information 2020-03-16
- RFC5 - Remove old LRO LOLA/GRAIL SPK files
- RFC6 - BLOB Redesign
- Introduction to ISIS
- Locating and Ingesting Image Data
- ISIS Cube Format
- Understanding Bit Types
- Core Base and Multiplier
- Special Pixels
- FAQ