Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Angeline Burrell <[email protected]>
Co-authored-by: Russell Stoneback <[email protected]>
  • Loading branch information
3 people authored Aug 1, 2024
1 parent 2f29a88 commit 93924dd
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
## [0.0.6] - 2024-07-31
* New Instruments
* DE2 VEFIMAGB - electric and magnetic field on the same cadence
* MAVEN mag
* MAVEN MAG
* MAVEN SEP
* MAVEN in situ key parameters
* REACH Dosimeter
Expand Down
4 changes: 2 additions & 2 deletions docs/supported_instruments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ JPL GPS

.. _maven_insitu_kp:

MAVEN INSITU KP
---------------
MAVEN IN SITU KP
----------------

.. automodule:: pysatNASA.instruments.maven_insitu_kp
:members:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies = [
"netCDF4",
"numpy",
"pandas",
"pysat >= 3.1",
"pysat >= 3.2",
"requests",
"scipy >= 1.4",
"xarray"
Expand Down
10 changes: 8 additions & 2 deletions pysatNASA/instruments/de2_vefi.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
tag
'', 'dca', 'ac'
inst_id
none supported
None supported
Warnings
Expand Down Expand Up @@ -133,7 +133,9 @@ def load(fnames, tag='', inst_id='', **kwargs):
inst_id : str
Instrument ID used to identify particular data set to be loaded.
This input is nominally provided by pysat itself. (default='')
**kwargs : unpacked dict
Optional kwargs that will be passed to the
`pysatNASA.instruments.methods.cdaweb.load_xarray` function
Returns
-------
data : pds.DataFrame
Expand All @@ -146,6 +148,10 @@ def load(fnames, tag='', inst_id='', **kwargs):
Several variables relating to time stored in different formats are dropped.
These are redundant and complicate the load procedure.
See Also
--------
pysatNASA.instruments.methods.cdaweb.load_xarray
"""

if tag == '':
Expand Down
2 changes: 1 addition & 1 deletion pysatNASA/instruments/de2_vefimagb.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@

# Set the load routine
def load(fnames, tag='', inst_id='', **kwargs):
"""Load DE2 VEFI data.
"""Load DE2 VEFI MAG B-field data.
This routine is called as needed by pysat. It is not intended
for direct user interaction.
Expand Down
6 changes: 3 additions & 3 deletions pysatNASA/instruments/dmsp_ssusi.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ def clean(self):


def concat_data(self, new_data, combine_times=False, **kwargs):
"""Concatonate data to self.data for DMSP SSUSI data.
"""Concatenate data to self.data for DMSP SSUSI data.
Parameters
----------
new_data : xarray.Dataset or list of such objects
New data objects to be concatonated
New data objects to be concatenated
combine_times : bool
For SDR data, optionally combine the different datetime coordinates
into a single time coordinate (default=False)
Expand All @@ -154,7 +154,7 @@ def concat_data(self, new_data, combine_times=False, **kwargs):
if self.tag in ['sdr-disk', 'sdr2-dist']:
time_dims.append('time_auroral')

# Concatonate using the appropriate method for the number of time
# Concatenate using the appropriate method for the number of time
# dimensions
jhuapl.concat_data(self, time_dims, new_data, combine_times=combine_times,
**kwargs)
Expand Down
10 changes: 5 additions & 5 deletions pysatNASA/instruments/maven_insitu_kp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# DISTRIBUTION STATEMENT A: Approved for public release. Distribution is
# unlimited.
# ----------------------------------------------------------------------------
"""Module for the MAVEN insitu instruments.
"""Module for the MAVEN in situ instruments.
Supports the in situ 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.
Expand All @@ -32,9 +32,9 @@
::
import pysat
insitu = pysat.Instrument(platform='maven', name='insitu_kp')
insitu.download(dt.datetime(2020, 1, 1), dt.datetime(2020, 1, 31))
insitu.load(2020, 1, use_header=True)
insitukp = pysat.Instrument(platform='maven', name='insitu_kp')
insitukp.download(dt.datetime(2020, 1, 1), dt.datetime(2020, 1, 31))
insitukp.load(2020, 1, use_header=True)
"""

Expand Down
2 changes: 1 addition & 1 deletion pysatNASA/instruments/maven_mag.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# DISTRIBUTION STATEMENT A: Approved for public release. Distribution is
# unlimited.
# ----------------------------------------------------------------------------
"""Module for the MAVEN mag instrument.
"""Module for the MAVEN magnetometer.
Supports the Magnetometer (MAG) onboard the Mars Atmosphere
and Volatile Evolution (MAVEN) satellite.
Expand Down
8 changes: 4 additions & 4 deletions pysatNASA/instruments/maven_sep.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# DISTRIBUTION STATEMENT A: Approved for public release. Distribution is
# unlimited.
# ----------------------------------------------------------------------------
"""Module for the MAVEN sep instrument.
"""Module for the MAVEN Solar Energetic Particle instrument.
Supports the Solar Energetic Particle (SEP) data from
onboard the Mars Atmosphere and Volatile Evolution (MAVEN) satellite.
Expand All @@ -31,9 +31,9 @@
::
import pysat
insitu = pysat.Instrument(platform='maven', name='sep', inst_id='s1')
insitu.download(dt.datetime(2020, 1, 1), dt.datetime(2020, 1, 31))
insitu.load(2020, 1, use_header=True)
sep = pysat.Instrument(platform='maven', name='sep', inst_id='s1')
sep.download(dt.datetime(2020, 1, 1), dt.datetime(2020, 1, 31))
sep.load(2020, 1, use_header=True)
"""

Expand Down
7 changes: 1 addition & 6 deletions pysatNASA/instruments/methods/maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
# DISTRIBUTION STATEMENT A: Approved for public release. Distribution is
# unlimited.
# ----------------------------------------------------------------------------
"""Provides non-instrument specific routines for MAVEN data.
Created on Thu Jul 13 11:21:01 2023
@author: tesman
"""
"""Provides non-instrument specific routines for MAVEN data."""

ackn_str = ''.join(('Jakosky, B.M., Lin, R.P., Grebowsky, J.M. et al.',
' The Mars Atmosphere and Volatile Evolution',
Expand Down
10 changes: 1 addition & 9 deletions pysatNASA/instruments/reach_dosimeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
The Responsive Environmental Assessment Commercially Hosted (REACH)
constellation is collection of 32 small sensors hosted on six orbital planes of
the Iridium-Next space vehicles in low earth orbit. Each sensor contains two
the Iridium-Next space vehicles in Low Earth Orbit. Each sensor contains two
micro-dosimeters sensitive to the passage of charged particles from the Earth's
radiation belts. There are six distinct dosimeter types spread among the 64
individual sensors, which are unique in shielding and electronic threshold.
Expand All @@ -33,8 +33,6 @@
'101', '102', '105', '108', '113', '114', '115', '116', '133', '134', '135',
'136', '137', '138', '139', '140', '148', '149', '162', '163', '164', '165',
'166', '169', '170', '171', '172', '173', '175', '176', '180', '181'
"""

import datetime as dt
Expand Down Expand Up @@ -69,8 +67,6 @@

# ----------------------------------------------------------------------------
# Instrument methods


# Use standard init routine
init = functools.partial(mm_nasa.init, module=mm_reach, name=name)

Expand All @@ -84,8 +80,6 @@ def preprocess(self):
self.acknowledgements = self.meta.header.Acknowledgement

return


# ----------------------------------------------------------------------------
# Instrument functions
#
Expand Down Expand Up @@ -160,8 +154,6 @@ def load(fnames, tag=None, inst_id=None):
meta.header = MetaHeader(new_header)

return data, meta


# Support download routine
download_tags = {iid: {'': 'REACH-VID-{iid}_DOSIMETER-L1C'.format(iid=iid)}
for iid in inst_ids.keys()}
Expand Down
6 changes: 3 additions & 3 deletions pysatNASA/instruments/timed_guvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ def clean(self):


def concat_data(self, new_data, combine_times=False, **kwargs):
"""Concatonate data to self.data for TIMED GUVI data.
"""Concatenate data to self.data for TIMED GUVI data.
Parameters
----------
new_data : xarray.Dataset or list of such objects
New data objects to be concatonated
New data objects to be concatenated
combine_times : bool
For SDR data, optionally combine the different datetime coordinates
into a single time coordinate (default=False)
Expand All @@ -164,7 +164,7 @@ def concat_data(self, new_data, combine_times=False, **kwargs):
elif self.tag == 'sdr-spectrograph':
time_dims.extend(['time_gaim_day', 'time_gaim_night'])

# Concatonate using the appropriate method for the number of time
# Concatenate using the appropriate method for the number of time
# dimensions
jhuapl.concat_data(self, time_dims, new_data, combine_times=combine_times,
**kwargs)
Expand Down

0 comments on commit 93924dd

Please sign in to comment.