pysat / pysatNASA

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

Omni quickfix meta #96

Closed aburrell closed 2 years ago

aburrell commented 2 years ago

Description

Inelegantly addresses #95 by altering the meta data in the load routine.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

import pysat
omni = pysat.Instrument('omni', 'hro', '1min')
omni.load(2020, 102)
omni.meta['SYM_D']

Produces:

FIELDNAM                                              SYM/D index
SCALEMIN                                                    -1000
SCALEMAX                                                     1000
VAR_TYPE                                                     data
FORMAT                                                         I5
DEPEND_0                                                    Epoch
LABLAXIS                                              SYM/D index
DISPLAY_TYPE                                          time_series
units                                                          nT
long_name                                                   SYM_D
notes                                                         NaN
desc            SYM/D - 1-minute SYM/D index,from WDC Kyoto (1...
value_min                                                   -1000
value_max                                                    1000
fill                                                        99999
children                                                     None
Name: SYM_D, dtype: object

Test Configuration

Checklist:

jklenzing commented 2 years ago

This looks reasonable to me, but I am still getting 28 instances of pysat/pysat/_meta.py:404: UserWarning: Array elements are not allowed in meta. Dropping input : Var_Type when running pytest, both in this branch and in develop. I'm not sure if this is a separate issue, or something that is buried deeper in the code. I don't see this when trying to load OMNI data in the terminal.

aburrell commented 2 years ago

This won't remove that warning, because array elements are initially being loaded into meta by the default load routine. To fix that warning someone (not me) needs to go into the load routine and clean it up.

jklenzing commented 2 years ago

Found the source of the warnings, which is from other instruments and now documented at #99 and unrelated to the issues this branch addresses.

I've opened an alternate branch which solves this particular issue in the cdf load routines (affecting all instruments), but that may require deeper testing. Some of the C/NOFS instruments have lists in the var_atts as well. @aburrell, I'm happy merging this in for now once the GA tests finish if you need a working branch ASAP.