Skip to content
New issue

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

5-3 Adding Wind #4

Closed
grhyne opened this issue Sep 6, 2022 · 4 comments
Closed

5-3 Adding Wind #4

grhyne opened this issue Sep 6, 2022 · 4 comments

Comments

@grhyne
Copy link
Owner

grhyne commented Sep 6, 2022

When adding wind to the grl graph (5-3-wind-graph_create), I have hit this error regarding NA values only for tags CB596, CB599, and CB616:

> # Add wind
> grl <- graph_add_wind(grl,
+   pressure = pam$pressure,
+   filename = paste0("data/5_wind_graph/", gdl, "/", gdl, "_"),
+   thr_as = gpr$thr_as
+ )
[==========================                        ] 363925 / 696923 | sta = 2/10Error in ncdf4::ncvar_get(nc, "u", start = c(id_lon[1], id_lat[1], id_pres,  : 
  Error, passed a 'start' argument that has NA values: NA NA 2 1

I tried adding on an na.omit() to the graph_add_wind() function, but that did not seem to change anything. Which id_lon[1] and id_lat[1] is the error referring to in grl?

@Rafnuss
Copy link
Contributor

Rafnuss commented Sep 6, 2022

Is the repo up to date? Can a use the data there to reproduce the issue?

@grhyne
Copy link
Owner Author

grhyne commented Sep 6, 2022

Yes I just committed all my recent updates, go ahead and try

@Rafnuss
Copy link
Contributor

Rafnuss commented Sep 7, 2022

Hi @grhyne ,
I managed to track down this error. This is due to an error in labeling with a flight of a single timestep. Have you performed all checks suggested in 1-pressure.R? One of them should have pick up on this.
You can see that it has three flights (CB616), one with no duration.

> metadata(static_prob[[2]])
$sta_id
[1] 2

$nb_sample
[1] 13

$max_sample
[1] 300

$temporal_extent
[1] "2021-10-17 11:12:05 UTC" "2021-10-17 23:12:05 UTC"

$margin
[1] 30

$flight
$flight$start
[1] "2021-10-17 23:42:05 UTC" "2021-10-18 08:42:05 UTC" "2021-10-18 11:12:05 UTC"

$flight$end
[1] "2021-10-18 06:42:05 UTC" "2021-10-18 08:42:05 UTC" "2021-10-18 11:42:05 UTC"

$flight$sta_id
[1] 2 3 4

This is the currently label file and you can see the 1hours flight.
image

Here would be my suggestion for this file:
image

@grhyne
Copy link
Owner Author

grhyne commented Sep 7, 2022

Thank you for finding this! Ok I see, I think I was going conservative on labelling flights based on pressure spikes, and assumed those individual labels were short (~20-30 min) flight, which would only be detected by one point. I understand how you would label them, and it worked smoothly. It should have been picked up by the tests in 1-pressure, but I believe I had left the debug <- FALSE from the previous tag and thus did not detect the mislabelling.

@grhyne grhyne closed this as completed Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants