SuperDARN / pyDARNio

Python Library for read in SuperDARN data
GNU Lesser General Public License v3.0
8 stars 2 forks source link

BUG: read_map giving field missing error #30

Closed carleyjmartin closed 2 years ago

carleyjmartin commented 2 years ago

BUG

Copied from jpriestad's issue on pydarn repo https://github.com/SuperDARN/pydarn/issues/209

When opening the map_2.5 file '20010817.n.map' downloaded using globus (November 12, 2021), I get the following error when opening:

SDarn_read = pydarn.SuperDARNRead(file) data = SDarn_read.read_map()

SuperDARNFieldMissingError: Error: The following fields in record 653 are missing: {'vector.index', 'vector.mlat', 'vector.mlon', 'vector.kvect', 'vector.vel.sd', 'vector.stid', 'vector.vel.median', 'vector.channel'}

I am on main branch, installed with pip install pydarn on May 11, 2021.

To me this seems like a bug. I would have expected pydarn to just thrash the record at that particular time if the above fields are missing, and proceed to the next record. Instead, reading is interrupted. I suppose this does not mean that the rest of the datafile I have is corrupted? When commenting out lines 177-178 in '/dmap/superdarn.py' , I can see that this situation occur 4 times in my file.

In the meantime I will keep these lines commented, and assume that the rest of the file is ok to use. How to properly handle this situation, I am not sure of.

Priority

Attempts

read_dmap works to read in the file, so assuming it's the read_map method and not the file

carleyjmartin commented 2 years ago

In pydarnio equivalent:

data = pydarnio.SDarnRead(map_file).read_map()

also fails with the same error.

Linked to #17 and #18 ? Appears to be fixed here, but now not?

EDIT: AHA, when I'm reinstalling pydarn it's only installing pydarnio 1.0.0.

So actually this is likely a pydarn issue...

carleyjmartin commented 2 years ago

Okay, closing this as I believe it's already fixed in pydarnio, but pydarn just doesn't install the newest version of pydarnio that has the fix in it.