Skip to content

Commit

Permalink
Renamed merged orbit file to avoid getting picked up in input file pa…
Browse files Browse the repository at this point in the history
…ttern matching
  • Loading branch information
jameswilburlewis committed Jan 16, 2025
1 parent f80bffb commit df57dd6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pyspedas/projects/maven/download_files_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def merge_orbit_files():
Merge MAVEN orbit files into a single file.
This function searches for MAVEN orbit files in the 'orbitfiles' directory and merges them into a single file
named 'maven_orb_rec_merged.orb' in the same directory. The files are sorted based on their dates before merging.
named 'merged_maven_orbits.orb' in the same directory. The files are sorted based on their dates before merging.
Returns:
None
Expand All @@ -195,13 +195,13 @@ def merge_orbit_files():
orbit_files_path = "/".join([toolkit_path, "orbitfiles"])
fl = fs.listdir(orbit_files_path, detail=False)
fl = [f.rstrip("/").split("/")[-1] for f in fl]
output_filename = "/".join([orbit_files_path, "maven_orb_rec_merged.orb"])
output_filename = "/".join([orbit_files_path, "merged_maven_orbits.orb"])
fo = fs.open(output_filename, "w")
else:
orbit_files_path = os.path.join(toolkit_path, "orbitfiles")

fl = os.listdir(orbit_files_path)
output_filename = os.path.join(orbit_files_path,"maven_orb_rec_merged.org")
output_filename = os.path.join(orbit_files_path,"merged_maven_orbits.orb")
fo = open(output_filename, "w")

pattern = "maven_orb_rec(_|)(|.{6})(|_.{9}).orb"
Expand Down
2 changes: 1 addition & 1 deletion pyspedas/projects/maven/orbit_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def orbit_time(begin_orbit, end_orbit=None):
toolkit_path = CONFIG["local_data_dir"]
sep = "/" if is_fsspec_uri(toolkit_path) else os.path.sep
orbit_files_path = sep.join([toolkit_path, "orbitfiles"])
orb_file = sep.join([orbit_files_path, "maven_orb_rec_merged.orb"])
orb_file = sep.join([orbit_files_path, "merged_maven_orbits.orb"])
logging.info("Getting orbit info from file %s", orb_file)
if is_fsspec_uri(toolkit_path):
protocol, path = toolkit_path.split("://")
Expand Down
2 changes: 1 addition & 1 deletion pyspedas/projects/maven/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_get_merge_orbit_files(self):
get_orbit_files()
merge_orbit_files()
orbfilepath = os.path.join(
CONFIG["local_data_dir"], "orbitfiles", "maven_orb_rec_merged.orb"
CONFIG["local_data_dir"], "orbitfiles", "merged_maven_orbits.orb"
)
self.assertTrue(os.path.exists(orbfilepath))

Expand Down
5 changes: 3 additions & 2 deletions pyspedas/projects/maven/tests/uri_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_get_merge_orbit_files(self):
download_files_utilities.get_orbit_files()
download_files_utilities.merge_orbit_files()
orbfilepath = "/".join([
config.CONFIG["local_data_dir"], "orbitfiles", "maven_orb_rec_merged.orb"
config.CONFIG["local_data_dir"], "orbitfiles", "merged_maven_orbits.orb"
])

# assert file exists
Expand Down Expand Up @@ -432,8 +432,9 @@ def test_load_mag_data_private(self):
except Exception as e:
pass

@unittest.skip # Still broken, not sure why
def test_load_mag_byorbit_data(self):
#config.CONFIG["local_data_dir"] = f"s3://{bucket_name}"
config.CONFIG["local_data_dir"] = f"s3://{bucket_name}"
#saved_logging_level = pyspedas.logger.getEffectiveLevel()
#pyspedas.logger.setLevel(logging.DEBUG)
data = maven.mag(trange=[500, 501], datatype="ss1s")
Expand Down

0 comments on commit df57dd6

Please sign in to comment.