pysat / pysatNASA

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

STY: reduce duplication for init and clean #119

Closed jklenzing closed 2 years ago

jklenzing commented 2 years ago

Description

Addresses #89, #118

Adds two general instrument methods which are frequently repeated:

Additionally, suppresses logger messages during package-level imports of constellation objects. This is required to keep the logger from being saturated until this issue is fixed at the pysat-level. Otherwise verifying the logger here is near-impossible.

Type of change

How Has This Been Tested?

import pysat
import logging
pysat.logger.setLevel(logging.INFO)
ivm = pysat.Instrument('cnofs', 'ivm')

acknowledgement string should go to the logger, and ivm.acknowledgements and ivm.references updated accordingly.

Can be repeated for the cnofs, de2, and icon instruments

For cleaning, attempt to load de2 data, look for the warning.

Test Configuration

Checklist:

jklenzing commented 2 years ago

Topics to discuss:

jklenzing commented 2 years ago

I've decided this pull is large enough for review. Follow-on work to update other instruments documented in #119, including consistency issues that are out of scope here.