Error in GR to SR conversion in TerrainFlatteningOp?

In TerrainFlatteningOp, ground range pixel area is converted to area in slant range using this code:

private double computeSRGRRatio(final int x, final double[] srgrCoeff) {
    final double groundRange1 = x * rangeSpacing;
    final double slantRange1 = Maths.computePolynomialValue(groundRange1, srgrCoeff);
    final double groundRange2 = groundRange1 + rangeSpacing;
    final double slantRange2 = Maths.computePolynomialValue(groundRange2, srgrCoeff);
    return (slantRange2 - slantRange1) / rangeSpacing;
}

It uses srgr coefficients. According to S1 specs, they define a polynom “srgr” where GR = srgr(SR). There are equivalent grsr coefficients where SR = grsr(GR). Shouldn’t the code above use grsr instead of srgr?

This is my understanding of the code:
Terrain flattening computes the illuminated area of a pixel in a plane perpendicular to slant (A_gamma?) and compares it to the area of the pixel along slant (A_beta).
In GRD products, range pixel spacing is in ground range. So to get A_beta, ground range is converted to slant range. That would imply that grsr coefficients need to be used.

@jun_lu, @lveci Can you take a look?

The SRGR coefficients are actually the GRSR coefficients. It’s a naming issue. For details, please see
https://senbox.atlassian.net/browse/SITBX-857