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

use radargrid step parameters to simplify _steps_to_vecs #107

Merged
merged 2 commits into from
Mar 7, 2023

Conversation

scottstanie
Copy link
Contributor

Now that the function self.as_isce3_radargrid has parameters for step sizes, we dont need to redo the logic to compute the coordinates.

This should fix #105 where the differing logic causes different coordinates.

It also allows us to remove redundant error checking that happens in the as_isce3_radaragrid function

Now that the function `self.as_isce3_radargrid` has parameters for step sizes, we dont need to redo the logic to compute the coordinates.

This should fix isce-framework#105 where the differing logic causes different coordinates.

It also allows us to remove redundant error checking that happens in the `as_isce3_radaragrid` function
@scottstanie scottstanie requested review from LiangJYu, seongsujeong and vbrancat and removed request for LiangJYu and seongsujeong March 6, 2023 17:40
@scottstanie
Copy link
Contributor Author

Just to record here how I made the 45 KB DEM:

  1. get the frame bounding box
$ s1_info bbox tests/data/ --frame-bbox
....
tests/data/S1A_IW_SLC__1SDV_20200511T135117_20200511T135144_032518_03C421_7768.zip: [-118.4623919679569, 37.13399532964601, -115.2797133707291, 39.09331696978008]
  1. Make a DEM which we'll overwrite in that area
(mapping) staniewi:s1-reader$ sardem --output-format GTiff --data cop --bbox -118.4623919679569 37.13399532964601 -115.2797133707291 39.09331696978008 -o tests/data/dummy_dem.tif
  1. Use rasterio to start writing a DEM but write out no data
In [96]: src = rio.open("dummy_dem.tif")
In [99]: opts = {"SPARSE_OK": "TRUE", 'PREDICTOR': 2, 'compress': 'lzw'}
In [100]: with rio.open("dummy_dem2.tif", 'w', **opts, **src.meta) as dst:
     ...:     pass
     ...:
In [101]: src.close()
$ mv tests/data/dummy_dem2.tif  tests/data/dummy_dem.tif 
$ ls -lh tests/data/dummy_dem.tif
-rw-r--r--  1 staniewi  staff    55K Mar  6 13:12 tests/data/dummy_dem.tif

@scottstanie
Copy link
Contributor Author

@LiangJYu I'm not sure why the test would be failing on circleCI: https://app.circleci.com/pipelines/github/opera-adt/s1-reader/337/workflows/f09e7192-4068-4d95-bfc7-5f95ceff991c/jobs/331
It says the EPSG of the DEM is -9997 ... but that's not what i'm getting locally


In [113]: import isce3
In [117]: dem_raster = isce3.io.Raster('tests/data/dummy_dem.tif')
In [118]: dem_raster.get_epsg()
Out[118]: 4326

and the tests pass for me too... so maybe someone else can checkout this PR and run pytest to see if it's just me

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.

LGTM. Tested with COMPASS and had no issue with that. Just wondering about uploading test data in the repository. Can we have them on Zenodo? that is what we are doing with COMPASS.

@@ -12,6 +12,7 @@ def test_paths():
test_paths.safe = f"{test_path}/data/S1A_IW_SLC__1SDV_20200511T135117_20200511T135144_032518_03C421_7768.zip"
test_paths.orbit_dir = f"{test_path}/data/orbits"
test_paths.orbit_file = "S1A_OPER_AUX_POEORB_OPOD_20210318T120818_V20200510T225942_20200512T005942.EOF"
test_paths.dem_file = f"{test_path}/data/dummy_dem.tif"
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought that our plan was not to add data to the GitHub repository but to have it be downloaded from Zenodo. Is that still the case?

Copy link
Contributor

Choose a reason for hiding this comment

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

If there's no meaningful data other than EPSG in the DEM file, perhaps it can generated on the fly in the conftest as a session fixture?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah that sounds like a good solution too
I'm breaking off the unit test to here #108 so that Virginia can proceed with COMPASS SET testing

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.

@scottstanie thank you for the quick fix

@LiangJYu
Copy link
Contributor

LiangJYu commented Mar 6, 2023

@LiangJYu I'm not sure why the test would be failing on circleCI: https://app.circleci.com/pipelines/github/opera-adt/s1-reader/337/workflows/f09e7192-4068-4d95-bfc7-5f95ceff991c/jobs/331 It says the EPSG of the DEM is -9997 ... but that's not what i'm getting locally


In [113]: import isce3
In [117]: dem_raster = isce3.io.Raster('tests/data/dummy_dem.tif')
In [118]: dem_raster.get_epsg()
Out[118]: 4326

and the tests pass for me too... so maybe someone else can checkout this PR and run pytest to see if it's just me

I'm able to replicate you results above in ipython. Unable to replicate unit test fail...

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

@scottstanie scottstanie merged commit c2c53d2 into isce-framework:main Mar 7, 2023
@scottstanie scottstanie deleted the fix-steps-to-vec branch March 7, 2023 00:48
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]: Inconsistent correction grid dimensions
3 participants