- Log in to the system
login: meta01
password:
If you're using the standard Bourne shell, the system prompt will be a
dollar sign, and if you're running the C shell or one of its variants, the
prompt will be a percent sign.
- Look at the files in your home directory
$ ls -laF
- Find the directory examples
$ cd examples
$ ls -laF
- Find the file dds27.met; this is USGS DDS-27: Monthly Polar Sea-Ice Concentration
$ ls -laF dds27.met
- Determine whether mp is properly installed
$ mp
Usage: mp [-e efile] [-c cfile] [-t tfile] [-h hfile] [-s sfile] [-d dfile] input_file
where efile will contain syntax errors
cfile contains configuration info
tfile will contain text output
hfile will contain html output
sfile will contain sgml output
dfile will contain DIF output
If you don't get this "usage" text but instead see lots of PostScript
code, then the mp that the system found first is a program
associated with the mail system. Find our mp and give its
full path name, like /usr/local/bin/mp.
- Parse the metadata file, displaying errors on the screen
$ mp dds27.met
- The screen wraps the text and, for other files, there can be many
messages. Redirect them to a file so that you can examine them more
closely with a text editor.
$ mp dds27.met -e dds27.err
- Look at the error file and the metadata using a text editor.
$ xed dds27.err dds27.met
In xed, the top line of the window is a "status line" that
shows you what line you're on, what column your cursor is in, whether
you're in Insert and Autoindent mode, the width that tabs will be
expanded, and the name of the file you're editing (a '+' before the name
means you've made changes to the file).
- Note that mp gives a warning for line 448. Switch to the
metadata record and look at line 448.
- Click the mouse on the status line to bring up the menus.
- Click File to open the File menu, and click Next file
twice to switch to the next file. The file dds27.met appears.
- Go to the menu again and click Move to open the Move menu,
then click Go to line twice to go to a specific line (F4 does all this in one keystroke).
- When Go To Line: _ appears in the status line, type 448.
- The warning says the element Stereographic appeared in the
text of the element Process_Description. Note that on line 456
the word Stereographic appears at the beginning of the line.
mp has decided that this word is not supposed to be the
element Stereographic but is instead just part of the text of the
process description. The warning lets you know this is what it thought,
just in case that's not what you intended to write in the metadata
record. We can ignore this warning because mp has made the
right decision.
- Switch back to the error file by selecting Prev file from
the File menu.
- mp shows errors on lines 517 and 525. Look at those lines.
- Switch to the metadata record again (hold down Alt and press the period key).
- Go to line 517 (press F4, then enter 517).
- This element is Spatial_Data_Organization_Information.
Look up its usage in the
CSDGM.
Note that its structure is defined as
Spatial_Data_Organization_Information =
0{Indirect_Spatial_Reference}1 +
0{Direct_Spatial_Reference_Method +
( [Point_and_Vector_Object_Information |
Raster_Object_Information] )}1
Note that Raster_Object_Information, if applicable, is not
supposed to be repeated.
- Go to line 525. This record contains two
Raster_Object_Information elements, describing images of
different sizes. One set of images (of size 304x448) depicts the north
polar region, the other set (of size 316x332) depicts the south polar
region.
- Note that the two errors for line 517 and 525 are caused by only
one element. If we decided to eliminate one of the
Raster_Object_Information elements, both errors would
disappear.
- Now that we understand the error messages, re-run mp to
generate output files in several useful formats.
$ mp dds27.met -e dds27.err -h dds27.html -f dds27.faq.html -s dds27.sgml -d dds27.dif -t dds27.txt
This generates the following files in the following formats:
Examine each of these files. Note that the HTML, SGML, and text formats
contain the same information, and the DIF record expresses some of the
metadata in a different schema.
- This completes the exercise.