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

Data type error when building cutout with SARAH v3 #335

Open
PeterKlein11 opened this issue Jan 10, 2024 · 3 comments
Open

Data type error when building cutout with SARAH v3 #335

PeterKlein11 opened this issue Jan 10, 2024 · 3 comments

Comments

@PeterKlein11
Copy link

PeterKlein11 commented Jan 10, 2024

Description

The latest SARAH v3 downloads for SID and SIS include a few extra data variables in the xarray dataset, e.g record_status which is an int, which breaks the interpolation function.

AssertionError: interpolate only supports datasets with homogeneous dtype

Simple fix is to remove from dataset, and then it seems to run fine. Not sure if needed for anything else?

@euronion
Copy link
Collaborator

Thanks for reporting.

Can you share the link from where you downloaded the SARAH v3 data?
Without knowing what record_status details exactly, it would probably be the easiest approach to just drop that variable before interpolation.

One should also check whether there were other changes from SARAHv2 to SARAHv3 in the variables and conventions. If not, then the fix would be as simple as you have described it.

We'd be happy to receive a PR if you feel like it :)

@ladder-upstroke
Copy link

Here are some details on record_status, extracted with xarray from a SARAH-3 netCDF file:

comment :
    Overall status of each record (timestamp) in this file. If a record is flagged as not ok, it is recommended not to use it.
flag_meanings :
    ok void bad_quality
long_name :
    Record Status
flag_values :
    [0 1 2]

@euronion
Copy link
Collaborator

euronion commented Mar 5, 2024

Thanks.

Is the status normally 0 for all records?
Or does a dataset usually have a mix of ok, void and bad_quality entries?

Did something similar exist before and we just ignored it, or is this a new variable that was necessary to be introduced with the changes to SARAHv3?

If the field should usually be 0 , we could check if that's the case for all entries and in that case drop the variable for further processing.

Else: What happens if you convert the record_status to a floating number?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants