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

add option to save flat earth phase for interferogram and coherence generation #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ public class CoherenceOpUI extends BaseOperatorUI {
private final JCheckBox independentWindowSizeCheckBox = new JCheckBox("Independent Window Sizes");
private final JCheckBox subtractFlatEarthPhaseCheckBox = new JCheckBox("Subtract flat-earth phase");
private final JCheckBox subtractTopographicPhaseCheckBox = new JCheckBox("Subtract topographic phase");
private final JCheckBox outputFlatEarthPhaseCheckBox = new JCheckBox("Output flat-earth phase");

private final JTextField cohWinAz = new JTextField("");
private final JTextField cohWinRg = new JTextField("");

private final JComboBox<Integer> srpPolynomialDegreeStr = new JComboBox(new Integer[]{1, 2, 3, 4, 5, 6, 7, 8});
private final JComboBox<Integer> srpNumberPointsStr = new JComboBox(new Integer[]{301, 401, 501, 601, 701, 801, 901, 1001});
private final JComboBox<Integer> orbitDegreeStr = new JComboBox(new Integer[]{1, 2, 3, 4, 5});
private final JComboBox<Integer> orbitDegreeStr = new JComboBox(new Integer[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10});

private static final JLabel cohWinAzLabel = new JLabel("Coherence Azimuth Window Size");
private static final JLabel cohWinRgLabel = new JLabel("Coherence Range Window Size");
Expand All @@ -65,6 +66,7 @@ public class CoherenceOpUI extends BaseOperatorUI {

private Boolean squarePixel = true;
private Boolean subtractFlatEarthPhase = false;
private Boolean outputFlatEarthPhase = false;
private Boolean singleReference = true;
private final CoherenceOp.DerivedParams param = new CoherenceOp.DerivedParams();

Expand Down Expand Up @@ -99,6 +101,11 @@ public void itemStateChanged(ItemEvent e) {
}
});

outputFlatEarthPhaseCheckBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
outputFlatEarthPhase = (e.getStateChange() == ItemEvent.SELECTED);
}
});
squarePixelCheckBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
squarePixel = (e.getStateChange() == ItemEvent.SELECTED);
Expand Down Expand Up @@ -186,6 +193,13 @@ public void initParameters() {
enableSubtractFlatEarthPhaseParameters(subtractFlatEarthPhase);
}

paramVal = (Boolean) paramMap.get("outputFlatEarthPhase");
if (paramVal != null) {
outputFlatEarthPhase = paramVal;
}
outputFlatEarthPhaseCheckBox.setSelected(outputFlatEarthPhase);
outputFlatEarthPhaseCheckBox.setEnabled(subtractFlatEarthPhase);

srpPolynomialDegreeStr.setSelectedItem(paramMap.get("srpPolynomialDegree"));
srpNumberPointsStr.setSelectedItem(paramMap.get("srpNumberPoints"));
orbitDegreeStr.setSelectedItem(paramMap.get("orbitDegree"));
Expand Down Expand Up @@ -272,6 +286,7 @@ public void updateParameters() {
paramMap.put("srpPolynomialDegree", srpPolynomialDegreeStr.getSelectedItem());
paramMap.put("srpNumberPoints", srpNumberPointsStr.getSelectedItem());
paramMap.put("orbitDegree", orbitDegreeStr.getSelectedItem());
paramMap.put("OUTPUT_PHASE", outputFlatEarthPhase);
}

