The R Markdown code is available on GitHub

Investigating for the complete Pioneer 10 CPI mission

Dependencies

library(psych)      # For describe
library(lubridate)
library(data.table) # For fread
library(sphereplot)
library(tidyverse)
library(foreach)
library(plotly)

Download Data

Downloading all 1 hour CPI data and combine into one

path <- 'https://spdf.gsfc.nasa.gov/pub/data/pioneer/pioneer10/particle/cpi/ip_1hour_ascii/p10cp_hr'
yseq <- seq(1972, 1992)
rcpi <- data.frame()      # Empty data frame for result
foreach(y = yseq) %do% {
  url <- paste(path, as.character(y), '.asc', sep = '')
  ycpi <- fread(url)
  rcpi <- rbind(rcpi, ycpi)
}

Download Jupiter Trajectory

jtraj <- fread("https://spdf.gsfc.nasa.gov/pub/data/pioneer/pioneer10/traj/jupiter/p10trjjup.asc")

Convert date time

cpi <- rcpi %>% mutate(ts = date_decimal(V1) + days(V2) + hours(V3))
traj <- jtraj %>% mutate(ts = date_decimal(V1) + as.duration(86400 * V2))

Select and rename

cpi <- cpi %>% select(
  ts,
  RID2P   = V4,   # ID-2 rate for 11-20 MeV protons [cps]
  RID2HE  = V5,   # ID-2 rate for 11-20 MeV/nucleon helium [cps]
  RID3P   = V6,   # ID-3 rate for 20-24 MeV protons [cps]
  RID3HE  = V7,   # ID-3 rate for 20-24 MeV/nucleon helium [cps]
  RID4P   = V8,   # ID-4 rate for 24-29 MeV protons [cps]
  RID4HE  = V9,   # ID-4 rate for 24-29 MeV/nucleon helium [cps]
  RID5P   = V10,  # ID-5 rate for 29-67 MeV protons [cps]
  RID5HE  = V11,  # ID-5 rate for 29-67 MeV/nucleon helium [cps]
  RID5E1  = V12,  # ID-5 rate for 7-17 MeV electrons [cps]
  RID5E2  = V13,  # ID-5 rate for 2 x minimum-ionizing [cps]
  RID7    = V14,  # ID-7 + ID-13 integral rate for ions at E > 67 MeV/nucleon [cps]
  RID7ZG5 = V15)  # ID-7 integral rate for Z > 5 ions at E > 67 MeV/nucleon [cps]
traj <- traj %>% select(
  ts,
  SRANGE = V3,  # Sun-spacecraft distance in km
  SECLAT = V4,  # Solar ecliptic latitude and 
  SECLON = V5,  # longitude (true equinox and ecliptic of date) in degrees
  PRANGE = V6,  # Planet-spacecraft distance in km
  PEQLAT = V7,  # Planetocentric, planet-fixed latitude and
  PEQLON = V8)  # longitude (System III for Jupiter) in degrees

Replace fill in value with NA

cpi <- na_if(cpi, 1e31)

Time range

CPI data range

summary(cpi$ts)
##                  Min.               1st Qu.                Median 
## "1972-01-02 00:00:00" "1977-04-02 17:45:00" "1982-07-03 11:30:00" 
##                  Mean               3rd Qu.                  Max. 
## "1982-07-03 11:30:00" "1987-10-03 05:15:00" "1993-01-01 23:00:00"

Trajectory data range

summary(traj$ts)
##                  Min.               1st Qu.                Median 
## "1973-11-05 00:00:44" "1973-12-04 18:08:28" "1973-12-05 02:23:58" 
##                  Mean               3rd Qu.                  Max. 
## "1973-12-05 00:33:38" "1973-12-05 10:38:28" "1974-01-01 14:25:58"

Determine Date Range

cpimints <- min(cpi$ts)
cpimaxts <- max(cpi$ts)
trajmints <- min(traj$ts)
trajmaxts <- max(traj$ts)
mints <- max(cpimints, trajmints)
maxts <- min(cpimaxts, trajmaxts)

Filter all data by date range

cpi <- cpi %>% filter(ts >= mints & ts <= maxts)
traj <- traj %>% filter(ts >= mints & ts <= maxts)

Describe data

