Skip to content

Add support for RAiDER tropo layers#335

Merged
bbuzzanga merged 96 commits intodevfrom
sss_raidersup
Feb 2, 2023
Merged

Add support for RAiDER tropo layers#335
bbuzzanga merged 96 commits intodevfrom
sss_raidersup

Conversation

@sssangha
Copy link
Collaborator

Addresses Issue #334

Implemented end-to-end support for RAiDER tropo layers in a version 1c GUNW product. This includes setting and passing the appropriate dictionary and product layer keys, as well as interpolating and intersecting the tropo layers with a DEM.

Note a couple of caveats:

  1. Unlike the geometry layers, height level information is not readily transparent through the metadata. So for the time-being, I've made some assumptions based off of this RAiDER discussion: Defining GUNW cubes dbekaert/RAiDER#444. See lines 721-731 in extractProduct.py. Again, I understand this is not completely appropriate, so I'd like to touch bases with the team on this to set the correct values. Furthermore, the regular grid interpolator used here does not allow for descending height values, so I have to flip the input array vertically before interpolation.
  2. The program runs end-to-end now without issue and generates interpolated/intersected outputs with the expected dimensions and spatial extents. However, the outputs appear strange -- looks like clearly something went wrong with the interpolation. I assume it may be related to the above assumptions that were made.
    Below from left to right: amplitude, troposphereWet,troposphereHydrostatic
    Screen Shot 2022-12-21 at 1 33 24 AM

Replicate test:

Using a test product from @bbuzz31 , the following was my commandline input:
ariaExtract.py -l 'amplitude,troposphereWet,troposphereHydrostatic' -nt 10 -f "products/S1*.nc" -d Download -of ISCE -w test

@sssangha
Copy link
Collaborator Author

Following our convos, I've located the appropriate height levels variable within the netcdf and made changes accordingly: https://github.com/aria-tools/ARIA-tools/blob/sss_raidersup/tools/ARIAtools/extractProduct.py#L629-#L645

Note from this height field, I realized the heights were already in ascending order, so I reverted the tweak I made to flip the tropo layers.

Copy link
Collaborator

@bbuzzanga bbuzzanga left a comment

Choose a reason for hiding this comment

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

Incorporates #329

@sssangha
Copy link
Collaborator Author

@dbekaert regarding your note on another PR, looks like the build is failing because it's running out of the allotted 4Gb RAM in the container under the free plan. This explains why we were unable to replicate it locally.

Aside from finding the root of this bottleneck, the only other two options is to either subscribe to the "Performance Plan" or switch from a docker container to a machine executor by tweaking the config file.

sssangha and others added 5 commits January 23, 2023 20:01
Do not assume tropo-layers exist in all products.
But keep in separate stack VRT files through ariaTSsetup
Originally, latter was getting overwritten
@sssangha
Copy link
Collaborator Author

Change to organization and structure of total troposphere (plus other components when specified).

Specifically, now the weather model itself is tracked such that tropo products are extracted into respective subdirectories, e.g.:

(ARIA-tools) [ssangha@trappist test_output_raider]$ ls
azimuthAngle    coherence            DEM             lookAngle          productBoundingBox  troposphereHydrostatic  troposphereWet  user_bbox.json
bPerpendicular  connectedComponents  incidenceAngle  metadatalyr_plots  stack               troposphereTotal        unwrappedPhase
(ARIA-tools) [ssangha@trappist test_output_raider]$ ls tropo*/*
troposphereHydrostatic/HRES:
20200130_20200112  20200130_20200112.aux.xml  20200130_20200112.hdr  20200130_20200112.vrt  20200130_20200118  20200130_20200118.aux.xml  20200130_20200118.hdr  20200130_20200118.vrt

troposphereTotal/HRES:
20200130_20200112  20200130_20200112.aux.xml  20200130_20200112.hdr  20200130_20200112.vrt  20200130_20200118  20200130_20200118.aux.xml  20200130_20200118.hdr  20200130_20200118.vrt

troposphereWet/HRES:
20200130_20200112  20200130_20200112.aux.xml  20200130_20200112.hdr  20200130_20200112.vrt  20200130_20200118  20200130_20200118.aux.xml  20200130_20200118.hdr  20200130_20200118.vrt

For TS analysis or stack visualization, separate VRTs reflecting this structure are deposited within the stack subdirectory as so e.g.:

(ARIA-tools) [ssangha@trappist test_output_raider]$ cd stack/
(ARIA-tools) [ssangha@trappist stack]$ ls
cohStack.vrt  connCompStack.vrt  troposphereHydrostatic  troposphereTotal  troposphereWet  unwrapStack.vrt
(ARIA-tools) [ssangha@trappist stack]$ ls tropo*/*
troposphereHydrostatic/HRESStack.vrt  troposphereTotal/HRESStack.vrt  troposphereWet/HRESStack.vrt
(ARIA-tools) [ssangha@trappist stack]$ head tropo*/*
==> troposphereHydrostatic/HRESStack.vrt <==
<VRTDataset rasterXSize="3625" rasterYSize="2359">
        <SRS>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"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]</SRS>
        <GeoTransform>-119.2725,0.000833333333333238,-0.0,34.945,-0.0,-0.000833333333333362</GeoTransform>

          <VRTRasterBand dataType="Float32" band="1">
        <SimpleSource>
            <SourceFilename relativeToVRT="1">../../troposphereHydrostatic/HRES/20200130_20200112.vrt</SourceFilename>
            <SourceBand>1</SourceBand>
            <SourceProperties RasterXSize="3625" RasterYSize="2359"
                DataType="Float32"/>

==> troposphereTotal/HRESStack.vrt <==
<VRTDataset rasterXSize="3625" rasterYSize="2359">
        <SRS>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"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]</SRS>
        <GeoTransform>-119.2725,0.000833333333333238,-0.0,34.945,-0.0,-0.000833333333333362</GeoTransform>

          <VRTRasterBand dataType="Float32" band="1">
        <SimpleSource>
            <SourceFilename relativeToVRT="1">../../troposphereTotal/HRES/20200130_20200112.vrt</SourceFilename>
            <SourceBand>1</SourceBand>
            <SourceProperties RasterXSize="3625" RasterYSize="2359"
                DataType="Float32"/>

==> troposphereWet/HRESStack.vrt <==
<VRTDataset rasterXSize="3625" rasterYSize="2359">
        <SRS>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"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]</SRS>
        <GeoTransform>-119.2725,0.000833333333333238,-0.0,34.945,-0.0,-0.000833333333333362</GeoTransform>

          <VRTRasterBand dataType="Float32" band="1">
        <SimpleSource>
            <SourceFilename relativeToVRT="1">../../troposphereWet/HRES/20200130_20200112.vrt</SourceFilename>
            <SourceBand>1</SourceBand>
            <SourceProperties RasterXSize="3625" RasterYSize="2359"
                DataType="Float32"/>

Also @mgovorcin , note that I reverted some of the logic you introduced in generate_stack because we expect/force there to be a one-to-one match between layer keys and output subdirectories such that there shouldn't be a need to query with re tools or so. If I'm mistaken by your intention here though, then please let me know and we'll iterate. Thanks!

@bbuzzanga bbuzzanga merged commit a858597 into dev Feb 2, 2023
@bbuzzanga bbuzzanga deleted the sss_raidersup branch February 2, 2023 00:45
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.

4 participants