Skip to content

NAs not propogating correctly + bug in na_rm functionality #54

@yougsanghvi

Description

@yougsanghvi

Hi!

Back with another (hopefully) quick couple of issues:

  1. I am using ERA5 Land and aggregating t2m to Nigeria and Nicaragua. As seen in the plots below, ERA5 land doesn't have data on some grid cells by the shore. However, they do overlap with the relevant polygons and as a result should propagate an NA for the whole polygon. However, as seen in the figure it seems that doesn't happen? Instead, it spits out a weirdly smaller number (seemingly assuming the NA grid cell as 0). Also, this is when I keep na_rm as the default - false. I didn't know that was an option initially since it wasn't in the documentation (maybe since it's in development not sure!). In general, haven't looked at this all that deeply so happy to iterate if you think it may be something on my side. The main issue I spent time looking at is the second one.
  2. When I use the na_rm functionality to ignore NAs, it gives me much smaller values (monthly means instead of sums). I also get an extra column called w_area in the staggregate output. I think that is because of how you normalize weighting after dropping NAs. I think a better approach would be to normalize weights before doing the multiplication of weights * grid cell value.

Below are the plots I am referring to. This is when na_rm is set to false. The issue is probably most obvious in some of the coastal Nicaragua adms. But you can see it in Nigeria too.

Edit: first photo is Nigeria and second is Nicaragua. Sorry for the misleading naming!
Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions