We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prototype function to bind list of scan objects into a pvol:
scan
pvol
scans2pvol=function(scans,radar,datetime,wavelength=10){ if (FALSE %in% sapply(scans,is.scan)){ stop("only scans expected as input") } vol=list() vol$radar=radar vol$datetime=datetime vol$scans=scans vol$attributes=list() vol$attributes$how$wavelength=wavelength vol$attributes$what$date=format(datetime, "%Y%m%d") vol$attributes$what$object="PVOL" vol$attributes$what$source=paste("RAD:",radar,sep="") vol$attributes$what$time=format(datetime, "%H%M%S") vol$attributes$where$height=scans[[1]]$geo$height vol$attributes$where$lat=scans[[1]]$geo$lat vol$attributes$where$lon=scans[[1]]$geo$lon vol$geo$height=scans[[1]]$geo$height vol$geo$lat=scans[[1]]$geo$lat vol$geo$lon=scans[[1]]$geo$lon class(vol)="pvol" vol }
Prototype function to bind list of param objects into a scan:
param
params2scan=function(...,startdate=Sys.time(),enddate=Sys.time()){ if (FALSE %in% sapply(list(...),is.param)){ stop("only scan parameters expected as input") } params=list(...) scan=list() scan$params=params param_names=sapply(params,function(x) attributes(x)$param) names(scan$params)=param_names scan$attributes=list() elangles=sapply(params,function(x) attributes(x)$geo$elangle) if(length(unique(elangles))!=1) stop("scan parameters with unequal elevations") rscales=sapply(params,function(x) attributes(x)$geo$rscale) if(length(unique(rscales))!=1) stop("scan parameters with unequal range dimension") ascales=sapply(params,function(x) attributes(x)$geo$ascale) if(length(unique(ascales))!=1) stop("scan parameters with unequal azimuth dimension") lats=sapply(params,function(x) attributes(x)$geo$lat) lons=sapply(params,function(x) attributes(x)$geo$lon) if(length(unique(lats))!=1 || length(unique(lons))!=1) stop("scan parameters have different radar latitude and/or longitude") heights=sapply(params,function(x) attributes(x)$geo$height) if(length(unique(ascales))!=1) stop("scan parameters with unequal antenna height") nbins=sapply(params,function(x) dim(x)[1]) nazims=sapply(params,function(x) dim(x)[2]) if(length(unique(nbins))!=1 || length(unique(nazims))!=1) stop("scan parameters have different dimensions") NIs=sapply(params,function(x) attributes(x)$how$NI) if(length(unique(NIs))!=1) stop("scan parameters with different nyquist intervals") scan$attributes=list() scan$attributes$how$NI=NIs[1] scan$attributes$where$elangle=elangles[1] scan$attributes$where$nbins=nbins[1] scan$attributes$where$nrays=nazims[1] scan$attributes$where$rscale=rscales[1] scan$attributes$what$enddate=format(enddate, "%Y%m%d") scan$attributes$what$endtime=format(enddate, "%H%M%S") scan$attributes$what$product="SCAN" scan$attributes$what$startdate=format(startdate, "%Y%m%d") scan$attributes$what$starttime=format(startdate, "%H%M%S") scan$geo=attributes(params[[1]])$geo class(scan)="scan" scan }
The text was updated successfully, but these errors were encountered:
Quick question should scans be ordered by time or elev angle when making a pvol? Is there a convention there?
Sorry, something went wrong.
I don't think there is a strict convention in ODIM, but ordered by elevation angle is most common
Ok but nothing to enforce in the function then
No, but it would be nice if it just sorts by itself. Above prototypes have been written a long time ago, so need some updating ...
No branches or pull requests
Prototype function to bind list of
scan
objects into apvol
:Prototype function to bind list of
param
objects into ascan
:The text was updated successfully, but these errors were encountered: