sarkit-convert 0.2.0__py3-none-any.whl → 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sarkit_convert/_utils.py +15 -18
- sarkit_convert/_version.py +1 -1
- sarkit_convert/cosmo.py +172 -178
- sarkit_convert/create_arp_poly.py +1 -1
- sarkit_convert/iceye.py +196 -291
- sarkit_convert/sentinel.py +284 -326
- sarkit_convert/terrasar.py +179 -179
- {sarkit_convert-0.2.0.dist-info → sarkit_convert-0.3.1.dist-info}/METADATA +23 -13
- sarkit_convert-0.3.1.dist-info/RECORD +14 -0
- {sarkit_convert-0.2.0.dist-info → sarkit_convert-0.3.1.dist-info}/WHEEL +1 -1
- sarkit_convert-0.2.0.dist-info/RECORD +0 -14
- {sarkit_convert-0.2.0.dist-info → sarkit_convert-0.3.1.dist-info}/entry_points.txt +0 -0
- {sarkit_convert-0.2.0.dist-info → sarkit_convert-0.3.1.dist-info}/licenses/LICENSE +0 -0
sarkit_convert/iceye.py
CHANGED
|
@@ -10,13 +10,12 @@ Note: In the development of this converter "Iceye Product Metadata" description
|
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
import argparse
|
|
13
|
-
import copy
|
|
14
13
|
import datetime
|
|
15
14
|
import pathlib
|
|
16
15
|
|
|
17
16
|
import dateutil.parser
|
|
18
17
|
import h5py
|
|
19
|
-
import lxml.
|
|
18
|
+
import lxml.etree
|
|
20
19
|
import numpy as np
|
|
21
20
|
import numpy.linalg as npl
|
|
22
21
|
import numpy.polynomial.polynomial as npp
|
|
@@ -110,88 +109,54 @@ def compute_apc_poly(h5_attrs, start_time, stop_time):
|
|
|
110
109
|
return apc_poly
|
|
111
110
|
|
|
112
111
|
|
|
113
|
-
def _update_radiometric_node(
|
|
112
|
+
def _update_radiometric_node(sicd_ew):
|
|
114
113
|
"""Use existing metadata to populate the Radiometric XML node."""
|
|
115
|
-
xmlhelp = sksicd.XmlHelper(copy.deepcopy(sicd_xmltree))
|
|
116
114
|
|
|
117
|
-
def get_slant_plane_area(
|
|
118
|
-
row_imp_resp_bw =
|
|
119
|
-
col_imp_resp_bw =
|
|
115
|
+
def get_slant_plane_area(sicd_ew):
|
|
116
|
+
row_imp_resp_bw = sicd_ew["Grid"]["Row"]["ImpRespBW"]
|
|
117
|
+
col_imp_resp_bw = sicd_ew["Grid"]["Col"]["ImpRespBW"]
|
|
120
118
|
range_weight_f = azimuth_weight_f = 1.0
|
|
121
|
-
row_wgt_funct =
|
|
122
|
-
if row_wgt_funct
|
|
119
|
+
row_wgt_funct = sicd_ew["Grid"]["Row"]["WgtFunct"]
|
|
120
|
+
if len(row_wgt_funct) > 0:
|
|
123
121
|
var = np.var(row_wgt_funct)
|
|
124
122
|
mean = np.mean(row_wgt_funct)
|
|
125
123
|
range_weight_f += var / (mean * mean)
|
|
126
|
-
col_wgt_funct =
|
|
127
|
-
if col_wgt_funct
|
|
124
|
+
col_wgt_funct = sicd_ew["Grid"]["Col"]["WgtFunct"]
|
|
125
|
+
if len(col_wgt_funct) > 0:
|
|
128
126
|
var = np.var(col_wgt_funct)
|
|
129
127
|
mean = np.mean(col_wgt_funct)
|
|
130
128
|
azimuth_weight_f += var / (mean * mean)
|
|
131
129
|
return (range_weight_f * azimuth_weight_f) / (row_imp_resp_bw * col_imp_resp_bw)
|
|
132
130
|
|
|
133
|
-
sp_area = get_slant_plane_area(
|
|
134
|
-
|
|
135
|
-
scpcoa_slope_ang =
|
|
136
|
-
scpcoa_graze_ang =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
131
|
+
sp_area = get_slant_plane_area(sicd_ew)
|
|
132
|
+
radiometric = sicd_ew["Radiometric"]
|
|
133
|
+
scpcoa_slope_ang = sicd_ew["SCPCOA"]["SlopeAng"]
|
|
134
|
+
scpcoa_graze_ang = sicd_ew["SCPCOA"]["GrazeAng"]
|
|
135
|
+
beta_zero_sf_poly_coefs = None
|
|
136
|
+
if "BetaZeroSFPoly" in radiometric:
|
|
137
|
+
beta_zero_sf_poly_coefs = radiometric["BetaZeroSFPoly"]
|
|
138
|
+
else:
|
|
139
|
+
if "RCSSFPoly" in radiometric:
|
|
140
|
+
beta_zero_sf_poly_coefs = radiometric["RCSSFPoly"] / sp_area
|
|
141
|
+
elif "SigmaZeroSFPoly" in radiometric:
|
|
142
|
+
beta_zero_sf_poly_coefs = radiometric["SigmaZeroSFPoly"] / np.cos(
|
|
143
|
+
np.deg2rad(scpcoa_slope_ang)
|
|
141
144
|
)
|
|
142
|
-
elif
|
|
143
|
-
beta_zero_sf_poly_coefs =
|
|
144
|
-
radiometric_node.find("{*}SigmaZeroSFPoly")
|
|
145
|
-
) / np.cos(np.deg2rad(scpcoa_slope_ang))
|
|
146
|
-
elif radiometric_node.find("{*}GammaZeroSFPoly") is not None:
|
|
147
|
-
beta_zero_sf_poly_coefs = xmlhelp.load_elem(
|
|
148
|
-
radiometric_node.find("{*}GammaZeroSFPoly")
|
|
149
|
-
) * (
|
|
145
|
+
elif "GammaZeroSFPoly" in radiometric:
|
|
146
|
+
beta_zero_sf_poly_coefs = radiometric["GammaZeroSFPoly"] * (
|
|
150
147
|
np.sin(np.deg2rad(scpcoa_graze_ang))
|
|
151
148
|
/ np.cos(np.deg2rad(scpcoa_slope_ang))
|
|
152
149
|
)
|
|
153
|
-
else:
|
|
154
|
-
beta_zero_sf_poly_coefs = xmlhelp.load_elem(
|
|
155
|
-
radiometric_node.find("{*}BetaZeroSFPoly")
|
|
156
|
-
)
|
|
157
150
|
|
|
158
151
|
if beta_zero_sf_poly_coefs is not None:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
gamma_zero_sf_poly_coefs = beta_zero_sf_poly_coefs * (
|
|
168
|
-
np.cos(np.deg2rad(scpcoa_slope_ang))
|
|
169
|
-
/ np.sin(np.deg2rad(scpcoa_graze_ang))
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
sicd = lxml.builder.ElementMaker(
|
|
173
|
-
namespace=NSMAP["sicd"], nsmap={None: NSMAP["sicd"]}
|
|
174
|
-
)
|
|
175
|
-
new_radiometric_node = sicd.Radiometric(
|
|
176
|
-
sicd.RCSSFPoly(),
|
|
177
|
-
sicd.SigmaZeroSFPoly(),
|
|
178
|
-
sicd.BetaZeroSFPoly(),
|
|
179
|
-
sicd.GammaZeroSFPoly(),
|
|
180
|
-
)
|
|
181
|
-
sksicd.Poly2dType().set_elem(
|
|
182
|
-
new_radiometric_node.find("./{*}RCSSFPoly"), rcs_sf_poly_coefs
|
|
183
|
-
)
|
|
184
|
-
sksicd.Poly2dType().set_elem(
|
|
185
|
-
new_radiometric_node.find("./{*}SigmaZeroSFPoly"), sigma_zero_sf_poly_coefs
|
|
186
|
-
)
|
|
187
|
-
sksicd.Poly2dType().set_elem(
|
|
188
|
-
new_radiometric_node.find("./{*}BetaZeroSFPoly"), beta_zero_sf_poly_coefs
|
|
189
|
-
)
|
|
190
|
-
sksicd.Poly2dType().set_elem(
|
|
191
|
-
new_radiometric_node.find("./{*}GammaZeroSFPoly"), gamma_zero_sf_poly_coefs
|
|
192
|
-
)
|
|
193
|
-
|
|
194
|
-
return new_radiometric_node
|
|
152
|
+
radiometric["RCSSFPoly"] = beta_zero_sf_poly_coefs * sp_area
|
|
153
|
+
radiometric["SigmaZeroSFPoly"] = beta_zero_sf_poly_coefs * np.cos(
|
|
154
|
+
np.deg2rad(scpcoa_slope_ang)
|
|
155
|
+
)
|
|
156
|
+
radiometric["BetaZeroSFPoly"] = beta_zero_sf_poly_coefs
|
|
157
|
+
radiometric["GammaZeroSFPoly"] = beta_zero_sf_poly_coefs * (
|
|
158
|
+
np.cos(np.deg2rad(scpcoa_slope_ang)) / np.sin(np.deg2rad(scpcoa_graze_ang))
|
|
159
|
+
)
|
|
195
160
|
|
|
196
161
|
|
|
197
162
|
def _get_x_y_coords(num_row_col, spacing_row_col, scp_pixel, start_row_col):
|
|
@@ -486,7 +451,6 @@ def hdf5_to_sicd(h5_filename, sicd_filename, classification, ostaid):
|
|
|
486
451
|
row_kctr = str(center_frequency / (_constants.speed_of_light / 2))
|
|
487
452
|
row_deltak_coa_poly = np.array([[0]])
|
|
488
453
|
|
|
489
|
-
col_ss = col_ss
|
|
490
454
|
col_imp_res_bw = col_bw
|
|
491
455
|
col_sgn = -1
|
|
492
456
|
col_kctr = 0
|
|
@@ -557,238 +521,180 @@ def hdf5_to_sicd(h5_filename, sicd_filename, classification, ostaid):
|
|
|
557
521
|
]
|
|
558
522
|
|
|
559
523
|
# Build XML
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
)
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
524
|
+
sicd_xml_obj = lxml.etree.Element(
|
|
525
|
+
f"{{{NSMAP['sicd']}}}SICD", nsmap={None: NSMAP["sicd"]}
|
|
526
|
+
)
|
|
527
|
+
sicd_ew = sksicd.ElementWrapper(sicd_xml_obj)
|
|
528
|
+
sicd_ew["CollectionInfo"] = {
|
|
529
|
+
"CollectorName": collector_name,
|
|
530
|
+
"CoreName": core_name,
|
|
531
|
+
"CollectType": collect_type,
|
|
532
|
+
"RadarMode": {
|
|
533
|
+
"ModeType": mode_type,
|
|
534
|
+
"ModeID": mode_id,
|
|
535
|
+
},
|
|
536
|
+
"Classification": classification,
|
|
537
|
+
}
|
|
538
|
+
sicd_ew["ImageCreation"] = {
|
|
539
|
+
"Application": creation_application,
|
|
540
|
+
"DateTime": creation_date_time,
|
|
541
|
+
}
|
|
542
|
+
sicd_ew["ImageData"] = {
|
|
543
|
+
"PixelType": pixel_type,
|
|
544
|
+
"NumRows": num_rows,
|
|
545
|
+
"NumCols": num_cols,
|
|
546
|
+
"FirstRow": first_row,
|
|
547
|
+
"FirstCol": first_col,
|
|
548
|
+
"FullImage": {
|
|
549
|
+
"NumRows": num_rows,
|
|
550
|
+
"NumCols": num_cols,
|
|
551
|
+
},
|
|
552
|
+
"SCPPixel": scp_pixel,
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
sicd_ew["GeoData"] = {
|
|
556
|
+
"EarthModel": "WGS_84",
|
|
557
|
+
"SCP": {
|
|
558
|
+
"ECF": scp_ecf,
|
|
559
|
+
"LLH": scp_llh,
|
|
560
|
+
},
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
sicd_ew["Grid"] = {
|
|
564
|
+
"ImagePlane": image_plane,
|
|
565
|
+
"Type": grid_type,
|
|
566
|
+
"TimeCOAPoly": time_coa_poly,
|
|
567
|
+
"Row": {
|
|
568
|
+
"UVectECF": row_uvect_ecf,
|
|
569
|
+
"SS": row_ss,
|
|
570
|
+
"ImpRespWid": row_imp_res_wid,
|
|
571
|
+
"Sgn": row_sgn,
|
|
572
|
+
"ImpRespBW": row_imp_res_bw,
|
|
573
|
+
"KCtr": row_kctr,
|
|
574
|
+
"DeltaK1": row_delta_k1,
|
|
575
|
+
"DeltaK2": row_delta_k2,
|
|
576
|
+
"DeltaKCOAPoly": row_deltak_coa_poly,
|
|
577
|
+
"WgtType": {
|
|
578
|
+
"WindowName": row_win,
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
"Col": {
|
|
582
|
+
"UVectECF": col_uvect_ecf,
|
|
583
|
+
"SS": col_ss,
|
|
584
|
+
"ImpRespWid": col_imp_res_wid,
|
|
585
|
+
"Sgn": col_sgn,
|
|
586
|
+
"ImpRespBW": col_imp_res_bw,
|
|
587
|
+
"KCtr": col_kctr,
|
|
588
|
+
"DeltaK1": col_delta_k1,
|
|
589
|
+
"DeltaK2": col_delta_k2,
|
|
590
|
+
"DeltaKCOAPoly": col_deltak_coa_poly,
|
|
591
|
+
"WgtType": {
|
|
592
|
+
"WindowName": col_win,
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
sicd_ew["Timeline"] = {
|
|
598
|
+
"CollectStart": collect_start,
|
|
599
|
+
"CollectDuration": collect_duration,
|
|
600
|
+
"IPP": {
|
|
601
|
+
"@size": 1,
|
|
602
|
+
"Set": [
|
|
603
|
+
{
|
|
604
|
+
"@index": 1,
|
|
605
|
+
"TStart": t_start,
|
|
606
|
+
"TEnd": t_end,
|
|
607
|
+
"IPPStart": ipp_start,
|
|
608
|
+
"IPPEnd": ipp_end,
|
|
609
|
+
"IPPPoly": ipp_poly,
|
|
610
|
+
}
|
|
611
|
+
],
|
|
612
|
+
},
|
|
613
|
+
}
|
|
649
614
|
|
|
650
|
-
|
|
651
|
-
sicd.CollectStart(collect_start.isoformat() + "Z"),
|
|
652
|
-
sicd.CollectDuration(str(collect_duration)),
|
|
653
|
-
sicd.IPP(
|
|
654
|
-
{"size": "1"},
|
|
655
|
-
sicd.Set(
|
|
656
|
-
{"index": "1"},
|
|
657
|
-
sicd.TStart(str(t_start)),
|
|
658
|
-
sicd.TEnd(str(t_end)),
|
|
659
|
-
sicd.IPPStart(str(ipp_start)),
|
|
660
|
-
sicd.IPPEnd(str(ipp_end)),
|
|
661
|
-
sicd.IPPPoly(),
|
|
662
|
-
),
|
|
663
|
-
),
|
|
664
|
-
)
|
|
665
|
-
sksicd.PolyType().set_elem(timeline.find("./{*}IPP/{*}Set/{*}IPPPoly"), ipp_poly)
|
|
666
|
-
|
|
667
|
-
position = sicd.Position(sicd.ARPPoly())
|
|
668
|
-
sksicd.XyzPolyType().set_elem(position.find("./{*}ARPPoly"), apc_poly)
|
|
669
|
-
|
|
670
|
-
radar_collection = sicd.RadarCollection(
|
|
671
|
-
sicd.TxFrequency(sicd.Min(str(tx_freq_min)), sicd.Max(str(tx_freq_max))),
|
|
672
|
-
sicd.Waveform(
|
|
673
|
-
{"size": "1"},
|
|
674
|
-
sicd.WFParameters(
|
|
675
|
-
{"index": "1"},
|
|
676
|
-
sicd.TxPulseLength(str(tx_pulse_length)),
|
|
677
|
-
sicd.TxRFBandwidth(str(tx_rf_bw)),
|
|
678
|
-
sicd.TxFreqStart(str(tx_freq_min)),
|
|
679
|
-
sicd.TxFMRate(str(tx_fm_rate)),
|
|
680
|
-
sicd.RcvDemodType(rcv_demod_type),
|
|
681
|
-
sicd.ADCSampleRate(str(adc_sample_rate)),
|
|
682
|
-
sicd.RcvFMRate(str(0)),
|
|
683
|
-
),
|
|
684
|
-
),
|
|
685
|
-
sicd.TxPolarization(tx_polarization),
|
|
686
|
-
sicd.RcvChannels(
|
|
687
|
-
{"size": "1"},
|
|
688
|
-
sicd.ChanParameters(
|
|
689
|
-
{"index": "1"},
|
|
690
|
-
sicd.TxRcvPolarization(tx_rcv_polarization),
|
|
691
|
-
),
|
|
692
|
-
),
|
|
693
|
-
)
|
|
615
|
+
sicd_ew["Position"]["ARPPoly"] = apc_poly
|
|
694
616
|
|
|
617
|
+
sicd_ew["RadarCollection"] = {
|
|
618
|
+
"TxFrequency": {
|
|
619
|
+
"Min": tx_freq_min,
|
|
620
|
+
"Max": tx_freq_max,
|
|
621
|
+
},
|
|
622
|
+
"Waveform": {
|
|
623
|
+
"@size": 1,
|
|
624
|
+
"WFParameters": [
|
|
625
|
+
{
|
|
626
|
+
"@index": 1,
|
|
627
|
+
"TxPulseLength": tx_pulse_length,
|
|
628
|
+
"TxRFBandwidth": tx_rf_bw,
|
|
629
|
+
"TxFreqStart": tx_freq_min,
|
|
630
|
+
"TxFMRate": tx_fm_rate,
|
|
631
|
+
"RcvDemodType": rcv_demod_type,
|
|
632
|
+
"ADCSampleRate": adc_sample_rate,
|
|
633
|
+
"RcvFMRate": 0.0,
|
|
634
|
+
}
|
|
635
|
+
],
|
|
636
|
+
},
|
|
637
|
+
"TxPolarization": tx_polarization,
|
|
638
|
+
"RcvChannels": {
|
|
639
|
+
"@size": 1,
|
|
640
|
+
"ChanParameters": [
|
|
641
|
+
{
|
|
642
|
+
"@index": 1,
|
|
643
|
+
"TxRcvPolarization": tx_rcv_polarization,
|
|
644
|
+
}
|
|
645
|
+
],
|
|
646
|
+
},
|
|
647
|
+
}
|
|
695
648
|
now = (
|
|
696
649
|
datetime.datetime.now(datetime.timezone.utc)
|
|
697
650
|
.isoformat(timespec="microseconds")
|
|
698
651
|
.replace("+00:00", "Z")
|
|
699
652
|
)
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
)
|
|
738
|
-
sksicd.PolyType().set_elem(rma.find("./{*}INCA/{*}TimeCAPoly"), time_ca_poly)
|
|
739
|
-
sksicd.Poly2dType().set_elem(rma.find("./{*}INCA/{*}DRateSFPoly"), dr_sf_poly)
|
|
740
|
-
sksicd.Poly2dType().set_elem(
|
|
741
|
-
rma.find("./{*}INCA/{*}DopCentroidPoly"), dop_centroid_poly
|
|
742
|
-
)
|
|
743
|
-
|
|
744
|
-
sicd_xml_obj = sicd.SICD(
|
|
745
|
-
collection_info,
|
|
746
|
-
image_creation,
|
|
747
|
-
image_data,
|
|
748
|
-
geo_data,
|
|
749
|
-
grid,
|
|
750
|
-
timeline,
|
|
751
|
-
position,
|
|
752
|
-
radar_collection,
|
|
753
|
-
image_formation,
|
|
754
|
-
rma,
|
|
755
|
-
)
|
|
756
|
-
|
|
757
|
-
scp_coa = sksicd.compute_scp_coa(sicd_xml_obj.getroottree())
|
|
758
|
-
sicd_xml_obj = sicd.SICD(
|
|
759
|
-
collection_info,
|
|
760
|
-
image_creation,
|
|
761
|
-
image_data,
|
|
762
|
-
geo_data,
|
|
763
|
-
grid,
|
|
764
|
-
timeline,
|
|
765
|
-
position,
|
|
766
|
-
radar_collection,
|
|
767
|
-
image_formation,
|
|
768
|
-
scp_coa,
|
|
769
|
-
radiometric,
|
|
770
|
-
rma,
|
|
771
|
-
)
|
|
653
|
+
sicd_ew["ImageFormation"] = {
|
|
654
|
+
"RcvChanProc": {
|
|
655
|
+
"NumChanProc": 1,
|
|
656
|
+
"ChanIndex": [1],
|
|
657
|
+
},
|
|
658
|
+
"TxRcvPolarizationProc": tx_rcv_polarization_proc,
|
|
659
|
+
"TStartProc": t_start_proc,
|
|
660
|
+
"TEndProc": t_end_proc,
|
|
661
|
+
"TxFrequencyProc": {
|
|
662
|
+
"MinProc": tx_freq_proc[0],
|
|
663
|
+
"MaxProc": tx_freq_proc[1],
|
|
664
|
+
},
|
|
665
|
+
"ImageFormAlgo": image_form_algo,
|
|
666
|
+
"STBeamComp": st_beam_comp,
|
|
667
|
+
"ImageBeamComp": image_beam_comp,
|
|
668
|
+
"AzAutofocus": az_autofocus,
|
|
669
|
+
"RgAutofocus": rg_autofocus,
|
|
670
|
+
"Processing": [
|
|
671
|
+
{
|
|
672
|
+
"Type": f"sarkit-convert {__version__} @ {now}",
|
|
673
|
+
"Applied": True,
|
|
674
|
+
},
|
|
675
|
+
],
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
sicd_ew["RMA"] = {
|
|
679
|
+
"RMAlgoType": rma_algo_type,
|
|
680
|
+
"ImageType": image_type,
|
|
681
|
+
"INCA": {
|
|
682
|
+
"TimeCAPoly": time_ca_poly,
|
|
683
|
+
"R_CA_SCP": r_ca_scp,
|
|
684
|
+
"FreqZero": freq_zero,
|
|
685
|
+
"DRateSFPoly": dr_sf_poly,
|
|
686
|
+
"DopCentroidPoly": dop_centroid_poly,
|
|
687
|
+
"DopCentroidCOA": dop_centroid_coa,
|
|
688
|
+
},
|
|
689
|
+
}
|
|
772
690
|
|
|
773
|
-
|
|
774
|
-
sicd_xml_obj = sicd.SICD(
|
|
775
|
-
collection_info,
|
|
776
|
-
image_creation,
|
|
777
|
-
image_data,
|
|
778
|
-
geo_data,
|
|
779
|
-
grid,
|
|
780
|
-
timeline,
|
|
781
|
-
position,
|
|
782
|
-
radar_collection,
|
|
783
|
-
image_formation,
|
|
784
|
-
scp_coa,
|
|
785
|
-
new_radiometric,
|
|
786
|
-
rma,
|
|
787
|
-
)
|
|
691
|
+
sicd_ew["SCPCOA"] = sksicd.compute_scp_coa(sicd_xml_obj.getroottree())
|
|
788
692
|
|
|
789
|
-
|
|
693
|
+
sicd_ew["Radiometric"]["BetaZeroSFPoly"] = beta_zero_sf_poly
|
|
694
|
+
_update_radiometric_node(sicd_ew)
|
|
790
695
|
|
|
791
696
|
# Update ImageCorners
|
|
697
|
+
sicd_xmltree = sicd_xml_obj.getroottree()
|
|
792
698
|
image_grid_locations = (
|
|
793
699
|
np.array(
|
|
794
700
|
[[0, 0], [0, num_cols - 1], [num_rows - 1, num_cols - 1], [num_rows - 1, 0]]
|
|
@@ -802,8 +708,7 @@ def hdf5_to_sicd(h5_filename, sicd_filename, classification, ostaid):
|
|
|
802
708
|
sarkit.wgs84.up(sarkit.wgs84.cartesian_to_geodetic(scp_ecf)),
|
|
803
709
|
)
|
|
804
710
|
icp_llh = sarkit.wgs84.cartesian_to_geodetic(icp_ecef)
|
|
805
|
-
|
|
806
|
-
xml_helper.set("./{*}GeoData/{*}ImageCorners", icp_llh[:, :2])
|
|
711
|
+
sicd_ew["GeoData"]["ImageCorners"] = icp_llh[:, :2]
|
|
807
712
|
|
|
808
713
|
# Check for XML consistency
|
|
809
714
|
sicd_con = SicdConsistency(sicd_xmltree)
|