Skip to content

Commit

Permalink
Merge pull request #12 from pysat/meta_bugfixes
Browse files Browse the repository at this point in the history
BUG: Fixed errant sat_id->inst_id. Altered COSMIC file times.
  • Loading branch information
rstoneback committed Dec 18, 2020
2 parents cc10cf1 + 447137e commit bf927ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install:
# Useful for debugging any issues with conda
- conda info -a
# Create conda test environment
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy pandas xarray requests beautifulsoup4 lxml netCDF4 pytest-cov pytest-ordering future
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy pandas portalocker xarray requests beautifulsoup4 lxml netCDF4 pytest-cov pytest-ordering future
- conda activate test-environment
# Get latest coveralls from pip, not conda
- pip install coveralls
Expand Down
6 changes: 3 additions & 3 deletions pysatCDAAC/instruments/cosmic_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ def list_files(tag=None, inst_id=None, data_path=None, format_str=None):
# due to multiple spacecraft and antennas
# this ensures that we can make the times all unique for the file list
idx = np.argsort(uts)
# adding linearly increasing offsets less than 0.01 s
shift_uts = np.mod(np.arange(len(year)), 1E4) * 1.E-6 + 1.E-6
# adding linearly increasing offsets less than 0.1 s
shift_uts = np.mod(np.arange(len(year)), 9E4) * 1.E-5 + 1.E-5
uts[idx] += shift_uts

index = pysat.utils.time.create_datetime_index(year=year,
Expand Down Expand Up @@ -311,7 +311,7 @@ def load(fnames, tag=None, inst_id=None, altitude_bin=None):
# get cosmic satellite ID
c_id = np.array([snip[3] for snip in output.fileStamp]).astype(int)
# time offset
utsec += output.occulting_inst_id*1.e-5 + c_id*1.e-6
utsec += output.occulting_sat_id*1.e-5 + c_id*1.e-6
else:
# construct time out of three different parameters
# duration must be less than 10,000
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ long_description_content_type = text/markdown
numpy
pandas
xarray
portalocker
pysat

[coverage:report]
Expand Down

0 comments on commit bf927ac

Please sign in to comment.