From af0c6e8ae3dd66b1c95b51d8403c474ec21f9f50 Mon Sep 17 00:00:00 2001 From: Tracy Esman <21086818+t-esman@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:08:28 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Jeff Klenzing <19592220+jklenzing@users.noreply.github.com> --- pysatNASA/instruments/maven_insitu.py | 45 ++++++--------------------- pysatNASA/instruments/maven_sep.py | 39 ++++------------------- 2 files changed, 16 insertions(+), 68 deletions(-) diff --git a/pysatNASA/instruments/maven_insitu.py b/pysatNASA/instruments/maven_insitu.py index f5642baf..67caed7f 100644 --- a/pysatNASA/instruments/maven_insitu.py +++ b/pysatNASA/instruments/maven_insitu.py @@ -1,13 +1,11 @@ # -*- coding: utf-8 -*- """Module for the MAVEN insitu instrument. -Created by: Teresa Esman, NPP at GSFC - -Supports the Key parameter (kp) data from multiple instruments +Supports the in situ Key Parameter (kp) data from multiple instruments onboard the Mars Atmosphere and Volatile Evolution (MAVEN) satellite. Accesses local data in CDF format. -Downlaods from CDAWeb. +Downloads from CDAWeb. Properties ---------- @@ -17,23 +15,25 @@ 'insitu' tag None supported +inst_id + None supported Examples -------- :: import pysat - from pysat.utils import registry - registry.register_by_module(pysatNASA.instruments) - insitu = pysat.Instrument(platform='MAVEN', name='insitu') + insitu = pysat.Instrument(platform='maven', name='insitu') insitu.download(dt.datetime(2020, 1, 1), dt.datetime(2020, 1, 31)) - insitu.load(2020, 1, use_header = True) + insitu.load(2020, 1, use_header=True) + """ import datetime as dt import functools + import pysat from pysat.instruments.methods import general as mm_gen from pysatNASA.instruments.methods import cdaweb as cdw @@ -62,15 +62,8 @@ init = functools.partial(mm_nasa.init, module=mm_mvn, name=name) -def clean(self): - """Clean MAVEN insitu kp data to the specified level. - - Note - ---- - Supports 'none'. Method is - not called by pysat if clean_level is None or 'none'. - """ - return +# Use default clean +clean = mm_nasa.clean # ---------------------------------------------------------------------------- @@ -96,24 +89,6 @@ def clean(self): supported_tags=download_tags) -def init(self): - """Initialize the Instrument object with instrument specific values. - - Runs once upon instantiation. - - Parameters - ----------- - self : pysat.Instrument - Instrument class object - """ - - pysat.logger.info(mm_mvn.ackn_str) - self.acknowledgements = mm_mvn.ackn_str - self.references = mm_mvn.references - - return - - # Set the load routine load = functools.partial(cdw.load, epoch_name='epoch', pandas_format=pandas_format, use_cdflib=True) diff --git a/pysatNASA/instruments/maven_sep.py b/pysatNASA/instruments/maven_sep.py index 88d78529..49b45f40 100644 --- a/pysatNASA/instruments/maven_sep.py +++ b/pysatNASA/instruments/maven_sep.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """Module for the MAVEN insitu instrument. -Created by: Teresa Esman, NPP at GSFC - Supports the Solar Energetic Particle (SEP) data from onboard the Mars Atmosphere and Volatile Evolution (MAVEN) satellite. @@ -17,14 +15,14 @@ 'sep' tag 's1','s2' - +inst_id + None supported + Examples -------- :: import pysat - from pysat.utils import registry - registry.register_by_module(pysatNASA.instruments) insitu = pysat.Instrument(platform='MAVEN', name='insitu') @@ -34,6 +32,7 @@ import datetime as dt import functools + import pysat from pysat.instruments.methods import general as mm_gen from pysatNASA.instruments.methods import cdaweb as cdw @@ -62,18 +61,8 @@ init = functools.partial(mm_nasa.init, module=mm_mvn, name=name) -def clean(self): - """Clean MAVEN mag data to the specified level. - - Note - ---- - Supports 'clean', 'dusty', 'dirty', 'none'. Method is - not called by pysat if clean_level is None or 'none'. - - - """ - - return +# Use default clean +clean = mm_nasa.clean # ---------------------------------------------------------------------------- @@ -116,22 +105,6 @@ def clean(self): supported_tags=download_tags) -def init(self): - """Initialize the Instrument object with instrument specific values. - - Runs once upon instantiation. - - Parameters - ----------- - self : pysat.Instrument - Instrument class object - """ - - pysat.logger.info(mm_mvn.ackn_str) - self.acknowledgements = mm_mvn.ackn_str - self.references = mm_mvn.references - - return # Set the load routine