Getting Your APXS Clusters into Google Earth
This lab has the following objectives:
-
To have you create a CSV file from your APXS K-means clustering spreadsheet
that can be imported into Google Earth Pro
-
To show you how to import CSV files sorted by cluster and format placemarks
during the process of mass database import (colors and icons) or modify
folders all at once after the fact
-
More generally, show you how to move fairly large amounts of data into Google
Earth Pro at once for mapping, rather than having to go placemark by
placemark. To do this requires Google Earth Pro (which is freely available at
https://www.google.com/earth/desktop/),
but, once a CSV has been converted into KML or KMZ form, it is usable by plain
old Google Earth.
-
To have you sort out the geochemical "personalities" of the four rovers'
working areas
Deliverables:
In the last lab, we did the K-means clustering in PAST, brought the clusters
back into the original Calc spreadsheet, counted the targets that fell in each
cluster, and then did charts showing the relative abundance of each oxide and
element in each of the four clusters. I had you hang onto all that for
mapping work in this lab. So, the deliverables are going to be a compendium
of work from both labs.
- KMZ file that you create during this process to display your APXS target
clusters (uploaded to Dropbox for Lab 9)
- the CSV spreadsheet you used to import your data into Google Earth Pro
(Dropbox for Lab 8)
- your original Calc spreadsheet, including a small table of target counts
by cluster and your four graphs. The table and graphs may be turned in as
hard copy (always appreciated).
- a stacked bar chart of relative prevalence of each cluster at the four
rovers' work sites
- a brief lab report on the character of the four clusters and how they may
or may not reflect the metaclusters described at the top of last week's lab,
as well as comparing and contrsting the geochemical "personalities" of the
four regions the rovers work or worked in.
Preparing the CSV
Fire up OpenOffice and open the spreadsheet in which you did your K-means
clustering of the merged APXS data. Your four clusters should be listed down
column AP if you followed directions from Lab 8 exactly and didn't improv.
Now, we need to get those four clusters into a form that Google Earth Pro
won't mangle, which it will if we leave them as numbers. So, we'll trick it.
You'll notice an empty column I didn't have you use in Lab 8: Column A,
labeled Folder. We'll use this column to convert the cluster numbers
into cluster letters to browbeat Google Earth into doing what we want, which
is mapping each cluster with a different symbol that we can edit en
masse without having to hand-edit each of the 901 APXS targets
individually.
In cell A2, type in the following if-then-else code:
if(ap2=1;"A";if(ap2=2;"B";if(ap2=3;"C";"D")))
This will classify all your cluster numbers into letters, assuming you have
every little bit of punctuation in exactly the right order. Drag that
successful formula all the way down the column.
Save that file!
Now, create a new file. Save it as a CSV (comma-separated values
file). To do this, Save As and then use the Save as type drop-down menu to
choose the Text CSV option. Please name it LastnameLab9.csv (so I know
which masterpiece belongs to which of you. We need to customize it so Google
Earth will only display relevant information about each APXS target.
The new file should contain only the following columns:
- Folder
- Mission
- Name
- Latitude
- Longitude
- Sol
- Description
Highlight and copy only those, in that order, into your new file. Save
it.
Now, close the file and we're
ready to move into Google Earth Pro.
Before we actually go there, Download (Save Link as ... whereever you save
stuff) the following file:
Importing your CSV into Google Earth Pro
Fire up Google Earth Pro from the Desktop. After it loads and you shut down
its little helpful hints, click on the Tools tab on the top toolbar and
then Options. A dialogue box comes up. On the 3D View one, click on
Deimal Degrees under Show Lat/Long. Under Units of Measurement, pick Meters,
Kilometers. Now, under the Navigation tab, pick Do not automatically tilt
while zooming, which tends to mess up the map function we're interested in
here. All that done, hit OK.
Click on the Planets icon up top and select Mars (sort of obvious!).
Now, hit the File tab up on the left. Our first chore, optional but
extremely useful, given Google Earth screwing up Curiosity's traverse, is to
Open and navigate to wherever you stowed Fernando Nogal's Martian
Way Curiosity traverse. All you-know-what will break out, so you may be
shutting down the Mars clock and then doing a search on someplace else, such
as Spirit, to get back into normal nadir-looking perspective!
Now to go get YOUR data: From the File tab, this time pick
Import (NOT Open) and navigate to wherever you put your
LasstnameKmeans4.csv file. A dialogue box comes up so you can specify that it
is a Delimited file (sometimes it comes up delimited by commas,
sometimes delimited by tabs: If the preview window looks like your file, just
hit Next (if it doesn't, try the other delimiter).
In this new dialogue, make sure that there is no check by "Does not
include latitude and longitude" (because it does -- this option is for use of
addresses on Earth for mapping instead of the geographic grid). Verify that
the latitude and longitude field names are okay. Hit Next.
Now you can Specify field types. Folder, Mission, Name, and
Description should all register as string variables. Latitude, longitude, and
Sol should be floating point. Your original K4 numbers will probably be
identified as integers. Change any that aren't guessed correctly (unlikely).
Then, hit Finish.
Another small dialogue box comes up: Apply style template? Choose
Yes. another dialogue box comes up with four tabs.
- Under Name, set the Name field as, well, the Name field
- Under Color, select Set color from field and choose the
Folder field. Very important: Click the create sub-folders for each
bucket option!!! Be sure to copy the same letters of your clusters to the
Folder name column that appears (next to the numbers of targets that
showed up in each of your clusters).
Now, start fiddling around with the Palette start color and end
color options. Use the color picker to pick two colors you like that are
very contrasting, one for the Start and then one for the End. You can, if
you're familiar with RGB, go nuts and design end-member colors. Probably not
wise your first time through all this!
- Under Icon, you again specify Set icon from field and choose
Folder. If you picked a color palette under the Color tab, you don't
need to create sub-folders here. If you didn't use the Color tab, you will
have to create sub-folders here. You can choose the blank icons (circles,
squares, stars, triangles, diamonds) toward the middle of the drop down menus
that show up under each folder's icon button and have them filled with the
color palette you picked under the Color tab. Alternatively, you can just
pick one of Google's pushpin icons (so many goofy choices!).
- Under the Height icon, it's probably best to pick Clamp features to
ground. Unless you really like that circus-balloon effect of icons on strings
floating above your APXS target! No accounting for taste!
On trying to Finish up, the program will ask you if you'd like to save
your artistic endeavors as a template (KST file) you could recycle
later for some future quick and dirty map job. Probably a good idea, just in
case. We can't have enough fashion accessories for lazy future mapping.
On hitting Finish, Google Earth will ask you if you want to stay on
Mars: Yes, you do.
Admire your handiwork!
Go to the bottom of the Places navigation bar on the left side of Google
Earth, down to Temporary Places. Be sure to click on your imported CSV there
to light the map up with your icons.
Also, be sure to expand that file by clicking the triangle next to the
checkbox. This lets you see the KMZ file it created from your CSV. It should
be expanded now, too. You will see your four lettered folders. You can
expand those to see all the individual targets they each contain (or not).
At this point, surf around to see your rover traverses decorated with icons
marking each spot one of the rovers nuked a target. To do this, use the
Search button on the upper left and type in "Spirit," "Opportunity,"
"Curiosity," or "Pathfinder." Scroll around and change your scale to peer
at the landscapes the rovers crossed and the specific spots where someone
thought it would be an interesting idea to take an APXS spectrum.
If you click on one of the icons, a "thought balloon" opens up and lists all
of that site's attributes from the CSV (the seven columns are now seven rows).
If, for some reason, you don't like the way your placemarks look for a
particular folder, you can touch the folder name, right-click, and choose
Properties. You can do all sorts of stuff in there using the Style,
Color tab. To edit the folder there, you have to click Share Style
and then touch the box in the upper right (with a radio button in it). Touch
that box to re-affirm your icon choice -- or pick another. Now, you can change
its scale and color. Hit okay, and you can then change the size of the labels
Once you're happy with your artistry, Save the KMZ. Click on it to
highlight it, then click File -- Save Place As and put it on your flash
drive as LastnameLab9.kmz and then upload that (named that way) to
BeachBoard's Dropbox.
Getting at the "personalities" of the four regions
In the spreadsheet you created your CSV from (4rovers441541.ods, NOT
the csv), let's set up a table and graph to convey the regional
variations in the dominance of our four clusters, using a nifty spreadsheet
function.
Somewhere in there, write your four cluster "names" (1, 2, 3, 4 or A, B, C, D)
in four cells. For convenience, I'll put them in row 1, starting in column K.
So, K1:N1 will contain your cluster names.
In cell I2, put MPF; in I3, put MER-A; in I4, put MER-B; and in I5, put MSL,
the technical names of the rovers. For pretty graphing, put their popular
(Google Earth search) names in column J (Pathfinder, Spirit, Opportunity,
Curiosity).
Now, we can use a cross-tab counting function in Calc to count the
number of occurrences of each cluster in each of the four rover work areas. In
cell K2, write in =countifs($b$2:$b$902;$i2;$a$2:$a$902;k$1). CountifS
will classify all occurrences of each Mission by the mission specified in
I2:i5 by the number of cases of each cluster in the Folder column. If you're
careful about all the dollar signs, colons, and semi-colons, you'll get a
cross-tabbed table suitable for analysis. You can also sum the four columns
and the four rows of the table to make sure you have 901 records, 11 for MPF,
220 for MER-A, 370 for MER-B, and 300 for MSL and that the column counts match
the numbers of targets that you got in your K-means cluster.
Assuming everything's okay, you can now create a graph to visualize all this.
Highlight cells J1:N5 and ask for a graph. Calc defaults to a bar
chart. Pick the third type of bar chart, where each column is stacked
and the stacks are the same height, so that you can visualie relative
abundance. Hit Next, Next, Next, and then fill out your titles and axis
labels. You should leave the legend in to interpret the colors by
cluster. Hit Finish and then Format Chart Area to put a neat
line around the graph so you can see it when you're moving it around.
h
Analyzing Your Clusters
So, now you have your clusters mapped and graphed. You figured out what
the four clusters reflect in the last lab by making four graphs of their
average relative abundances. We talked about those graphs:
- the commonest cluster doesn't diverge from the Mars average relative
abundances in anything, so it's no doubt basalt or ST1.
- another cluster shows enrichment in felsic oxides (such as those of
sodium, aluminum, silicon, phosphorous, potassium, and titanium) and is
depleted of the mafic oxides (those of iron and magnesium), while signs of
water alteration are depleted or Mars-typical). This is probably evolved
igneous material (leaning in the andesitic direction or ST2).
- another cluster shows depletion in those felsic oxides and Mars-typical
levels of mafic oxides and halogens, but is highly enriched in sulfur
trioxide, probably a signal of acidic water altering rocks and soils,
which was most likely during Hesperian times after massive volcanism and all
the associated sulfur species cranked out by volcanic eruptions.
- a very rare cluster was the crazy-looking one due, no doubt, to small
sample effects with a rare process. This suggests signs of water alteration
but in the form of neutral-ish pH waters. Such waters readily liberate
chlorine and bromium, as well as some susceptible oxides (e.g., those
of magnesium, potassium, and manganese) and zinc. These get concentrated
during evaporation, creating salt flats, rinds, and joints in rock, as
well as clays.
Granted, Pathfinder and its little rover, Sojourner, only got eleven APXS
measurements out there on the southeastern side of Chryse Planitia. Which two
target types were found there?
Opportunity is a stand-out in heightened abundance of which of the four
clusters? What does that tell you about that region? Which other region is
most similar to Opportunity's Meridiani Planum in that cluster? Which of the
four clusters found at all four sites is rarest around Opportunity's work
site? What does that tell you about the kind of volcanism in its area?
Which of the four sites has the richest and, within limits, the best-balanced
of the four clusters? Which type is uniquely visible there? What does that
tell you about its hydrological history?
Considering only Spirit, Opportunity, and Curiosity, which of the other two
does Gale Crater (Curiosity's work space) most resemble?
If you're morbidly curious about the 15 cluster analysis I did en route to
developing this lab, feel free to visit: https://home.csulb.edu/~rodrigue/mars/apxs/GE/.