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

Frame definition #8

Merged
merged 57 commits into from
Aug 23, 2023
Merged

Conversation

scottstanie
Copy link
Contributor

@scottstanie scottstanie commented Jan 12, 2023

Script for making a DB with a frames table, along with a join table to select all bursts for a frame.

  • The frame numbers are unique across all relative_orbit_numbers.
  • The frame is assigned an EPSG code based on it's center, then all bursts in it are updated to have this epsg.
  • I fixed the install script and added the entry point opera-create-db, which will download all the necessary files and create the 2 dbs (one full one, one burst with just 5 columns that's only 22 MB zipped up)

You can grab all the bursts for a frame combination using using the query

import sqlite3

frame_id = 1  # replace this with the desired frame id

conn = sqlite3.connect("s1-frames-9frames-5min-10max.gpkg")
cursor = conn.cursor()

query = """
SELECT b.*
FROM frames_bursts AS fb
JOIN burst_id_map AS b ON fb.burst_ogc_fid = b.OGC_FID
WHERE fb.frame_fid = ?
"""

cursor.execute(query, (frame_id,))
bursts_for_frame = cursor.fetchall()

# Print the results
for burst in bursts_for_frame:
    print(burst)

- The version was manually written in setup.py and didnt match version.py

- The setup.py script had a few errors, and didnt install correctly
Copy link
Collaborator

@seongsujeong seongsujeong left a comment

Choose a reason for hiding this comment

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

My additional comments are as below. I have not reviewed frames.py yet. Please let me know if the code is ready. - Seongsu

src/burst_db/_land_usgs.py Outdated Show resolved Hide resolved
src/burst_db/_land_usgs.py Outdated Show resolved Hide resolved
src/burst_db/_land_usgs.py Outdated Show resolved Hide resolved
src/burst_db/_land_usgs.py Show resolved Hide resolved
src/burst_db/_opera_north_america.py Show resolved Hide resolved
src/burst_db/build_frame_db.py Outdated Show resolved Hide resolved
src/burst_db/build_frame_db.py Show resolved Hide resolved
src/burst_db/build_frame_db.py Show resolved Hide resolved
src/burst_db/build_frame_db.py Outdated Show resolved Hide resolved
src/burst_db/build_frame_db.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@seongsujeong seongsujeong left a comment

Choose a reason for hiding this comment

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

@scottstanie Thanks for taking care of my comments. Here are some minor comments. Most of them are for aesthetics, except for the variable name zip. - Seongsu

src/burst_db/_land_usgs.py Outdated Show resolved Hide resolved
src/burst_db/build_frame_db.py Outdated Show resolved Hide resolved
src/burst_db/build_frame_db.py Outdated Show resolved Hide resolved
src/burst_db/build_frame_db.py Outdated Show resolved Hide resolved
src/burst_db/build_frame_db.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@seongsujeong seongsujeong left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the PR and taking care of my comments @scottstanie

@scottstanie scottstanie merged commit f843141 into opera-adt:main Aug 23, 2023
@scottstanie scottstanie deleted the frame-definition branch August 23, 2023 00:30
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.

3 participants