-
Notifications
You must be signed in to change notification settings - Fork 297
ionex: update to the IGS long file name convention and migration to EarthData
#1337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's Guide by SourceryThis pull request updates the IONEX filename convention to align with the changes implemented by JPL GIM since GPS week 2238. It includes a new function to calculate the GPS week number and modifies the filename generation logic to handle both the old and new conventions. It also modifies the wget command to specify the output filename. Sequence diagram for downloading IONEX filesequenceDiagram
participant User
participant dload_ionex
participant get_ionex_filename
participant WebServer
User->>dload_ionex: Calls dload_ionex(date_str, tec_dir, sol_code)
dload_ionex->>get_ionex_filename: Calls get_ionex_filename(date_str, tec_dir, sol_code)
get_ionex_filename-->>dload_ionex: Returns fname_src (URL of IONEX file)
dload_ionex->>WebServer: Sends HTTP request to download fname_src
WebServer-->>dload_ionex: Returns IONEX file
dload_ionex-->>User: Returns
Updated class diagram for ionex filename handlingclassDiagram
class ionex {
+dload_ionex(date_str, tec_dir, sol_code, date_fmt, print_msg)
+get_ionex_filename(date_str, tec_dir, sol_code, date_fmt)
+datetime_to_gps_week(dd)
}
class datetime {
+strptime(date_str, date_fmt)
+timetuple()
+year
+hour
+minute
}
ionex -- datetime : uses
note for ionex "Filename convention updated for GPS week >= 2238"
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @yuankailiu - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the filename generation logic into separate functions for the old and new naming conventions to improve readability.
- It might be clearer to use
datetime.date(2022, 11, 27)instead ofdt.datetimewhen you only care about the date.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Thank you @yuankailiu for the fix! I am trying to test the new code, but it gives me the following authentication error: (insar) yunjunz:~/data/S1_D062/mintpy_aoi>$ iono_tec.py timeseries.h5 -g inputs/geometryRadar.h5
------------------------------------------------------------------------------
downloading GNSS-based TEC products in IONEX format from NASA/CDDIS ...
https://cddis.nasa.gov/Data_and_Derived_Products/GNSS/atmospheric_products.html
number of TEC files to download: 251
local TEC file directory: /Users/yunjunz/data/aux/IONEX
--------------------
DATE 1/251: 20141009
wget --continue --auth-no-challenge "https://cddis.nasa.gov/archive/gnss/products/ionex/2014/282/jplg2820.14i" -O "/Users/yunjunz/data/aux/IONEX/jplg2820.14i.Z"
--2025-04-01 15:56:31-- https://cddis.nasa.gov/archive/gnss/products/ionex/2014/282/jplg2820.14i
Resolving cddis.nasa.gov (cddis.nasa.gov)... 198.118.199.52, 2001:4d0:241a:442::52
Connecting to cddis.nasa.gov (cddis.nasa.gov)|198.118.199.52|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://urs.earthdata.nasa.gov/oauth/authorize?client_id=gDQnv1IO0j9O2xXdwS8KMQ&response_type=code&redirect_uri=https%3A%2F%2Fcddis.nasa.gov%2Fproxyauth&state=aHR0cDovL2NkZGlzLm5hc2EuZ292L2FyY2hpdmUvZ25zcy9wcm9kdWN0cy9pb25leC8yMDE0LzI4Mi9qcGxnMjgyMC4xNGk [following]
--2025-04-01 15:56:36-- https://urs.earthdata.nasa.gov/oauth/authorize?client_id=gDQnv1IO0j9O2xXdwS8KMQ&response_type=code&redirect_uri=https%3A%2F%2Fcddis.nasa.gov%2Fproxyauth&state=aHR0cDovL2NkZGlzLm5hc2EuZ292L2FyY2hpdmUvZ25zcy9wcm9kdWN0cy9pb25leC8yMDE0LzI4Mi9qcGxnMjgyMC4xNGk
Resolving urs.earthdata.nasa.gov (urs.earthdata.nasa.gov)... 198.118.243.33, 2001:4d0:241a:4081::89
Connecting to urs.earthdata.nasa.gov (urs.earthdata.nasa.gov)|198.118.243.33|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Unknown authentication scheme.
Username/Password Authentication Failed.
gzip --force --keep --decompress /Users/yunjunz/data/aux/IONEX/jplg2820.14i.ZI tried to add the user/password info in the
|
|
I just test the code again with you inquired files. It is downloading okay Input Result is here |
+ objects.ionex.py: - add `SOL_CODE2SMP` for the new file name convention - update `get_ionex_filename()` to accept both the old and new IONEX file names, with corrected documentation. - add new `class SessionWithHeaderRedirection()` from OPERA and NASA example - update `dload_ionex()` to use `netrc` to grab the EarthData creditionals from the `~/.netrc` file, and to use `requests` to download, as the `wget` command will download a wrong file, due to the migration to the EarthData I guess. This example is modified from the OPERA and NASA website as well.
|
While testing using the old One weird thing is that when I am using one account on EarthData, it returns the following error; while if I am using another account, it works nicely without issue. Do we have to accept some specific "Authorized Applications" or "New EULAs" on the EarthData for the new way to work? @yuankailiu @scottstanie (insar) yunjunz:~/data/test/FernandinaSenDT128/mintpy>$ $MINTPY_HOME/tests/objects/ionex.py
--------------------------------------------------
Testing /Users/yunjunz/tools/MintPy/tests/objects/ionex.py
TEC file: /Users/yunjunz/tools/MintPy/tests/data/jplg3190.15i
download IONEX at 20151115 from jpl to /Users/yunjunz/tools/MintPy/tests/data/jplg3190.15i
401 Client Error: Unauthorized for url: https://urs.earthdata.nasa.gov/oauth/authorize?client_id=gDQnv1IO0j9O2xXdwS8KMQ&response_type=code&redirect_uri=https%3A%2F%2Fcddis.nasa.gov%2Fproxyauth&state=aHR0cDovL2NkZGlzLm5hc2EuZ292L2FyY2hpdmUvZ25zcy9wcm9kdWN0cy9pb25leC8yMDE1LzMxOS9qcGxnMzE5MC4xNWkuWg |
ionex: update to the IGS long file name convention and migration to EarthData
yunjunz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @yuankailiu for the update. I modified the code significantly following the new OPERA/DISP_S1/ionosphere.py. Could you confirm its validity?
If so, we need to update the installation page and add information on setting up the EarthData account for GIM. |
|
I just checkout your updated content (with the It looks normal and working to me. If this is the EULAs issue, why would this work for you but the wget does not? |
|
Yeah that is odd, I also don't remember doing a EULA for that... but I can check which EULAs I have on my account if you can't figure out what was happening |
|
@eedyyidi Yidi also tried the PR, and her EarthData account works fine as well. So I guess something went wrong with my EarthData account, not affecting others using the code. I will go ahead and merge this. |

Description of proposed changes
The filename convention of JPL GIM has changed since 2023-11-27 (since GPS week 2238).
See issue: #1331
Here we use the date_str to create the file base name in the new convention is the date is in and after GPS week 2238. If the date is before GPS week 2238, we use the old file base name convention.
Reminders
Summary by Sourcery
Update IONEX GIM filename convention to support the new IGS filename format introduced in GPS week 2238
New Features:
Bug Fixes:
Enhancements: