Skip to content

prepared combined pixl and libs data for building line plot #166

Merged
merged 4 commits into from Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 58 additions & 0 deletions StudentNotebooks/Assignment05/MatchingLIBSandPIXL.Rmd
Expand Up @@ -166,6 +166,8 @@ Novarupta<-libstargets.df[libstargets.df$nearestpixl=="Novarupta",]$target
UganikIsland<-libstargets.df[libstargets.df$nearestpixl=="UganikIsland",]$target
```


### Ternary Diagram
```{r}
meters=100
Expand Down Expand Up @@ -210,3 +212,59 @@ ggtern(libs.tern, ggtern::aes(x=x,y=y,z=z)) +
guides(alpha="none")
```


### Line plot

```{r}
meters=100
included.libs<-(libstargets.df%>%
filter(Distance<meters))$target
libs.matrix <-libs.df %>%
filter(target %in% included.libs)
libs.matrix <- libs.matrix[,c(5,7:14)]
libs.matrix<-libs.matrix[,c(1:2,4:9,3)]
libs.matrix<-cbind("Abrasion"=0,libs.matrix)
libs.matrix<-libs.matrix%>%
mutate(Abrasion = ifelse(target%in%Alfalfa,"Alfalfa",
ifelse(target %in% Bellegrade, "Belegrade",
ifelse(target %in% BerryHollow, "BerryHollow",
ifelse(target %in% Dourbes, "Dourbes",
ifelse(target %in% Novarupta, "Novarupta",
ifelse(target %in% Quartier, "Quartier",
ifelse(target %in% ThorntonGap, "ThorntonGap",
ifelse(target %in% UganikIsland, "UganikIsland",Abrasion)))))))))
libs.matrix<-cbind(libsorpixl=1,libs.matrix)
```


```{r, data03}
#read in pixl data with lat/long
pixl.df<-readRDS("/academics/MATP-4910-F24/DAR-Mars-F24/StudentData/pixl_sol_coordinates.Rds")
pixl.df<-pixl.df %>%
select(c(5:8,12:14,17,19,18,22))
#reorder pixl columns so that it matches libs data organization
pixl.df<-pixl.df[,c(11,10,4,3,8,2,6,1,5,7)]
#remove atmospheric sample
pixl.df<-pixl.df[2:16,]
pixl.df<-cbind(libsorpixl=0,pixl.df)
```

```{r}
colnames(pixl.df)<-colnames(libs.matrix)
pixllibs.df<-rbind(pixl.df,libs.matrix)
```



24 changes: 9 additions & 15 deletions StudentNotebooks/Assignment05/vanesm-assignment5.Rmd
@@ -1,12 +1,12 @@
---
title: "DAR F24 Project Status Notebook Template"
title: "DAR F24 Project Status Notebook"
author: "Margo VanEsselstyn"
date: "`r Sys.Date()`"
output:
pdf_document:
toc: yes
html_document:
toc: yes
pdf_document:
toc: yes
subtitle: "DAR Mars"
---
```{r setup, include=FALSE}
Expand Down Expand Up @@ -88,6 +88,7 @@ knitr::opts_chunk$set(echo = TRUE)
* Project Name: Mars
* I updated the LIBS and PIXL combined data, categorized the LIBS data, and attempted to display the LIBS scct targets on a ternary diagram.
* I committed an updated version of the combined LIBS and PIXL data as well as a categorized LIBS data Rmd file
* I worked on the MatchingLIBSandPIXL.Rmd with Charlotte Peterson, a file that outlines all of our efforts in matching the PIXL and LIBS datasets

## Analysis: Question 1 (LIBS Target Names)

Expand Down Expand Up @@ -325,7 +326,7 @@ kable(kablelibstern)
```
### Discussion of results

I don't have clear results because my graph is not very clear and is not labeled well. One thing I found interesting was that the points at the same scct target don't necessarily have the same value, they are very close, but not exactly the same, so there is some amount of error.
I don't have super clear results because my graph is not very clear and is not labeled well. ggrepel conflicts with ggtern, so I was struggling with making the labels spread more. One thing I found interesting was that the points at the same scct target don't necessarily have the same value, they are very close, but not exactly the same, so there is some amount of error.

## Analysis: Question 3 (Improving LIBS-PIXL combined data)

Expand Down Expand Up @@ -381,15 +382,11 @@ Overall, our LIBS and PIXL matching is not perfect, and we need to continue to n

### Question being asked

_Provide in natural language a statement of what question you're trying to answer_
Can we plot the LIBS data according to its nearest PIXL cluster (IMPROVED VERSION OF THIS IS IN MatchingLIBSandPIXl.Rmd)

### Data Preparation

_Provide in natural language a description of the data you are using for this analysis_

_Include a step-by-step description of how you prepare your data for analysis_

_If you're re-using dataframes prepared in another section, simply re-state what data you're using_
I am using the LIBS data and PIXL data, with the features from the PIXL data removed

```{r, result04_data}
# Include all data processing code (if necessary), clearly commented
Expand Down Expand Up @@ -420,9 +417,7 @@ libs.df<-libs.df[libs.df$index %in% libsandpixl$index,]

### Analysis: Methods and results

_Describe in natural language a statement of the analysis you're trying to do_

_Provide clearly commented analysis code; include code for tables and figures!_
We plot the LIBS data, colored with its nearby PIXL sample site

```{r, result05_analysis}
libs.matrix <- as.matrix(libs.df[,7:14])
Expand Down Expand Up @@ -454,8 +449,7 @@ ggtern(libs.tern, ggtern::aes(x=x,y=y,z=z)) +

### Discussion of results

_Provide in natural language a clear discussion of your observations._

Overall, the LIBS data is very spread, probably in part because the distance range is very far for this graph. But it is interesting that certain PIXL locations line up with LIBS clusters, like the Uganik island data is clearly clustered together.

## Summary and next steps

Expand Down
226 changes: 207 additions & 19 deletions StudentNotebooks/Assignment05/vanesm-assignment5.html

Large diffs are not rendered by default.

Binary file modified StudentNotebooks/Assignment05/vanesm-assignment5.pdf
Binary file not shown.