From d9f69e5bd68ae7e880bd5132d5c7d248c07bd118 Mon Sep 17 00:00:00 2001 From: jklenzing Date: Thu, 7 Sep 2023 10:30:27 -0400 Subject: [PATCH 1/4] STY: use standard init --- pysatNASA/instruments/formosat1_ivm.py | 28 ++------------------ pysatNASA/instruments/iss_fpmu.py | 31 ++--------------------- pysatNASA/instruments/methods/__init__.py | 2 ++ pysatNASA/instruments/methods/formosat.py | 14 ++++++++++ pysatNASA/instruments/methods/iss.py | 29 +++++++++++++++++++++ pysatNASA/instruments/methods/omni.py | 11 ++++++++ pysatNASA/instruments/omni_hro.py | 21 ++------------- 7 files changed, 62 insertions(+), 74 deletions(-) create mode 100644 pysatNASA/instruments/methods/formosat.py create mode 100644 pysatNASA/instruments/methods/iss.py diff --git a/pysatNASA/instruments/formosat1_ivm.py b/pysatNASA/instruments/formosat1_ivm.py index 3ac177d9..ceccc95c 100644 --- a/pysatNASA/instruments/formosat1_ivm.py +++ b/pysatNASA/instruments/formosat1_ivm.py @@ -26,9 +26,9 @@ import functools from pysat.instruments.methods import general as mm_gen -from pysat import logger from pysatNASA.instruments.methods import cdaweb as cdw +from pysatNASA.instruments.methods import formosat as mm_formosat from pysatNASA.instruments.methods import general as mm_nasa # ---------------------------------------------------------------------------- @@ -47,31 +47,7 @@ # ---------------------------------------------------------------------------- # Instrument methods - -def init(self): - """Initialize the Instrument object with instrument specific values. - - Runs once upon instantiation. - - """ - self.acknowledgements = ' '.join(('Data provided through NASA CDAWeb', - 'Key Parameters - Shin-Yi Su', - '(Institute of Space Science,', - 'National Central University,', - 'Taiwan, R.O.C.)')) - self.references = ' '.join(('Yeh, H.C., S.‐Y. Su, Y.C. Yeh, J.M. Wu,', - 'R. A. Heelis, and B. J. Holt, Scientific', - 'mission of the IPEI payload on board', - 'ROCSAT‐1, Terr. Atmos. Ocean. Sci., 9,', - 'suppl., 1999a.\n', - 'Yeh, H.C., S.‐Y. Su, R.A. Heelis, and', - 'J.M. Wu, The ROCSAT‐1 IPEI preliminary', - 'results, Vertical ion drift statistics,', - 'Terr. Atmos. Ocean. Sci., 10, 805,', - '1999b.')) - logger.info(self.acknowledgements) - - return +init = functools.partial(mm_nasa.init, module=mm_formosat, name=name) # Use default clean diff --git a/pysatNASA/instruments/iss_fpmu.py b/pysatNASA/instruments/iss_fpmu.py index c98f907c..d65272e3 100644 --- a/pysatNASA/instruments/iss_fpmu.py +++ b/pysatNASA/instruments/iss_fpmu.py @@ -28,10 +28,10 @@ import functools from pysat.instruments.methods import general as mm_gen -from pysat import logger from pysatNASA.instruments.methods import cdaweb as cdw from pysatNASA.instruments.methods import general as mm_nasa +from pysatNASA.instruments.methods import iss as mm_iss # ---------------------------------------------------------------------------- # Instrument attributes @@ -49,34 +49,7 @@ # ---------------------------------------------------------------------------- # Instrument methods - -def init(self): - """Initialize the Instrument object with instrument specific values. - - Runs once upon instantiation. - - """ - - ackn_str = ' '.join(('Data provided through NASA CDAWeb. Contact', - 'Rob.Suggs@nasa.gov for support and use.')) - logger.info(ackn_str) - self.acknowledgements = ackn_str - self.references = ' '.join(('V. N. Coffey et al., "Validation of the', - 'Plasma Densities and Temperatures From', - 'the ISS Floating Potential Measurement', - 'Unit," in IEEE Transactions on Plasma', - 'Science, vol. 36, no. 5, pp. 2301-2308,', - 'Oct. 2008,', - 'doi: 10.1109/TPS.2008.2004271.\n', - 'A. Barjatya, C.M. Swenson, D.C.', - 'Thompson, and K.H. Wright Jr., Data', - 'analysis of the Floating Potential', - 'Measurement Unit aboard the', - 'International Space Station, Rev. Sci.', - 'Instrum. 80, 041301 (2009),', - 'https://doi.org/10.1063/1.3116085')) - - return +init = functools.partial(mm_nasa.init, module=mm_iss, name=name) # Use default clean diff --git a/pysatNASA/instruments/methods/__init__.py b/pysatNASA/instruments/methods/__init__.py index 8542fcbc..4459d353 100644 --- a/pysatNASA/instruments/methods/__init__.py +++ b/pysatNASA/instruments/methods/__init__.py @@ -5,9 +5,11 @@ from pysatNASA.instruments.methods import cnofs # noqa F401 from pysatNASA.instruments.methods import de2 # noqa F401 from pysatNASA.instruments.methods import dmsp # noqa F401 +from pysatNASA.instruments.methods import formosat # noqa F401 from pysatNASA.instruments.methods import general # noqa F401 from pysatNASA.instruments.methods import gps # noqa F401 from pysatNASA.instruments.methods import icon # noqa F401 +from pysatNASA.instruments.methods import iss # noqa F401 from pysatNASA.instruments.methods import jhuapl # noqa F401 from pysatNASA.instruments.methods import omni # noqa F401 from pysatNASA.instruments.methods import ses14 # noqa F401 diff --git a/pysatNASA/instruments/methods/formosat.py b/pysatNASA/instruments/methods/formosat.py new file mode 100644 index 00000000..41ee0f22 --- /dev/null +++ b/pysatNASA/instruments/methods/formosat.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +"""Provides non-instrument specific routines for C/NOFS data.""" + +ackn_str = ' '.join(('Data provided through NASA CDAWeb Key Parameters -', + 'Shin-Yi Su (Institute of Space Science, National Central', + 'University, Taiwan, R.O.C.)')) +refs = {'ivm': ' '.join(('Yeh, H.C., S.‐Y. Su, Y.C. Yeh, J.M. Wu, R. A.', + 'Heelis, and B. J. Holt, Scientific mission of the', + 'IPEI payload on board ROCSAT‐1, Terr. Atmos. Ocean.', + 'Sci., 9, suppl., 1999a.\n', + 'Yeh, H.C., S.‐Y. Su, R.A. Heelis, and J.M. Wu, The', + 'ROCSAT‐1 IPEI preliminary results, Vertical ion', + 'drift statistics, Terr. Atmos. Ocean. Sci., 10, 805,', + '1999b.'))} diff --git a/pysatNASA/instruments/methods/iss.py b/pysatNASA/instruments/methods/iss.py new file mode 100644 index 00000000..24ed41ce --- /dev/null +++ b/pysatNASA/instruments/methods/iss.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +"""Provides non-instrument specific routines for C/NOFS data.""" + +ackn_str = ' '.join(("R.M. Suggs, S.L. Koontz, NASA Johnson Space Center", + "Contact Rob Suggs for support and use.", + "Rob.Suggs@nasa.gov. Please acknowledge the data", + "providers and CDAWeb when using these data.")) + +refs = {'fpmu': ' '.join(('V. N. Coffey et al., "Validation of the Plasma', + 'Densities and Temperatures From the ISS Floating', + 'Potential Measurement Unit," in IEEE Transactions', + 'on Plasma Science, vol. 36, no. 5, pp. 2301-2308,', + 'Oct. 2008, doi: 10.1109/TPS.2008.2004271.', + '\n', + 'A. Barjatya, C.M. Swenson, D.C. Thompson, and K.H.', + 'Wright Jr., Data analysis of the Floating Potential', + 'Measurement Unit aboard the International Space', + 'Station, Rev. Sci. Instrum. 80, 041301 (2009),', + 'https://doi.org/10.1063/1.3116085', + '\n', + 'Debchoudhury, S., Barjatya, A., Minow, J. I.,', + 'Coffey, V. N., & Chandler, M. O. (2021).', + 'Observations and validation of plasma density,', + 'temperature, and O+ abundance from a Langmuir', + 'probe onboard the International Space Station.', + 'Journal of Geophysical Research: Space', + 'Physics, 126, e2021JA029393.', + 'https://doi.org/10.1029/2021JA029393')) + } diff --git a/pysatNASA/instruments/methods/omni.py b/pysatNASA/instruments/methods/omni.py index 2844b0cb..4d96c9fb 100644 --- a/pysatNASA/instruments/methods/omni.py +++ b/pysatNASA/instruments/methods/omni.py @@ -9,6 +9,17 @@ import pysat +ackn_str = ' '.join(('For full acknowledgement info, please see:', + 'https://omniweb.gsfc.nasa.gov/html/citing.html')) + +refs = {'hro': ' '.join(('J.H. King and N.E. Papitashvili, Solar', + 'wind spatial scales in and comparisons', + 'of hourly Wind and ACE plasma and', + 'magnetic field data, J. Geophys. Res.,', + 'Vol. 110, No. A2, A02209,', + '10.1029/2004JA010649.'))} + + def time_shift_to_magnetic_poles(inst): """Shift OMNI times to intersection with the magnetic pole. diff --git a/pysatNASA/instruments/omni_hro.py b/pysatNASA/instruments/omni_hro.py index d7a205cf..6b97ce82 100644 --- a/pysatNASA/instruments/omni_hro.py +++ b/pysatNASA/instruments/omni_hro.py @@ -48,6 +48,7 @@ from pysat.instruments.methods import general as mm_gen from pysatNASA.instruments.methods import cdaweb as cdw +from pysatNASA.instruments.methods import general as mm_nasa from pysatNASA.instruments.methods import omni as mm_omni # ---------------------------------------------------------------------------- @@ -68,25 +69,7 @@ # ---------------------------------------------------------------------------- # Instrument methods - -def init(self): - """Initialize the Instrument object with instrument specific values. - - Runs once upon instantiation. - - """ - - ackn_str = ''.join(('For full acknowledgement info, please see: ', - 'https://omniweb.gsfc.nasa.gov/html/citing.html')) - self.acknowledgements = ackn_str - self.references = ' '.join(('J.H. King and N.E. Papitashvili, Solar', - 'wind spatial scales in and comparisons', - 'of hourly Wind and ACE plasma and', - 'magnetic field data, J. Geophys. Res.,', - 'Vol. 110, No. A2, A02209,', - '10.1029/2004JA010649.')) - pysat.logger.info(ackn_str) - return +init = functools.partial(mm_nasa.init, module=mm_omni, name=name) def clean(self): From 9caf8b9c565ffcd2fd003d75f5f882965dc406e1 Mon Sep 17 00:00:00 2001 From: jklenzing Date: Thu, 7 Sep 2023 10:30:35 -0400 Subject: [PATCH 2/4] DOC: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2091a7c1..958afcd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). * Maintenance * Implemented unit tests for cleaning warnings * Use pip install for readthedocs + * Move references and acknowledgements to methods files ## [0.0.5] - 2023-06-27 * New Instruments From 8446dea99cd5d512119eb77d78795f251c22f82c Mon Sep 17 00:00:00 2001 From: jklenzing Date: Thu, 7 Sep 2023 10:48:00 -0400 Subject: [PATCH 3/4] STY: pep8 --- pysatNASA/instruments/omni_hro.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pysatNASA/instruments/omni_hro.py b/pysatNASA/instruments/omni_hro.py index 6b97ce82..b37f2954 100644 --- a/pysatNASA/instruments/omni_hro.py +++ b/pysatNASA/instruments/omni_hro.py @@ -44,7 +44,6 @@ import pandas as pds import warnings -import pysat from pysat.instruments.methods import general as mm_gen from pysatNASA.instruments.methods import cdaweb as cdw From a45328a77c35961c057eeb38a4ff02cb56a8c62d Mon Sep 17 00:00:00 2001 From: Jeff Klenzing <19592220+jklenzing@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:51:22 -0400 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Angeline Burrell --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 958afcd7..3f24602a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). * Maintenance * Implemented unit tests for cleaning warnings * Use pip install for readthedocs - * Move references and acknowledgements to methods files + * Moved references and acknowledgements to methods files ## [0.0.5] - 2023-06-27 * New Instruments