opera-adt / COMPASS

COregistered Multi-temPorAl Sar Slc
Apache License 2.0
39 stars 18 forks source link

[Bug]: geogrid information is missing in `topo.h5` #96

Closed seongsujeong closed 1 year ago

seongsujeong commented 1 year ago

Checked for duplicates

Yes - I've already checked

Describe the bug

I'm not sure if that is intentional, but I've found that the geocoding information is missing in topo.h5, the auxiliary data we get when enabled is True in rdr2geo.

Here is the information that I've got after trying gdalinfo for the GSLC output:

gdalinfo NETCDF:t071_151224_iw1_20221016.h5:/science/SENTINEL1/CSLC/grids/VV
Driver: netCDF/Network Common Data Format
Files: t071_151224_iw1_20221016.h5
Size is 19860, 4779
Coordinate System is:
PROJCRS["WGS 84 / UTM zone 11N",
    BASEGEOGCRS["WGS 84",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["UTM zone 11N",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-117,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    ID["EPSG",32611]]
Data axis to CRS axis mapping: 1,2
Origin = (476940.000000000000000,3858150.000000000000000)
Pixel Size = (5.000000000000000,-10.000000000000000)
Metadata:
  /science/SENTINEL1/CSLC/grids/projection#ellipsoid=WGS84
  /science/SENTINEL1/CSLC/grids/projection#epsg_code=32611
  /science/SENTINEL1/CSLC/grids/projection#grid_mapping_name=universal_transverse_mercator
  /science/SENTINEL1/CSLC/grids/projection#inverse_flattening=298.257223563
  /science/SENTINEL1/CSLC/grids/projection#semi_major_axis=6378137
  /science/SENTINEL1/CSLC/grids/projection#spatial_ref=PROJCS["WGS 84 / UTM zone 11N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32611"]]
  /science/SENTINEL1/CSLC/grids/projection#utm_zone_number=11
  /science/SENTINEL1/CSLC/grids/VV#description=VV geocoded CSLC image
  /science/SENTINEL1/CSLC/grids/VV#grid_mapping=projection
  /science/SENTINEL1/CSLC/grids/x_coordinates#long_name=x coordinate of projection
  /science/SENTINEL1/CSLC/grids/x_coordinates#standard_name=projection_x_coordinate
  /science/SENTINEL1/CSLC/grids/x_coordinates#units=m
  /science/SENTINEL1/CSLC/grids/y_coordinates#long_name=y coordinate of projection
  /science/SENTINEL1/CSLC/grids/y_coordinates#standard_name=projection_y_coordinate
  /science/SENTINEL1/CSLC/grids/y_coordinates#units=m
  NC_GLOBAL#contact=operaops@jpl.nasa.gov
  NC_GLOBAL#Conventions=CF-1.8
  NC_GLOBAL#institution=NASA JPL
  NC_GLOBAL#mission_name=OPERA
  NC_GLOBAL#reference_document=TBD
  NC_GLOBAL#title=OPERA L2_CSLC_S1 Product
Corner Coordinates:
Upper Left  (  476940.000, 3858150.000) (117d15' 8.26"W, 34d51'55.58"N)
Lower Left  (  476940.000, 3810360.000) (117d15' 3.57"W, 34d26' 4.11"N)
Upper Right (  576240.000, 3858150.000) (116d 9'57.27"W, 34d51'46.23"N)
Lower Right (  576240.000, 3810360.000) (116d10'12.77"W, 34d25'54.90"N)
Center      (  526590.000, 3834255.000) (116d42'35.42"W, 34d38'59.55"N)
Band 1 Block=19860x1 Type=CFloat32, ColorInterp=Undefined
  Metadata:
    description=VV geocoded CSLC image
    grid_mapping=projection
    NETCDF_VARNAME=VV

And here is the information that I've got after trying gdalinfo for the corresponding topo.h5

gdalinfo NETCDF:topo.h5:incidence
Driver: netCDF/Network Common Data Format
Files: topo.h5
Size is 19860, 4779
Metadata:
  incidence#description=incidence
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 4779.0)
Upper Right (19860.0,    0.0)
Lower Right (19860.0, 4779.0)
Center      ( 9930.0, 2389.5)
Band 1 Block=19860x1 Type=Float32, ColorInterp=Undefined
  Metadata:
    description=incidence
    NETCDF_VARNAME=incidence

The dimension of the layers in topo.h5 is in exact match with the gslc, so I think we can extract the geogrid information and put that into the topo layer. But I am not sure if it is intentional not to provide the geogrid information into topo.h5

What did you expect?

I expected (or it would be great) to put the geocoding information into topo.h5

Reproducible steps

1. Edit runconfig to enable `rdr2geo`
2. Turn on `compute_incidence_angle: True`
3. Turn on `compute_height: True`
4. Try `gdalinfo` for the GSLC .H5 file. The geogrid information should be there.
5. Try 'gdalinfo` for `topo.h5`. I could not fine the geogrid information.

...

Environment

- compass 0.1.3
- isce3 0.9.0-dev
- MacOS 13.2
scottstanie commented 1 year ago

looks like this got added in #117