search for: lon

Displaying 20 results from an estimated 396 matches for "lon".

Did you mean: long
2007 Apr 04
5
how to image.plot a XY grid file into a lat-lon map
Hi All, I have a netcdf gridded file with LCC projection. I can easily use image.plot to visualize it. However, as the axises are in X,Y, not Lat and Lon, I could not add state or country maps onto it (or lat lon information). I do have a grid2d file that describes the lat and lon for each (X,Y) grid, but the lat and lon are not regularly spaced, so I could not use image.plot. Does anyone know how to plot this type of gridded data so that country...
2011 Sep 07
3
Editing the variables attributes section in the netCDF header of netCDF files created using the package ncdf.
Hi, I am using the package ncdf to create netCDF files and I want to mimic the the header of an exiting netCDF file created outside of R. Below is what the existing header looks like (part of it that is different): netcdf ccd1984_05_08 { dimensions: lat = 1974 ; lon = 1894 ; time = UNLIMITED ; // (1 currently) variables: int time(time) ; time:long_name = "time" ; time:units = "days since 1984-05-01 0:0:0" ; time:day_begins = "06:15" ; double lat(lat) ;...
2009 Nov 10
3
NetCDF output in R
...ite out netcdf file in R. I have 26 time step but only the first time step is written. For example: >library(ncdf) >path <- '/home/work/' >forecast <- open.ncdf(paste(path,'cam.1980.2005.nc',sep="")) > fore <- get.var.ncdf(forecast,'ppt') > lon <- get.var.ncdf(forecast,'lon') > lat <- get.var.ncdf(forecast,'lat') >dim(fore)[3] >26 > times <- 1:dim(fore)[3] > write.netcdf.time(paste(path,'cam_fore.nc',sep=""), fore,lon,lat,times) [1] "put.var.ncdf: warning: you asked to write 1...
2009 Nov 10
3
NetCDF output in R
...ite out netcdf file in R. I have 26 time step but only the first time step is written. For example: >library(ncdf) >path <- '/home/work/' >forecast <- open.ncdf(paste(path,'cam.1980.2005.nc',sep="")) > fore <- get.var.ncdf(forecast,'ppt') > lon <- get.var.ncdf(forecast,'lon') > lat <- get.var.ncdf(forecast,'lat') >dim(fore)[3] >26 > times <- 1:dim(fore)[3] > write.netcdf.time(paste(path,'cam_fore.nc',sep=""), fore,lon,lat,times) [1] "put.var.ncdf: warning: you asked to write 1...
2018 May 20
1
How to average values from grid cells with coordinates
Hi lily, It's not too hard to do it using dataframes. Getting the indexing right is usually that hardest part: # these values are the centers of the black cells lat<-rep(28:38,11) lon<-rep(98:108,each=11) pop<-sample(80:200,121) # just use the data.frame function blackcells<-data.frame(lat=lat,lon=lon,pop=pop) plot(0,type="n",xlim=c(97.5,108.5),ylim=c(27.5,38.5), xlab="Longitude",ylab="Latitude") abline(h=27.5) abline(h=lat+0.5) abline(v=9...
2004 May 23
0
RE: {Virus?} {Spam?} Hi
Thank you for your email to the UNIVERSITY OF LONDON ACCOMMODATION OFFICE (ULAO). This automatic reply has been made necessary by the volume of emails we receive; you should not reply to it. Please be advised that if your email is of a general nature and the links below direct you to the information, we will not be able to send you an indivi...
2010 Jan 05
3
R matching lat/lon pairs from two datasets?
Hello, I am trying to match lat/lon from one dataset with the lat/lon from a second dataset and use that rows data for calculations. I am using match, but this is finding the first match and not comparing the pair, how can I determine if the lat/lon are the same? See example below. Is there a better way to determine to a match...
2012 Nov 20
2
[lattice] how to overlay a geographical map on a levelplot?
...> (or Trellis), e.g., of levelplot's? Note I am not inquiring about > creating choropleth maps[,] which Sarkar 2008 covers quite well (and which is supported by latticeExtra::mapplot): I just want to appropriately overlay a garden-variety boundary-line map on panel viewspaces defined by longitude and latitude. A relatively small, quite self-contained example follows the quote above, in which I plot toy data in the sort of lattice layout I need ... except that each panel lacks a map appropriate to the spatial domain. If your competencies extend to that, your assistance would be apprec...
2011 Mar 21
1
Lat Lon NetCDF subset
...9;m relatively experienced using R, I'm still new to netCDF files, so this may be a very simple/stupid question! I've included an example of the type of file I'm looking at here. www.met.reading.ac.uk/~swp06hg/ccd1983_01-dk1_20.nc (~7Mb) It's a 2D array of the variable CCD along with its lat and long coordinates. This is its R summary #[1] "file ccd1983_01-dk1_20.nc has 2 dimensions:" #[1] "lat Size: 1974" #[1] "lon Size: 1894" #[1] "------------------------" #[1] "file ccd1983_01-dk1_20.nc has 1 variables:" #[1] &quot...
2009 Jan 22
1
convergence problem gamm / lme
...ain the spatial distribution of juvenile fish. We have 2135 records, from 75 vessels (code_tripnr) and 7 to 39 observations for each vessel, hence the random effect for code_tripnr. The offset (‘offsetter’) accounts for the haul duration and sub sampling factor. There are no extreme outliers in lat/lon. The model we try to fit is: > gamm3<-gamm(count~offset(offsetter)+s(lon,lat),random=list(code_tripnr=~1),family="poisson", niterPQL=200) Maximum number of PQL iterations: 200 iteration 1 iteration 2 Error in MEestimate(lmeSt, grps) : NA/NaN/Inf in foreign function call...
2011 May 06
1
read a netcdf file _Fill_value=-32768
...e problem with R and netcdf . I succed installation , I could use all examples . But when I take my netcf it is different . I want to do statistic on this kind of file . 1) first calculate mean . my data is like that through ncdump -h test.nc netcdf test { dimensions: lat = 301 ; lon = 401 ; time = UNLIMITED ; // (80 currently) variables: float lat(lat) ; lat:long_name = "latitude" ; lat:standard_name = "latitude" ; lat:units = "degrees_north" ; lat:valid_range = -60.,...
2018 Jan 24
0
Issue with concatenation of URL losing
...actually part of it. If you want to see the contents of the string without the escaping, use the cat function instead of depending on the default print behavior (which shows the escape characters). c) The format of the GET request string includes parameter identifiers "lat" and "lon"... don't get confused between those strings being sent to the webserver and what your variables are called. Also, following those strings and a colon are numeric values... those are what you need to replace. Your attempt did not remove the literal digits from the surrounding strings....
2018 Jan 24
2
Issue with concatenation of URL losing
Thank you for your help in advance. I am trying to pull some data back from a web service library(httr) sample2 <- GET("https://elevation.mapzen.com/height?json={\"range\":false,\"shape\":[{\"lat\":40.7,\"lon\":-76.5}]}&api_key=mycode") result2 <- content(sample2) height <- result2$height[[1]] I would like to put by own latitude and longitude in but alas when I use paste() to combine the double quotes become stuck as literally \" lat <-10 long <20 library(httr) sampl...
2008 Feb 28
1
problem of subscript value from vector and list
Hi, everyone I got some problems when trying to subscript the value of vector and list, by using calculated indices. Here is the vector I am generated lon<-rep(0,886);lat<-rep(0,691) for (i in 1:886){ lon[i]<-112+0.05*(i-1) } for (i in 691:1){ lat[i]<--44.5+0.05*(691-i) } For a given location of lon(xp) and lat(yp), I would like to calculate the position of them, and using that to get the value for the location from one...
2018 May 22
0
How to average values from grid cells with coordinates
...o variables such as pop and mood. For each variable, there are daily records in one year, so 365 records for pop and 365 records for mood. The averaged values for the redcells should be daily records too. What kind of format do you recommend for this problem? Right now, I just get the latitudes and longitudes into a dataframe. Thanks. On Sun, May 20, 2018 at 3:52 AM, Jim Lemon <drjimlemon at gmail.com> wrote: > Hi lily, > It's not too hard to do it using dataframes. Getting the indexing > right is usually that hardest part: > > # these values are the centers of the blac...
2018 May 16
0
How to average values from grid cells with coordinates
Hi lily, There are one or two assumptions to be made here. First is that the latitude and longitude values of the "black" cells are equally spaced as in your illustration. Second, that all latitude and longitude values for the "red" cells fall at the corners of four "black" cells. You can get the four "black" cells by finding the lat/lon values that...
2013 Feb 22
3
Help xyplot
Hi Mackay and anybody (a) Is it possible to select randomly (let say five grids) and plot? (b) Is it possible to plot five nearest grid in one figure? The original question and improved codes: #I am ploting gridded time series data. I would like the actual lat #and lon value appear on the graph-if possible inside the graph as #numbers. If there is also more elegant ways to plot the graphs I #>will appreciate more suggestions. ################################# library(ggplot2) library(lattice) month <- c("Jan", "Feb", "Mar", &...
2011 Jun 07
1
RgoogleMaps Axes
...ubmission: http://stackoverflow.com/questions/6258408/rgooglemaps-axes "I can't find any documentation of the following problem I'm having with the axis labels in RGoogleMaps: library(RgoogleMaps) datas <-structure(list(LAT =c(37.875,37.925,37.775,37.875,37.875), ? ? ? ? ? ? ? ? ? ?LON =c(-122.225,-122.225,-122.075,-122.075,-122.025)), ? ? ? ? ? ? ? ? ? ?.Names=c("LAT","LON"),class="data.frame", ? ? ? ? ? ? ? ? ? ?row.names =c(1418L,1419L,1536L,1538L,1578L)) # Get bounding box. boxt <-qbbox(lat =datas$LAT,lon =datas$LON) MyMap<-GetMap.bbox(boxt...
2017 Aug 28
3
Extracting subset from netCDF file using lat/lon and converting into .csv in R
...ndspeed/relative humuidity/radiation etc. I get the following information when using *nc_open* function in R: datafile: https://www.dropbox.com/s/xpo7zklcmtm3g5r/gfdl_preci.nc?dl=0 File gfdl_preci.nc (NC_FORMAT_NETCDF4_CLASSIC): 1 variables (excluding dimension variables): float prAdjust[lon,lat,time] _FillValue: 1.00000002004088e+20 missing_value: 1.00000002004088e+20 comment: includes all types (rain, snow, large-scale, convective, etc.) long_name: Bias-Corrected Precipitation units: kg m-2 s-1 standard_name: pre...
2013 Feb 20
2
xyplot help
I am ploting gridded time series data. I would like the actual lat and lon value appear on the graph-if possible inside the graph as numbers. If there is also more elegant ways to plot the graphs I will appreciate more suggestions. ################################# library(ggplot2) library(lattice) month <- c("Jan", "Feb", "Mar", "Apr...