pysat / pysatNASA

pysat support for NASA Instruments
BSD 3-Clause "New" or "Revised" License
21 stars 6 forks source link

MAINT: cnofs vefi magnetometer data #214

Closed jklenzing closed 12 months ago

jklenzing commented 12 months ago

Description

C/NOFS VEFI dc_b data has an updated dataset (v6) uploaded to SPDF as of 7 Nov 2023. This does not use the old error flag, but uses the standard fill value demarked in metadata. Since 'B_flag' is no longer present, unit tests will fail unless this is fixed.

Updates to use the standard cleaning routine

Type of change

How Has This Been Tested?

import datetime as dt
import pysat

# Get latest data
vefi = pysat.Instrument('cnofs', 'vefi', tag='dc_b')
vefi.download(dt.datetime(2009, 1, 1))

# Load with clean routine
vefi.load(2009, 1)
print(vefi.meta['B_north'].fill)

# Load without cleaning
vefi = pysat.Instrument('cnofs', 'vefi', tag='dc_b', clean_level='none')
vefi.load(2009, 1)
print(vefi.meta['B_north'].fill)

Verify that for the clean routine the fill value is NaN, and for the non-clean load the fill value is -1e+31

Test Configuration:

Checklist:

If this is a release PR, replace the first item of the above checklist with the release checklist on the wiki: https://github.com/pysat/pysat/wiki/Checklist-for-Release

jklenzing commented 12 months ago

What happens if people have local data that is older than v6?

It still loads, and is cleaned for fill values. The flag indicates where data is interpolated in the previous solution.

So for version 5, it will load but not remove these points.

aburrell commented 12 months ago

Could you have the local clean method wrap the standard clean and apply the old code if 'B_flag' is present? That way it'd work for any version.

jklenzing commented 12 months ago

Could you have the local clean method wrap the standard clean and apply the old code if 'B_flag' is present? That way it'd work for any version.

Yes, but it would be untested (other than locally)