Update data folders#68
Merged
Merged
Conversation
…lompe into update-data-folders
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates SuperMAG data downloading and station metadata handling, and adjusts Lompe’s data retrieval for Swarm.
Changes:
- Switch SuperMAG “start” handling to pass the
eventvalue through downloader calls and add extra exception logging. - Make station CSV loading more tolerant of malformed rows and update
supermag_stations.csventries. - Update Swarm download function usage in
get_lompe_data.py.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lompe/data_tools/supermag.py | Changes how start is passed to SuperMAG APIs; adds error logging; makes station CSV parsing more permissive. |
| lompe/data_tools/get_lompe_data.py | Removes datadownloader import and switches Swarm download call to download_swarm_mag. |
| lompe/data/supermag_stations.csv | Updates station rows and adds new stations; introduces rows with embedded comma-separated values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+72
to
76
| try: | ||
| all_data, failed = _get_supermag_all_stations( | ||
| userid=userid, | ||
| start=start, | ||
| start=event, | ||
| inventory_extent=inventory_extent, |
| return savefile | ||
|
|
||
| start = [int(x) for x in event.split("-")] + [0, 0] | ||
| # start = [int(x) for x in event.split("-")] + [0, 0] |
| filepath = os.path.dirname(__file__) | ||
| smag_stations = pd.read_csv(filepath + '/../data/supermag_stations.csv') | ||
| smag_stations = pd.read_csv( | ||
| filepath + '/../data/supermag_stations.csv', engine="python", on_bad_lines=lambda row: row[:7] + [",".join(row[7:])]) |
| TWN,146.82,-19.27,-138.28,-27.99,Townsville,2,AUS,MAGDAS | ||
| AMA,129.33,28.17,-157.69,21.14,Amami-Oshima,1,MAGDAS | ||
| ANC,282.85,-11.77,-4.48,1.44,Ancon,1,MAGDAS | ||
| ANC,282.85,-11.77,-4.48,1.44,Ancon,2,MAGDAS,LISN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
supermag download problem fixed: reading the supermag_stations.csv was the problem. supermag_stations.csv is also updated.