Skip to content

Commit

Permalink
MAINT/STY: Update for latest compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
jklenzing committed Nov 25, 2024
1 parent 0a9c090 commit 18ad3d0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [0.1.0] - 2025-XX-XX
* New Instruments
* Mars Global Surveyor Magnetometer (MGS Mag)

## [0.0.6] - 2024-XX-XX
* New Instruments
* DE2 VEFIMAGB - electric and magnetic field on the same cadence
Expand Down
11 changes: 5 additions & 6 deletions pysatNASA/instruments/methods/mgs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provides non-instrument specific routines for MGS data.
Created on Wed Feb 7 11:42:10 2024
@author: tesman
"""
#
# TODO(#XXX): Update NRL review before next version release
# ---------------------------------------------------------
"""Provides non-instrument specific routines for MGS data."""

ackn_str = ' '.join(('Much of the information provided in this meta data ',
'originates from text files provided at: ',
Expand Down
33 changes: 15 additions & 18 deletions pysatNASA/instruments/mgs_mag.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# TODO(#XXX): Update NRL review before next version release
# ---------------------------------------------------------
"""Module for the MGS mag instrument.
Supports the Magnetometer (MAG) onboard the Mars Global
Expand All @@ -13,9 +17,9 @@
name
'mag'
tag
'low','high'
inst_id
None supported
inst_id
['low', 'high']
Warnings
--------
Expand All @@ -29,9 +33,9 @@
import pysat
mag = pysat.Instrument('mgs', 'mag')
mag = pysat.Instrument('mgs', 'mag', inst_id='low')
mag.download(dt.datetime(1998, 1, 1), dt.datetime(1998, 1, 31))
mag.load(1998, 1, use_header = True)
mag.load(1998, 9)
"""

Expand All @@ -42,7 +46,7 @@
from pysat.utils.io import load_netcdf
from pysatNASA.instruments.methods import cdaweb as cdw
from pysatNASA.instruments.methods import general as mm_nasa
from ops_mgs.instruments.methods import mgs as mm_mgs
from pysatNASA.instruments.methods import mgs as mm_mgs

# ----------------------------------------------------------------------------
# Instrument attributes
Expand All @@ -57,7 +61,7 @@
# ----------------------------------------------------------------------------
# Instrument test attributes

_test_dates = {'': {'': dt.datetime(1998, 1, 1)}}
_test_dates = {iid: {'': dt.datetime(1998, 1, 9)} for iid in inst_ids.keys()}

# ----------------------------------------------------------------------------
# Instrument methods
Expand All @@ -84,20 +88,12 @@
list_files = functools.partial(mm_gen.list_files,
supported_tags=supported_tags)
# Set the download routine
basic_tag_high = {'remote_dir': ''.join(('/pub/data/aaa_planetary/',
'mgs_mars_global_survey/mag',
'/high/{year:04d}')),
'fname': fname1}
basic_tag_low = {'remote_dir': ''.join(('/pub/data/aaa_planetary/',
'mgs_mars_global_survey/mag',
'/low/{year:04d}')),
'fname': fname2}
download_tags = {'high': {'': basic_tag_high},
'low': {'': basic_tag_low}}
download = functools.partial(cdw.download, supported_tags=download_tags)
download_tags = {'low': {'': 'MGS_MAG_LOW'},
'high': {'': 'MGS_MAG_HIGH'}}
download = functools.partial(cdw.cdas_download, supported_tags=download_tags)

# Set the list_remote_files routine
list_remote_files = functools.partial(cdw.list_remote_files,
list_remote_files = functools.partial(cdw.cdas_list_remote_files,
supported_tags=download_tags)

# Set the load routine
Expand Down Expand Up @@ -150,5 +146,6 @@ def load(fnames, tag=None, inst_id=None):
'max_val': ('VALIDMAX', (int, float)),
'fill_val': ('_FillValue', (int, float))}
data, meta = load_netcdf(fnames, epoch_name='unix_time',
epoch_unit='s',
meta_kwargs={'labels': labels})
return data, meta

0 comments on commit 18ad3d0

Please sign in to comment.