Closed lyggd closed 8 years ago
Thanks. I just tried plotting a few maps like this in the USA but can't reproduce your problem. If you save the trajectory data and email it to me that would be good. Save it as an RData file, something like save(traj_JLG, file = "traj_JLG.RData")
. Thanks.
Hi David, All the data have been send to your email david.carslaw@york.ac.uk. I appreciate your help very much. Best Regards,
This should be fixed now.
Hi David,
Thank you very much for your help. I re-run the code but it show erro :+1:
Error in match(x, table, nomatch = 0L) : object 'dateTypes' not found
3 match(x, table, nomatch = 0L) 2 group %in% dateTypes at myFunction_NARR.r#878 1 trajPlot(selectByDate(traj_JLG, start = "01/01/2013", end = "30/12/2014"), group = "intervals", col = c("green", "blue", "red"), lwd = 2, key.title = "O3 Concentration Bin", key.pos = "top", key.col = 3, border = NA, lon = "lon", lat = "lat", map = TRUE, map.fill = F, ...
Could you give some hint to fix this problem ? Thank you very much. Yi
Sounds like openair is not loaded properly - or you have a copy of an openair function in the Global environment, type ls()
to see what is there. I have tested the back trajectories and they work fine on the test data. I would try again in a fresh R session and then try:
traj <- importTraj()
trajCluster(traj, method = "Angle", n.cluster =6)
which should give the proportions...
Hi David,
The problem was finally solved !
One last question I hope related to trajCluster
is it can not do the seasonal plots.
My code is
traj <- importTraj(site = "london", year = 2010)
kc1 <- importAURN("kc1", year =2010)
traj <- merge(traj, kc1, by = "date")
clust <- trajCluster(traj, method = "Angle",type = "season", n.cluster = 8, map.cols = openColours("Paired", 10))
And it dose not work for me.
Thanks - away today but will fix shortly...
David On 8 Feb 2016 11:52 pm, "lyggd" notifications@github.com wrote:
Hi David, The problem was finally solved ! One last question I hope related to trajCluster is it can not do the seasonal plots. My code is
traj <- importTraj(site = "london", year = 2010) kc1 <- importAURN("kc1", year =2010) traj <- merge(traj, kc1, by = "date") clust <- trajCluster(traj, method = "Angle",type = "season", n.cluster = 8, map.cols = openColours("Paired", 10)) And it dose not work for me.
— Reply to this email directly or view it on GitHub https://github.com/davidcarslaw/openair/issues/43#issuecomment-181629962 .
Hopefully should be fixed now. When you have several panels e.g. with type = "season"
it will give the % contribution overall, rather than by panel.
Hello David,
Thank you very much.
I appreciate your help very much. The code I listed did work now.
But my personal code still not work.
Error in as.POSIXct.POSIXlt(what, tz = tzone) : invalid 'tz' value
I am wondering if there is still a timezone bug the openair function.
My personal code is
library("openair")
library("plyr")
library("lattice")
library('maps')
library('mapdata')
library('Cairo')
library('openxlsx')
library("mapproj")
library('cluster')
rm(list=ls())
traj <- importTraj(site = "JLG Supersite2", year = 2013:2014,
local ='M:/HYSPLIT/output/TrajProc/' )
traj$day <- as.Date(traj$date)
JLGTraj_24 <- subset(traj, hour.inc >= -24)
clust <- trajCluster(traj_JLG, method = "albers", n.cluster= 4, col = "Set2",type = 'season',
map.res = "state",main= "Cluster Map",
map.fill = F, grid.col = F, projection="albers",
xlim=c(-126,-105), ylim=c(28,42))
You already have my RData in 2013 and 2014, would you check this problem for me ? Thank you very much. Happy Chinese New Year ! Yi
The error is almost certainly because your date format is incorrect. What does str(traj_JLG)
return?
Problem solved. I appreciate your help so much. Just a following question: I find the number on the trajectory sometime is hard to read. Is there anyway to set the percentage number for each trajector ? Thanks
I too thought this would be useful, so rather than percentages for all periods, they can be expressed by panel. I have just committed a change where there is a new option by.type
, which when TRUE
will calculate the percentages by panel.
Sorry for bring the confusion. I just want to set the position of "percentage number" for each trajector ? For example, in winter panel, two number overlaid and make them hard to read. Thank you very much. Yi
I try to make colored my Hysplit tracks with different O3 concentraiton today and find a very interesting phenomena. My code is
traj_JLG$intervals<- cut(traj_JLG$O3, breaks = c(0, 0.05, 0.07,1.0), labels = c("0 to 0.05","0.05 to 0.07", ">0.07"))
trajPlot(selectByDate(traj_JLG, start = "01/01/2013", end = "30/12/2014"), group = "intervals" ,col = c("green", "blue", "red"), lwd =2,key.title='O3 Concentration Bin', key.pos = "top",key.col = 3, border = NA,lon = "lon", lat = "lat", map = TRUE ,map.fill = F,grid.col = F, map.res = "state", projection="albers", xlim=c(-126,-105), ylim=c(28,42))
But there are no background map for November, December, January and February (figure below).But as long as I delete
group = "intervals"
, the background map will come back. Is there anyone know why ? Thank you very much for your help. Best Regards, Yi