describe(cpi[,-1], skew = FALSE)
##         vars    n mean    sd min     max   range   se
## RID2P      1 1372 4.91 39.01   0  610.00  610.00 1.05
## RID2HE     2 1372 1.67 18.84   0  308.00  308.00 0.51
## RID3P      3 1372 0.04  0.48   0   10.40   10.40 0.01
## RID3HE     4 1372 0.04  0.53   0   10.70   10.70 0.01
## RID4P      5 1372 0.15  1.60   0   25.90   25.90 0.04
## RID4HE     6 1372 0.03  0.58   0   14.30   14.30 0.02
## RID5P      7 1372 1.68 19.02   0  326.00  326.00 0.51
## RID5HE     8 1372 0.41  6.25   0  146.00  146.00 0.17
## RID5E1     9 1372 0.82  2.69   0   24.80   24.80 0.07
## RID5E2    10 1372 1.42 10.78   0  133.00  133.00 0.29
## RID7      11 1235 3.31 62.89   0 1980.00 1980.00 1.79
## RID7ZG5   12 1235 0.00  0.01   0    0.48    0.48 0.00

Calculate averages

cpi <- cpi %>% mutate(
  RIDMP = (RID2P + RID3P + RID4P + RID5P) / 4,
  RIDMHE = (RID2HE + RID3HE + RID4HE + RID5HE) / 4,
  RIDME = (RID5E1 + RID5E2) / 2,
  RIDM7 = (RID7 + RID7ZG5) / 2)

Transforms 3D spherical coordinates to Cartesian coordinates

scart <- sph2car(traj$SECLON, traj$SECLAT, traj$SRANGE)
pcart <- sph2car(traj$PEQLON, traj$PEQLAT, traj$PRANGE)
traj <- traj %>% mutate(
  sx = scart[,1], sy = scart[,2], sz = scart[,3],
  px = pcart[,1], py = pcart[,2], pz = pcart[,3])

Convert to data tables

setDT(cpi)
setDT(traj)

Combine data

Combine CPI and Trajectory data into one set

setkey(cpi, ts)
setkey(traj, ts)
cpitraj <- traj[cpi, roll = "nearest"]

Plots

Distance from sun

ggplot(data = traj) +
  geom_point(aes(x = ts, y = SRANGE)) +
  labs(title = "Pioneer 10 Trajectory 1973", x = "Time", y = "Distance from Sun (km)") +
  theme_light()

Distance from planet

ggplot(data = traj) +
  geom_point(aes(x = ts, y = PRANGE)) +
  labs(title = "Pioneer 10 Trajectory 1973", x = "Time", y = "Distance from Jupiter (km)") +
  theme_light()

Protons

pcpi <- reshape2::melt(cpi %>% select(time = ts, "11-20 MeV" = RID2P, "20-24 MeV" = RID3P, "24-29 MeV" = RID4P, "29-67 MeV" = RID5P), id = "time") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = time, y = value, color = variable)) +
  geom_point(aes(x = time, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI Protons 1973", x = "Time", y = "Rate (cps)") +
  theme_light()

pcpi <- reshape2::melt(cpitraj %>% select(distance = SRANGE, "11-20 MeV" = RID2P, "20-24 MeV" = RID3P, "24-29 MeV" = RID4P, "29-67 MeV" = RID5P), id = "distance") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = distance, y = value, color = variable)) +
  geom_point(aes(x = distance, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI Protons", x = "Distance from Sun (km)", y = "Rate (cps)") +
  theme_light()

pcpi <- reshape2::melt(cpitraj %>% select(distance = PRANGE, "11-20 MeV" = RID2P, "20-24 MeV" = RID3P, "24-29 MeV" = RID4P, "29-67 MeV" = RID5P), id = "distance") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = distance, y = value, color = variable)) +
  geom_point(aes(x = distance, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI Protons", x = "Distance from Jupiter (km)", y = "Rate (cps)") +
  theme_light()

Nucleon helium

pcpi <- reshape2::melt(cpi %>% select(time = ts, "11-20 MeV" = RID2HE, "20-24 MeV" = RID3HE, "24-29 MeV" = RID4HE, "29-67 MeV" = RID5HE), id = "time") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = time, y = value, color = variable)) +
  geom_point(aes(x = time, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI nucleon He 1973", x = "Time", y = "Rate (cps)") +
  theme_light()

pcpi <- reshape2::melt(cpitraj %>% select(distance = SRANGE, "11-20 MeV" = RID2HE, "20-24 MeV" = RID3HE, "24-29 MeV" = RID4HE, "29-67 MeV" = RID5HE), id = "distance") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = distance, y = value, color = variable)) +
  geom_point(aes(x = distance, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI nucleon He", x = "Distance from Sun (km)", y = "Rate (cps)") +
  theme_light()

pcpi <- reshape2::melt(cpitraj %>% select(distance = PRANGE, "11-20 MeV" = RID2HE, "20-24 MeV" = RID3HE, "24-29 MeV" = RID4HE, "29-67 MeV" = RID5HE), id = "distance") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = distance, y = value, color = variable)) +
  geom_point(aes(x = distance, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI nucleon He", x = "Distance from Jupiter (km)", y = "Rate (cps)") +
  theme_light()

Electrons and minimum-ionizing rate

pcpi <- reshape2::melt(cpi %>% select(time = ts, "7-17 MeV Electrons" = RID5E1, "Double minimum-ionizing" = RID5E2), id = "time") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = time, y = value, color = variable)) +
  geom_point(aes(x = time, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI Electrons and minimum ionizing", x = "Time", y = "Rate (cps)") +
  theme_light()

pcpi <- reshape2::melt(cpitraj %>% select(distance = SRANGE, "7-17 MeV Electrons" = RID5E1, "Double minimum-ionizing" = RID5E2), id = "distance") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = distance, y = value, color = variable)) +
  geom_point(aes(x = distance, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI Electrons and minimum ionizing", x = "Distance from Sun (km)", y = "Rate (cps)") +
  theme_light()

pcpi <- reshape2::melt(cpitraj %>% select(distance = PRANGE, "7-17 MeV Electrons" = RID5E1, "Double minimum-ionizing" = RID5E2), id = "distance") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = distance, y = value, color = variable)) +
  geom_point(aes(x = distance, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI Electrons and minimum ionizing", x = "Distance from Jupiter (km)", y = "Rate (cps)") +
  theme_light()

Integral rate

pcpi <- reshape2::melt(cpi %>% select(time = ts, "Integral rate" = RID7, "Integral rate Z > 5" = RID7ZG5), id = "time") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = time, y = value, color = variable)) +
  geom_point(aes(x = time, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI ions at E > 67 MeV/nucleon", x = "Time", y = "Rate (cps)") +
  theme_light()

pcpi <- reshape2::melt(cpitraj %>% select(distance = SRANGE, "Integral rate" = RID7, "Integral rate Z > 5" = RID7ZG5), id = "distance") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = distance, y = value, color = variable)) +
  geom_point(aes(x = distance, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI ions at E > 67 MeV/nucleon", x = "Distance from Sun (km)", y = "Rate (cps)") +
  theme_light()

pcpi <- reshape2::melt(cpitraj %>% select(distance = PRANGE, "Integral rate" = RID7, "Integral rate Z > 5" = RID7ZG5), id = "distance") %>% filter(!is.na(value))
ggplot(data = pcpi) +
# geom_line(aes(x = distance, y = value, color = variable)) +
  geom_point(aes(x = distance, y = value, color = variable)) +
  scale_y_continuous(trans = 'log10') +
  labs(title = "Pioneer 10 CPI ions at E > 67 MeV/nucleon", x = "Distance from Jupiter (km)", y = "Rate (cps)") +
  theme_light()

3D Scatter

Average protons rate in Trajectory

p3d <- cpitraj%>% select(px, py, pz, Rate = RIDMP)
plot_ly(p3d, x = ~px, y = ~py, z = ~pz, color = ~Rate) %>%
  add_markers() %>%
  layout(scene = list(
    xaxis = list(title = 'km'),
    yaxis = list(title = 'km'),
    zaxis = list(title = 'km')))

Average rate of nucleon helium in Trajectory

p3d <- cpitraj%>% select(px, py, pz, Rate = RIDMHE)
plot_ly(p3d, x = ~px, y = ~py, z = ~pz, color = ~Rate) %>%
  add_markers() %>%
  layout(scene = list(
    xaxis = list(title = 'km'),
    yaxis = list(title = 'km'),
    zaxis = list(title = 'km')))

Average rate of electrons and ionizing in Trajectory

p3d <- cpitraj%>% select(px, py, pz, Rate = RIDME)
plot_ly(p3d, x = ~px, y = ~py, z = ~pz, color = ~Rate) %>%
  add_markers() %>%
  layout(scene = list(
    xaxis = list(title = 'km'),
    yaxis = list(title = 'km'),
    zaxis = list(title = 'km')))

Average integral rate in Trajectory

p3d <- cpitraj%>% select(px, py, pz, Rate = RIDM7)
plot_ly(p3d, x = ~px, y = ~py, z = ~pz, color = ~Rate) %>%
  add_markers() %>%
  layout(scene = list(
    xaxis = list(title = 'km'),
    yaxis = list(title = 'km'),
    zaxis = list(title = 'km')))