getgiss {clim.pact} | R Documentation

## Retrieve station record from the GISS or NARP data set from URL.

### Description

Reads the data from GISS available at URL: http://www.giss.nasa.gov/data/update/gistemp/ or NARP data from http://projects.met.no/~narp/data_index.html (http://thule.oulu.fi/narp/). Also see `getnordklim`, `getdnmi` and `getnacd`.

Use eg `options(timeout=120)` if problems with retreaving the GISS data. Some times, the code doesn't manage to read the data, and returns with the message: "cannot open: HTTP status was '404 Not Found'". Try again, since slow connections cause this problem. One trick that often helps is to use the function to get the name of the station (`stations <- getgiss()`), then use a browser (Mozilla) to open the data file from http://www.giss.nasa.gov/data/update/gistemp/station_data/, and then call `getgiss` again with the station details. It is easier to access the NARP data.

### Usage

    getgiss(stnr=NULL,location=NULL,lon=NULL,lat=NULL,stations=NULL,silent=FALSE)
    getnarp(stnr=NULL,location=NULL,lon=NULL,lat=NULL,stations=NULL,silent=FALSE,ele=101)

### Arguments

`stnr` | Station number.
`location` | Name of locvation.
`lon` | longitude. If both `lon` and `lat` are specified and the other arguments are not, then find the closest station.
`lat` | latitude.
`stations` | a list object with details of GISS stations (Prescribing this saves time).
`silent` | For verbose use.
`ele` | Element code: see http://projects.met.no/~narp/data_index.html.

### Value

a <- list of "monthly.station.record" class:

val | The monthly values (a 12-column matrix with one column for each year).
station | station number.
yy | The years of observation (vector).
lat,lon | Latitude and longitude of the location.
x.0E65N,y.0E65N | Distance in km from 0E, 65N.
location | Name of location .
wmo.no | WMO number.
start | Start of observatins from this location.
yy0 | First year in current record.
ele | Code of theelement.
obs.name | Name of the element.
unit | Unit of the element.
country | The country in which the location is located.
quality | Code/description for data quality.
found | Flag: T - the data requested was found.
ref | Reference for the data set.

or a list of station details if the requested station was not found.

### Author(s)

R.E. Benestad

### Examples

    ## Not run:
    #GISS:
    obs.oxford <- getgiss(location="Oxford")  # Takes longer time
    stations <- getgiss()
    obs.oxford <- getgiss(location="Oxford",stations=stations) #Quicker
    plotStation(obs.oxford)
    obs.broome <- getgiss(stnr="501942030004",stations=stations)
    obs.120E.40S <- getgiss(lon=120,lat=-40,stations=stations)

    #NARP:
    > obs <- getnarp(4360)
    #[1] "Retrieving the data from URL http://projects.met.no/~narp/narp"
    #[1] "Please be patient"
    #[1] "Found Tasilaq stnr= 4360  lon= -37.63  lat= 65.6  country= G"
    > obs <- getnarp(lon=-37,lat=65)
    #[1] "Retrieving the data from URL http://projects.met.no/~narp/narp"
    #[1] "Please be patient"
    #[1] "Find the nearest station to -37E and 65N."
    #[1] "Found Tasilaq stnr= 4360  lon= -37.63  lat= 65.6  country= G"
    > obs <- getnarp(lon=10,lat=60)
    #[1] "Retrieving the data from URL http://projects.met.no/~narp/narp"
    #[1] "Please be patient"
    #[1] "Find the nearest station to 10E and 60N."
    #[1] "Found Oslo stnr= 18700  lon= 10.72  lat= 59.95  country= N"
    ## End(Not run)

[Package clim.pact version 2.2-1 Index]