3 Visualization

3.1 Regional map

Image/heatmap plot of a table variable from the Simons CMAP database in a given range of latitude and longitude at a fixed time and depth.

Specify following parameters to retrieve the required data using get_spacetime.

  • Table Name (tableName)
  • Variables to be extracted (varName)
  • Spatio-temporal range variable includes (latitude, longitude, depth, time)

plot_regmap function download the data, and output a regional map plot object: plot_ly/ggplot2 with "x axis" as "longitude" and "y axis" as "lattitude". User can modify the plot object to produce a properly annotated visualization.

tableName <- "tblsst_AVHRR_OI_NRT"
varName <- "sst"

# Range variable [lat,lon,time,depth]
lat1 = 10; lat2 = 70
lon1 = -180; lon2 = -80
dt1 = "2016-04-30"; dt2 = "2016-04-30"
depth1 <- 0; depth2 =  0

p <- plot_regmap(tableName, varName, lat1, lat2, lon1, lon2,
                  dt1, dt2, depth1, depth2, type = "plotly")
p

3.2 Time series plot

Create a timeseries plot of a table variable from the Simons CMAP database using the specified space-time constraints (dt1, dt2, lat1, lat2, lon1, lon2, depth1, depth2). Internally, the plot function calls get_timeseries to download data aggregated by time.

Specify the following parameters to retrieve the required data from the Simons CMAP.

  • Table Name (tableName)
  • Variables to be extracted (varName)
  • Spatio-temporal range variable includes (latitude, longitude, depth, time)

Call plot_ts function to obtain plot_ly/ggplot2 object. User can modify the plot object to produce a properly annotated visualization.

# Input variable:
tableList <- c("tblSST_AVHRR_OI_NRT", "tblAltimetry_REP", "tblPisces_NRT")
varList <- c("sst", "sla", "NO3")

# selected "sst" from the table "tblSST_AVHRR_OI_NRT"
selIndex <- 1
tableName <- tableList[selIndex]
varName <- varList[selIndex]

# Range variable [lat,lon,time,depth]
lat1 = 25; lat2 = 30
lon1 = -160; lon2 = -155
dt1 = "2016-03-29"; dt2 = "2016-05-29"

# Plot -- Time series:
p <- plot_ts(tableName, varName, lat1, lat2, lon1, lon2,
             dt1, dt2)
p

3.3 Depth profile plot

Create a depth profile plot of a table variable from the Simons CMAP database using the specified space-time constraints (dt1, dt2, lat1, lat2, lon1, lon2, depth1, depth2). Internally, the plot function calls get_depthprofile to download the data aggregated by depth.

Specify the following parameters to retrieve the required data from the Simons CMAP.

  • Table Name (tableName)
  • Variables to be extracted (varName)
  • Spatio-temporal range variable includes (latitude, longitude, depth, time)
  • Depth will be used as an aggregate variable

Call plot_depth function to obtain plot_ly/ggplot2 object. User can modify the plot object to produce a properly annotated visualization.

# Inpit variable:
tableList <- c('tblArgoMerge_REP', 'tblPisces_NRT', 'tblDarwin_Ecosystem')
varList <- c('argo_merge_chl_adj', 'CHL', 'CHL')
#
# selected argo_merge_chl_adj from tblArgoMerge_REP
selIndex <- 1
tableName <- tableList[selIndex]
varName <- varList[selIndex]
#
# Range variable [lat,lon,time,depth]
lat1 = 20; lat2 = 24
lon1 = -170; lon2 = -150
dt1 = "2014-04-25"; dt2 = "2014-04-30"
depth1 <- 0; depth2 =  1500


# Plot -- Depth profiles:
p <- plot_depth(tableName, varName, lat1, lat2, lon1, lon2,
                        dt1, dt2,depth1, depth2, "plotly")
p

3.4 XY plot

Create a scatter plot of two table variables from the Simons CMAP database using the specified space-time constraints (dt1, dt2, lat1, lat2, lon1, lon2, depth1, depth2). Internally, the plot function calls get_timeseries/get_depthprofile/get_spacetime to download the data. Why aggregate though? The two variables from the two tables might exist at different time/space resolutions. Because of this potential discrepancy in data resolution, averaging the two datasets at some resolution according to, say, agg_var="time", by day, is a useful step before plotting a relationship between the two.

Specify the following parameters to retrieve the required data from the Simons CMAP.

  • Table list (list of tableName)
  • Variable list to be extracted (list of variable name)
  • Spatio-temporal range variable includes (latitude, longitude, depth, time)
  • Specify aggregate variable (time/depth/latitude/longitude)

Call plot_xy function to obtain plot_ly/ggplot2 object. User can modify the plot object to produce a properly annotated visualization.

# Input variable:
tableList <- c("tblSST_AVHRR_OI_NRT", "tblAltimetry_REP")
varList <- c("sst", "sla")

# Range variable [lat,lon,time,depth]
lat1 = 25; lat2 = 30
lon1 = -160; lon2 = -155
dt1 =  "2016-03-29"; dt2 = "2016-05-29"
depth1 <- NULL; depth2 =  NULL

# Aggregate variable
agg_var <- "time"

# xy plot
p <- plot_xy(tableList, varList, lat1, lat2, lon1, lon2,
               dt1, dt2, depth1, depth2, agg_var)
p

3.5 Histograms

Create a histogram plot of a table variable from the Simons CMAP database using the specified space-time constraints (dt1, dt2, lat1, lat2, lon1, lon2, depth1, depth2). Internally, the plot function calls get_spacetime to download the data.

Specify the following parameters to retrieve the required data from the Simons CMAP.

  • Table Name (tableName)
  • Variables to be extracted (varName)
  • Spatio-temporal range variable includes (latitude, longitude, depth, time)

Call plot_hist function to obtain plot_ly/ggplot2 object. User can modify the plot object to produce a properly annotated visualization.

# Inpit variable:
tableList <- c("tblSST_AVHRR_OI_NRT", "tblArgoMerge_REP", "tblArgoMerge_REP")
varList <- c("sst", "argo_merge_temperature_adj", "argo_merge_salinity_adj")

# variable "sst" selected from "tblSST_AVHRR_OI_NRT"
selIndex <- 1
tableName <- tableList[selIndex]
varName <- varList[selIndex]

# Range variable [lat,lon,time,depth]
lat1 = 20; lat2 = 24
lon1 = -170; lon2 = -150
dt1 = "2016-04-30"; dt2 = "2016-04-30"
depth1 <- NULL; depth2 =  NULL

p <- plot_hist(tableName, varName, lat1, lat2, lon1, lon2,
               dt1, dt2, depth1, depth2, "plotly")
p