rich-iannone / splitr

Use the HYSPLIT model from inside R and do more with it
Other
141 stars 60 forks source link

Extended met not functioning as expected #9

Closed CRMcMahon closed 4 years ago

CRMcMahon commented 8 years ago

I am attempting to run backward trajectories with the extended_met option turned on. The resulting data frame only includes the 12 initial variables, but also has an extra row inserted after each expected record. I have attempted to run the extended met with both the reanalysis and NARR met types. Is this issue with my code/inputs or a function problem? Thanks for the help!

trajectory <- hysplit_trajectory( lat = 45.13767953, lon = -93.20761498, height = 500, duration = 72, run_period = c(2015), daily_hours = c(0), direction = "backward", met_type = "reanalysis", extended_met = T)

head(trajectory) receptor year month day hour hour.inc lat lon height pressure date2 date 1 1 15.0 1 1 0 0 45.138 -93.208 500.0 909.9 2015-01-01 00:00:00 2015-01-01 2 1 0.0 NA NA NA NA NA NA NA NA 2015-01-01 3 1 14.0 12 31 23 -1 45.244 -93.843 496.6 909.8 2014-12-31 23:00:00 2015-01-01 4 1 0.0 NA NA NA NA NA NA NA NA 2015-01-01 5 1 14.0 12 31 22 -2 45.364 -94.490 492.4 909.9 2014-12-31 22:00:00 2015-01-01 6 1 104.1 NA NA NA NA NA NA NA NA 2015-01-01

rich-iannone commented 8 years ago

@CRMcMahon just saw this issue now, sorry! Will look into why this is the case.

rich-iannone commented 8 years ago

@CRMcMahon quick question that would be helpful to diagnose/fix this: which operating system are you using to run the above analysis?

rich-iannone commented 8 years ago

@CRMcMahon I was able to run the following code on a Mac with no issue:

library(SplitR)

trajectory <- 
  hysplit_trajectory(
    lat = 45.13767953,
    lon = -93.20761498,
    height = 500,
    duration = 72,
    run_period = 2015,
    daily_hours = 0,
    direction = "backward",
    met_type = "reanalysis",
    extended_met = TRUE)

saveRDS(trajectory, file = "trajectory_2015.rds")

So I wonder if this is a Windows (or Linux?) issue. I'll investigate the code on the other platforms but, in the meantime, I've attached the output here as a zipped RDS file (which can be opened as a data frame in R using the readRDS() function).

trajectory_2015.rds.zip

CRMcMahon commented 8 years ago

Sorry for my delayed response. Was out on vacation and message was buried. Yes, operating on Windows 64 bit. I also have access to a Mac and will use that as a work around in the interim. Thank you for the response!

From: Richard Iannone [mailto:notifications@github.com] Sent: Friday, August 19, 2016 2:26 PM To: rich-iannone/SplitR SplitR@noreply.github.com Cc: McMahon, Cassie (MPCA) cassie.mcmahon@state.mn.us; Mention mention@noreply.github.com Subject: Re: [rich-iannone/SplitR] Extended met not functioning as expected (#9)

@CRMcMahonhttps://github.com/CRMcMahon I was able to run the following code on a Mac with no issue:

library(SplitR)

trajectory <-

hysplit_trajectory(

lat = 45.13767953,

lon = -93.20761498,

height = 500,

duration = 72,

run_period = 2015,

daily_hours = 0,

direction = "backward",

met_type = "reanalysis",

extended_met = TRUE)

saveRDS(trajectory, file = "trajectory_2015.rds")

So I wonder if this is a Windows (or Linux?) issue. I'll investigate the code on the other platforms but, in the meantime, I've attached the output here as a zipped RDS file (which can be opened as a data frame in R using the readRDS() function).

trajectory_2015.rds.ziphttps://github.com/rich-iannone/SplitR/files/427744/trajectory_2015.rds.zip

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/rich-iannone/SplitR/issues/9#issuecomment-241112490, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AH0AxITwY5mkD6KT0zxYyd7HKlTCgcFqks5qhgNjgaJpZM4JgYzV.

madhulika92 commented 7 years ago

I have been trying to load the gdas0p5 meteorological file in the met_type. I get the error in matrix(0, nr, nc) : object 'met' not found.

When I try loading gdas1, it works but takes too long to load. What should be the expected output after running this command? It says "trying URL 'ftp://arlftp.arlhq.noaa.gov/archives/gdas1/gdas1.jan17.w1'".

trajectory <- hysplit_trajectory(lat = 28.5040, lon = 77.3018, height = 200, duration = 24, run_period = "2017-01-01", daily_hours = c(0, 6, 12, 18), direction = "forward", met_type = "gdas0p5", extended_met = TRUE)

Is it possible to load the manually downloaded met files into R using the above code?

IsotopeGuy commented 5 years ago

Please, do You have any idea to solve the above problem? Still no extended_met with Win10 64bit. Thanks! rasto.  

1 | 18 | 1 | 12 | 0 | 0 | 48.000 | 20.000 | 500.0 | 929.3 | 2018-01-12 00:00:00 | 2018-01-12 2 | 1 | NaN | NA | NA | NA | NA | NA | NA | NA | NA | NA | 2018-01-12 3 | 1 | 18 | 1 | 11 | 23 | -1 | 48.091 | 20.102 | 485.4 | 929.6 | 2018-01-11 23:00:00 | 2018-01-12 4 | 1 | NaN | NA | NA | NA | NA | NA | NA | NA | NA | NA | 2018-01-12

elhamba commented 5 years ago

traj_df.zip Hi, I get extra rows (e.g. look at the year column; the numbers don't make sense) with NaN (attached data) in most columns (except date and year). I'm running the following code: trajectory_model <- create_traj_model() %>% add_grid( lat = 33.572019, lon = -116.064, range = c(0.8, 0.8), division = c(0.2, 0.2)) %>% add_params( height = 50, duration = 6, run_period = "2018-02-11", daily_hours = c(0,6,12,18),

daily_hours = c(0,12),

direction = "backward",
met_type = "narr") %>% 

run_model() After I filtered the data (deleted the rows with year != 18), tried to plot them but it doesn't give me anything (nor an error). I managed to get a plot with daily_hours = c(0,12) but couldn't get the plot next times I tried to redo this.

Also when trying to make a dispersion_model object I get the following error: Error in matrix(0, nr, nc) : object 'met' not found

And, YES, I am running my code on windows 66bit OS too.

I'd appreciate any help. Thank you. -Ellie

rich-iannone commented 4 years ago

This should now (finally) be working on Windows 10 with the latest changes in master.