-
Notifications
You must be signed in to change notification settings - Fork 39
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
Azimuth time interpolation for Weather Models in GUNW Workflow #571
Conversation
@sssangha and I worked on this repo together: https://github.com/ACCESS-Cloud-Based-InSAR/s1_azimuth_time_grid Lines 121 to 150 in 4e00730
Let us know your thoughts. Note: I updated the test above so all the data is mocked. The HRRR API (AWS s3) is not required. |
@sssangha - the easiest way to use this PR is:
|
Here is an example GUNW product that is also used in the test. The command to generate is:
Below are some screenshots of the reference delay in radians for the above product. |
Could you please show the residual between this and the original (uncorrected for azimuth time)? |
I can do this in the afternoon. Please note the test suite for GUNWs include a test that shows the residual of said product above is below 1 mm. Do you want to see spatial pattern of said residual? |
When I run the command line argument for GUNWs, note I get the following output in the log:
I also have weird nodata values in the HRRR. Will open an issue ticket to illustrate. |
From @sssangha: Here is a series of quick figures. I’ll also paste the input GUNWs + sequence of few commands I used to extract these layers. I will go ahead and pass the latter into a formal notebook later. Troposphere hydrostatic layer at 500 m elevation directly from the overlapping GUNWs, for the reference date: Troposphere wet layer at 500 m elevation directly from the overlapping GUNWs, for the reference date: Reference date extracted and stitched tropo total via ARIA-tools: Secondary date extracted and stitched tropo total via ARIA-tools: Everything overall looks seamless, but upon closer inspection in the GUNWs, I found surprisingly large mean/min values. E.g. for the overlap region of the troposphere hydro layer: For the overlap region of the troposphere wet layer: When I looked at the actual residual fields for the hydro and wet layers, respectively, I found a few strange, very narrow rows with some non-zero residual: Here are the commands I used: GUNWs used:S1-GUNW-A-R-064-tops-20210723_20210711-015001-35393N_33512N-PP-6267-v2_0_4.nc
|
@sssangha do you have a function handy for cropping to the overlap? |
I am not seeing this residual in the delays within the GUNW from RAiDER (prior to running ARIA-tools and the intersection). I'll see if I can recreate after running AT and debug, but as the problem does not appear to be in RAiDER, I think this PR can be merged. Note, I also tested with GMAO (no azimuth interpolation) and there is no weird striping difference. Before #575 After #575 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on closer inspection, there needs to be a fail safe to set a default value for interpolation grid in the case that one does not exist in the users .yaml file (when running raider not in the GUNW workfloW)
Hey @bbuzz31 - I feel like this ask would be a separate PR. The above PR is really focused on the GUNW. Did this PR change an existing functionality for the non-GUNW workflow? I don't think interpolation is an option (yet) in the non-GUNW workflow. Regardless, this is a pretty big PR largely because of testing. If you wanted specific changes, please give some reference in the code of what you wanted. |
No it should be in here. There is no default behavior if there isn't an |
@@ -245,12 +246,27 @@ def calcDelays(iargs=None): | |||
# Grab the closest two times unless the user specifies 'nearest' | |||
# If the model time_delta is not specified then use 6 | |||
# The two datetimes will be combined to a single file and processed | |||
times = get_nearest_wmtimes(t, [model.dtime() if \ | |||
model.dtime() is not None else 6][0]) if params['interpolate_time'] else [t] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbuzz31 - this is the default behavior currently i.e. when the interpolate_time
is True
or False
. If we change this to None
by not specifying in yaml, the same behavior will occur. What more are you asking?
tools/RAiDER/cli/raider.py
Outdated
@@ -245,12 +246,27 @@ def calcDelays(iargs=None): | |||
# Grab the closest two times unless the user specifies 'nearest' | |||
# If the model time_delta is not specified then use 6 | |||
# The two datetimes will be combined to a single file and processed | |||
times = get_nearest_wmtimes(t, [model.dtime() if \ | |||
model.dtime() is not None else 6][0]) if params['interpolate_time'] else [t] | |||
interp_method = params['interpolate_time'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbuzz31 - when you read a yaml file with a given field and it is not specified - then the dictionary returns None
for the said blank-valued key so the default behavior is not changed. I will change this to get
for further clarity.
All the tests are passing. I am still unclear what you mean by default for the non-GUNW workflow or how that is called. I am hoping that the non-GUNW workflow just reads or modifies the yaml file here? Is there an example? My opinion is there should be a test for the control flow that you are asking and therefore a separate PR. I assume you mean the This seems problematic to me: https://github.com/dbekaert/RAiDER/blob/dev/tools/RAiDER/cli/raider.py#L286-L289 - unexpected behavior when you specify a non-nearest interpolation and only one file is returned. I will add some additional control flow, but again - please be as specific as possible with what you want here. It's very intricate control flow and I tried to modify it as little as possible while including these changes. |
Lines 251 to 264 in raider.py are as follows
|
@cmarshak thanks for taking care of these last bits. feel free to merge if you are finished |
Ports the azimuth time grid interpolation demonstrated here to RAiDER's GUNW workflow. Formerly the center time was used to interpolate across the entire weather cube for two weather model times. Now, it is based on the time in which the sensor passes the pixel at zero-doppler (using ISCE3
geo2rdr
).The main test will be to show that the
center_time
interpolation and theazimuth_time_grid
interpolation doe not deviate more than 1 mm.There is a change in the API for yaml (see here) and CLI (see here). Specifically, updates
interpolate_time
options to:'none'
(formerlyFalse
),'center_time'
(formerlyTrue
and no longerdefault
), andazimuth_time_grid
(not implemented previously and nowdefault
only working forHRRR
model)This will make the default behavior for the GUNW workflow
azimuth_time_grid
, which only works for HRRR.