paramMap.put("singleMaster", singleReference);
Expand Down Expand Up @@ -311,6 +326,10 @@ JComponent createPanel() {
gbc.gridy++;
contentPane.add(subtractFlatEarthPhaseCheckBox, gbc);

gbc.gridy++;
contentPane.add(outputFlatEarthPhaseCheckBox, gbc);
outputFlatEarthPhaseCheckBox.setEnabled(false);

gbc.gridy++;
DialogUtils.addComponent(contentPane, gbc, srpPolynomialDegreeStrLabel, srpPolynomialDegreeStr);

Expand Down Expand Up @@ -417,6 +436,7 @@ private void enableSubtractFlatEarthPhaseParameters(boolean flag) {
srpPolynomialDegreeStr.setEnabled(flag);
srpNumberPointsStr.setEnabled(flag);
orbitDegreeStr.setEnabled(flag);
outputFlatEarthPhaseCheckBox.setEnabled(flag);
}

private void enableSubtractTopographicPhaseParameters(boolean flag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
public class InterferogramOpUI extends BaseOperatorUI {

private final JCheckBox subtractFlatEarthPhaseCheckBox = new JCheckBox("Subtract flat-earth phase");
private final JCheckBox outputFlatEarthPhaseCheckBox = new JCheckBox("Output flat-earth phase");
private final JCheckBox subtractTopographicPhaseCheckBox = new JCheckBox("Subtract topographic phase");
private final JCheckBox includeCoherenceCheckBox = new JCheckBox("Include coherence estimation");
private final JCheckBox squarePixelCheckBox = new JCheckBox("Square Pixel");
Expand All @@ -56,7 +57,7 @@ public class InterferogramOpUI extends BaseOperatorUI {

private final JComboBox<Integer> srpPolynomialDegreeStr = new JComboBox(new Integer[]{1, 2, 3, 4, 5, 6, 7, 8});
private final JComboBox<Integer> srpNumberPointsStr = new JComboBox(new Integer[]{301, 401, 501, 601, 701, 801, 901, 1001});
private final JComboBox<Integer> orbitDegreeStr = new JComboBox(new Integer[]{1, 2, 3, 4, 5});
private final JComboBox<Integer> orbitDegreeStr = new JComboBox(new Integer[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10});

private static final JLabel cohWinAzLabel = new JLabel("Coherence Azimuth Window Size");
private static final JLabel cohWinRgLabel = new JLabel("Coherence Range Window Size");
Expand All @@ -65,6 +66,7 @@ public class InterferogramOpUI extends BaseOperatorUI {
private static final JLabel orbitDegreeStrLabel = new JLabel("Orbit interpolation degree");

private Boolean subtractFlatEarthPhase = false;
private Boolean outputFlatEarthPhase = false;
private Boolean includeCoherence = true;
private Boolean squarePixel = true;
private final CoherenceOp.DerivedParams param = new CoherenceOp.DerivedParams();
Expand Down Expand Up @@ -103,14 +105,22 @@ public void itemStateChanged(ItemEvent e) {
srpPolynomialDegreeStr.setEnabled(true);
srpNumberPointsStr.setEnabled(true);
orbitDegreeStr.setEnabled(true);
outputFlatEarthPhaseCheckBox.setEnabled(true);
} else {
srpPolynomialDegreeStr.setEnabled(false);
srpNumberPointsStr.setEnabled(false);
orbitDegreeStr.setEnabled(false);
outputFlatEarthPhaseCheckBox.setEnabled(false);
}
}
});

outputFlatEarthPhaseCheckBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
outputFlatEarthPhase = (e.getStateChange() == ItemEvent.SELECTED);
}
});

includeCoherenceCheckBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {

Expand Down Expand Up @@ -232,6 +242,13 @@ public void initParameters() {
subtractFlatEarthPhaseCheckBox.setSelected(subtractFlatEarthPhase);
}

paramVal = (Boolean) paramMap.get("outputFlatEarthPhase");
if (paramVal != null) {
outputFlatEarthPhase = paramVal;
}
outputFlatEarthPhaseCheckBox.setSelected(outputFlatEarthPhase);
outputFlatEarthPhaseCheckBox.setEnabled(subtractFlatEarthPhase);

srpPolynomialDegreeStr.setSelectedItem(paramMap.get("srpPolynomialDegree"));
srpNumberPointsStr.setSelectedItem(paramMap.get("srpNumberPoints"));
orbitDegreeStr.setSelectedItem(paramMap.get("orbitDegree"));
Expand Down Expand Up @@ -339,6 +356,7 @@ public void updateParameters() {
paramMap.put("srpPolynomialDegree", srpPolynomialDegreeStr.getSelectedItem());
paramMap.put("srpNumberPoints", srpNumberPointsStr.getSelectedItem());
paramMap.put("orbitDegree", orbitDegreeStr.getSelectedItem());
paramMap.put("OUTPUT_PHASE", outputFlatEarthPhase);
}

paramMap.put("subtractTopographicPhase", subtractTopographicPhase);
Expand Down Expand Up @@ -378,6 +396,10 @@ JComponent createPanel() {

contentPane.add(subtractFlatEarthPhaseCheckBox, gbc);

gbc.gridy++;
contentPane.add(outputFlatEarthPhaseCheckBox, gbc);
outputFlatEarthPhaseCheckBox.setEnabled(false);

gbc.gridy++;
DialogUtils.addComponent(contentPane, gbc, srpPolynomialDegreeStrLabel, srpPolynomialDegreeStr);
srpPolynomialDegreeStr.setEnabled(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public class CoherenceOp extends Operator {
@Parameter(defaultValue = "false", label = "Subtract flat-earth phase in coherence phase")
private boolean subtractFlatEarthPhase = false;

@Parameter(defaultValue = "false", label = "Output flat-earth phase")
private boolean OUTPUT_PHASE = false;

@Parameter(valueSet = {"1", "2", "3", "4", "5", "6", "7", "8"},
description = "Order of 'Flat earth phase' polynomial",
defaultValue = "5",
Expand All @@ -101,7 +104,7 @@ public class CoherenceOp extends Operator {
label = "Number of \"Flat Earth\" estimation points")
private int srpNumberPoints = 501;

@Parameter(valueSet = {"1", "2", "3", "4", "5"},
@Parameter(valueSet = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"},
description = "Degree of orbit (polynomial) interpolator",
defaultValue = "3",
label = "Orbit interpolation degree")
Expand Down Expand Up @@ -174,7 +177,6 @@ public class CoherenceOp extends Operator {

private static final int ORBIT_DEGREE = 3; // hardcoded
private static final String PRODUCT_SUFFIX = "_Coh";
private static final boolean OUTPUT_PHASE = false;
private static final String FLAT_EARTH_PHASE = "flat_earth_phase";
private static final String TOPO_PHASE = "topo_phase";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public class InterferogramOp extends Operator {
@Parameter(defaultValue = "true", label = "Subtract flat-earth phase")
private boolean subtractFlatEarthPhase = true;

@Parameter(defaultValue = "false", label = "Output flat-earth phase")
private boolean OUTPUT_PHASE = false;

@Parameter(valueSet = {"1", "2", "3", "4", "5", "6", "7", "8"},
description = "Order of 'Flat earth phase' polynomial",
defaultValue = "5",
Expand All @@ -84,7 +87,7 @@ public class InterferogramOp extends Operator {
label = "Number of \"Flat Earth\" estimation points")
private int srpNumberPoints = 501;

@Parameter(valueSet = {"1", "2", "3", "4", "5"},
@Parameter(valueSet = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"},
description = "Degree of orbit (polynomial) interpolator",
defaultValue = "3",
label = "Orbit interpolation degree")
Expand Down Expand Up @@ -139,7 +142,7 @@ public class InterferogramOp extends Operator {

@Parameter(defaultValue = "false", label = "Output Lat/Lon")
private boolean outputLatLon = false;

// flat_earth_polynomial container
private Map<String, DoubleMatrix> flatEarthPolyMap = new HashMap<>();
private boolean flatEarthEstimated = false;
Expand Down Expand Up @@ -173,7 +176,6 @@ public class InterferogramOp extends Operator {
private MetadataElement mstRoot = null;

private static final boolean CREATE_VIRTUAL_BAND = true;
private static final boolean OUTPUT_PHASE = false;
private static final String PRODUCT_SUFFIX = "_Ifg";
private static final String FLAT_EARTH_PHASE = "flat_earth_phase";
private static final String TOPO_PHASE = "topo_phase";
Expand Down