Archivo:WSPR 2014.svg

Contenido de la página no disponible en otros idiomas.
De Wikipedia, la enciclopedia libre

Ver la imagen en su resolución original((Imagen SVG, nominalmente 540 × 450 pixels, tamaño de archivo: 136 kB))

Resumen

Descripción
English: Density distribution of WSPR spots, January 2014 vs July 2014, using only most distant reception per spot.
Fecha
Fuente Trabajo propio
Autor Kaizen Dave

R code to produce chart

rm(list=ls())
gc(verbose=TRUE, reset=TRUE)

library(stringi)
library(plyr)
library(dplyr)
library(ggplot2)

# Function to get spots for a given month.  Downloads zip file from WSPR web site and saves it as local
# RData if necessary, otherwise reads local RData file.  Performs minor cleanup on downloaded file.

GetSpots <- function(year, month) {
    
    if ( ! dir.exists("./spots") ) {
        dir.create("./spots")
    }
    month <- sprintf("%02d", month)
    rdata <- stri_join("./spots/wsprspots-", year, "-", month, ".RData")
    if ( file.exists(rdata) ) {
        message(stri_join("Loading: ", rdata))
        load(rdata)
    } else {
        url <- stri_join("http://wsprnet.org/archive/wsprspots-", year, "-", month, ".csv.zip")
        zip <- stri_join("./spots/wsprspots-", year, "-", month, ".csv.zip")
        csv <- stri_join("./spots/wsprspots-", year, "-", month, ".csv")
        if ( ! file.exists(csv) ) {
            message(message(stri_join("Downloading: ", zip)))
            download.file(url, zip, method = "curl")
            unzip(zip, exdir = "./spots")
            file.remove(zip)
        }
        message(stri_join("Reading: ", csv))
        spots <- read.csv(csv,
                          header = FALSE,
                          stringsAsFactors = FALSE,
                          col.names = c("id", "ts", "dst.call", "dst.grid", "snr", "freq", "src.call",
                                        "src.grid", "pwr", "drift", "km", "az", "band", "ver", "code"),
                          colClasses = c("integer", "integer", "character", "character", "integer", "numeric",
                                         "character", "character", "integer", "integer", "integer", "integer",
                                         "integer", "character", "integer"))
        # Generate POSIXlt from decimal.
        spots$ts <- as.POSIXlt(spots$ts, origin = "1970-01-01", tz = "GMT")
        # UCASE call signs and grids.
        spots$src.call <- toupper(spots$src.call)
        spots$src.grid <- toupper(spots$src.grid)
        spots$dst.call <- toupper(spots$dst.call)
        spots$dst.grid <- toupper(spots$dst.grid)
        # Dump zero-distance spots.
        spots <- spots[spots$km > 0,]
        # Save as RData for future quick load.
        save(spots, file = rdata)
        file.remove(csv)
    }
    spots
}

bandname <- list()
bandname[[28]] <- "10M"
bandname[[14]] <- "20M"
bandname[[7]]  <- "40M"
rdata <- "./spotinfo.RData"
if ( file.exists(rdata) ) {
    message(stri_join("Loading: ", rdata))
    load(rdata)
} else {
    spotinfo <- NULL
    year <- 2014
    for ( month in c(7, 1) ) {
        spots <- GetSpots(year, month)
        for ( band in c(28, 14, 7) ) {
            # Trim to band of interest and remove ground wave (~100 miles/160km) spots.
            tmp <- spots[spots$band == band & spots$km > 160, c("ts", "src.call", "km")]
            # We will soon rely on the fact that all spots are transmitted on the top of the
            # minute - i.e. at YYYY-MM-MM HH:MM:00. (Note 00 seconds.)  Verify.
            stopifnot(0 == sum(spots$ts$sec != 0))
            # Convert timestamp to character as dplyr can't sort on POSIXlt.
            tmp$tsc <- as.character(tmp$ts)
            tmp$ts <- NULL
            # Group by src.call and timestamp.  I.e. group all receptions of a single transmission.
            g <- group_by(tmp, src.call, tsc)
            # Keep only the most distant reception for each transmission.
            s <- summarise(g, km.max = max(km, na.rm = TRUE))
            # Build data frame such that we can use ggplot2 facets.
            spotinfo <- rbind(spotinfo, data.frame(Month = month.name[month],
                                                   Band = bandname[[band]],
                                                   vals = s$km.max))
        }
    }
    save(spotinfo, file = rdata)
}

g <- ggplot(spotinfo, aes(x = vals)) +
    geom_density(data = spotinfo,
                 alpha = 0.3,
                 aes(x = vals, group = Month, colour = Month)) +
    facet_grid(Band ~ .) + 
    scale_color_brewer(palette="Set1") +
    # Title not required, use caption in Wikipedia to describe.
    # ggtitle("Density Distribution of WSPR Spots\nJanuary 2014 vs July 2014\n(using only most distant reception per spot)") +
    xlab("Kilometers") +
    ylab("Density") +
    theme(axis.title.x = element_text(size = rel(1.25))) +
    theme(axis.title.y = element_text(size = rel(1.25))) +
    theme(strip.text.y = element_text(angle = 0, face = "bold", size = rel(1.5)))
g

svg("./WSPR 2014.svg", width = 6, height = 5)
g
dev.off()

Licencia

Yo, el titular de los derechos de autor de esta obra, la publico en los términos de la siguiente licencia:
w:es:Creative Commons
atribución compartir igual
Este archivo está disponible bajo la licencia Creative Commons Attribution-Share Alike 4.0 International.
Eres libre:
  • de compartir – de copiar, distribuir y transmitir el trabajo
  • de remezclar – de adaptar el trabajo
Bajo las siguientes condiciones:
  • atribución – Debes otorgar el crédito correspondiente, proporcionar un enlace a la licencia e indicar si realizaste algún cambio. Puedes hacerlo de cualquier manera razonable pero no de manera que sugiera que el licenciante te respalda a ti o al uso que hagas del trabajo.
  • compartir igual – En caso de mezclar, transformar o modificar este trabajo, deberás distribuir el trabajo resultante bajo la misma licencia o una compatible como el original.
 
Este gráfico vectorial, sin especificar según el W3C, fue creado con R.

Leyendas

Añade una explicación corta acerca de lo que representa este archivo

Elementos representados en este archivo

representa a

Historial del archivo

Haz clic sobre una fecha y hora para ver el archivo tal como apareció en ese momento.

Fecha y horaMiniaturaDimensionesUsuarioComentario
actual23:21 6 nov 2015Miniatura de la versión del 23:21 6 nov 2015540 × 450 (136 kB)Kaizen DaveRemoved cryptic title from graphic as there is ample room to describe graphic in Wikipedia caption.
19:17 6 nov 2015Miniatura de la versión del 19:17 6 nov 2015540 × 450 (163 kB)Kaizen DaveUser created page with UploadWizard

La siguiente página usa este archivo:

Uso global del archivo

Las wikis siguientes utilizan este archivo:

Metadatos