Skip to content
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

s1_orbit: return S1A/S1B when parsing filename #104

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

scottstanie
Copy link
Contributor

This fixes #103 to get the right orbit file.

Currently we are returning "A" or "B" as a "sensor_id", then searching if the orbit file has that identifier (the single letter, which all orbit files have).

This 1. changes the parser to return the full S1A/S1B, 2. calls it the "mission_id" to match the language in the product spec https://sentinels.copernicus.eu/documents/247904/351187/Copernicus_Sentinels_POD_Service_File_Format_Specification

  1. does further simplficication and cleanup of logic to make pylance/flake8 errors go away

The movement of function locations is to group similar functions together (parse_safe_filename and get_file_name_tokens were >100 lines apart before)

This fixes isce-framework#103 to get the right orbit file.

Currently we are returning "A" or "B" as a "sensor_id", then searching if the orbit file has that identifier (the single letter, which all orbit files have).

This 1. changes the parser to return the full S1A/S1B, 2. calls it the "mission_id" to match the language in the product spec https://sentinels.copernicus.eu/documents/247904/351187/Copernicus_Sentinels_POD_Service_File_Format_Specification

3. does further simplficication and cleanup of logic to make pylance/flake8 errors go away
Copy link
Contributor

@vbrancat vbrancat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor comments at this stage.

end_time, 'AUX_POEORB')
# If orbit dict is empty, find restituted orbits
if orbit_dict is None:
orbit_dict = get_orbit_dict(sensor_id, start_time,
orbit_dict = get_orbit_dict(mission_id, start_time,
end_time, 'AUX_RESORB')
# Download orbit file
orbit_file = os.path.join(orbit_dir, orbit_dict["orbit_name"] + '.EOF')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find more compact to use fstring

src/s1reader/s1_orbit.py Show resolved Hide resolved
Copy link
Contributor

@LiangJYu LiangJYu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@vbrancat vbrancat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @scottstanie, LGTM

src/s1reader/s1_orbit.py Show resolved Hide resolved
@scottstanie scottstanie merged commit 7def131 into isce-framework:main Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: get_orbit_file_from_dir chooses the wrong platform's orbit
3 participants