Displaying 5 results from an estimated 5 matches for "nlon".
Did you mean:
lon
2012 Jul 23
2
translating IDL to R
...y experts in IDL-to-R porting out there, I'd appreciate your
assistance.
TIA, Tom Roche <Tom_Roche at pobox.com>---2 IDL routines follow to EOF---
from ftp://gfed3:dailyandhourly at zea.ess.uci.edu/GFEDv3.1/Readme.pdf
;++++++++++++++++++++ idl code to generate daily emissions +++++++++
nlon=720 ; number of grid points by longitude
nlat=360 ; number of grid points by latitude
gfedmly=fltarr(nlon,nlat) ; array containing monthly emissions
gfeddly=fltarr(nlon,nlat) ; array containing daily emissions
; You must read monthly emissions to generate daily fluxes.
; For example, if you want d...
2017 Aug 28
3
Extracting subset from netCDF file using lat/lon and converting into .csv in R
...ename
setwd("D:/netcdf")
ncname <- "gfdl_preci"
ncfname <- paste(ncname, ".nc", sep = "")
dname <- "prAdjust"
# open a netCDF file
ncin <- nc_open(ncfname)
print(ncin)# get longitude and latitude
lon <- ncvar_get(ncin,"lon")
nlon <- dim(lon)
head(lon)
lat <- ncvar_get(ncin,"lat")
nlat <- dim(lat)
head(lat)
print(c(nlon,nlat))
# get time
time <- ncvar_get(ncin,"time")
time
tunits <- ncatt_get(ncin,"time","units")
nt <- dim(time)
nt
tunits
# get variable
preci.array...
2013 Jul 19
1
Problem with distributing data in package.
...to build the
netcdf file and 'ncdf' object below.
Thanks in advance,
Simon Knapp
#--------------------------R code starts here--------------------------
# create a netcdf file holding a 'temporal stack'
combined.ncdf <- with(new.env(), {
require(ncdf)
nLat <- 7
nLon <- 8
nTime <- 9
missing.val <- -999
filename <- file.path(tempdir(), 'combined_d6fg4s64s6g4l.nc')
lat.dim <- dim.def.ncdf('lat', 'degrees', 1:nLat)
lon.dim <- dim.def.ncdf('lon', 'degrees', 1:nLon)
time.dim <- dim....
2017 Aug 28
0
Extracting subset from netCDF file using lat/lon and converting into .csv in R
...ncname <- "gfdl_preci"
> ncfname <- paste(ncname, ".nc", sep = "")
> dname <- "prAdjust"
> # open a netCDF file
> ncin <- nc_open(ncfname)
> print(ncin)# get longitude and latitude
> lon <- ncvar_get(ncin,"lon")
> nlon <- dim(lon)
> head(lon)
>
> lat <- ncvar_get(ncin,"lat")
> nlat <- dim(lat)
> head(lat)
>
> print(c(nlon,nlat))
> # get time
> time <- ncvar_get(ncin,"time")
> time
>
> tunits <- ncatt_get(ncin,"time","units&qu...
2000 Dec 22
2
REading the netCDF format into R
.../* returned by malloc in ncread */
double ofs, scl; /* offset and scaling
factors */
double *ptr;
SEXP field, dim, dimnames, lon, lat, tim, missing;
printf("ncfile= %s, vname=%s\n",fname,vname);
printf("\nfield->%x\nlon -> %x\nlat -> %x\ntim -> %x\nmissing ->
%x\n",
field,lon,lat,tim,missing);
/* Call the function dealing with the netCDF data */
/* The data is placed in memeory */
status=ncread(fname, vname, &nx, &ny, &nt, &ptrs, &scl, &ofs);
/* Allocate...