sarkit-convert 0.2.0__py3-none-any.whl → 0.3.0__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/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.builder
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(sicd_xmltree):
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(xmlhelp):
118
- row_imp_resp_bw = xmlhelp.load("./{*}Grid/{*}Row/{*}ImpRespBW")
119
- col_imp_resp_bw = xmlhelp.load("./{*}Grid/{*}Col/{*}ImpRespBW")
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 = xmlhelp.load("./{*}Grid/{*}Row/{*}WgtFunct")
122
- if row_wgt_funct is not None:
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 = xmlhelp.load("./{*}Grid/{*}Col/{*}WgtFunct")
127
- if col_wgt_funct is not None:
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(xmlhelp)
134
- radiometric_node = xmlhelp.element_tree.find("./{*}Radiometric")
135
- scpcoa_slope_ang = xmlhelp.load("./{*}SCPCOA/{*}SlopeAng")
136
- scpcoa_graze_ang = xmlhelp.load("./{*}SCPCOA/{*}GrazeAng")
137
- if radiometric_node.find("{*}BetaZeroSFPoly") is None:
138
- if radiometric_node.find("{*}RCSSFPoly") is not None:
139
- beta_zero_sf_poly_coefs = (
140
- xmlhelp.load_elem(radiometric_node.find("{*}RCSSFPoly")) / sp_area
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 radiometric_node.find("{*}SigmaZeroSFPoly") is not None:
143
- beta_zero_sf_poly_coefs = xmlhelp.load_elem(
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
- # In other words, none of the SF polynomials are populated.
160
- if radiometric_node.find("{*}RCSSFPoly") is None:
161
- rcs_sf_poly_coefs = beta_zero_sf_poly_coefs * sp_area
162
- if radiometric_node.find("{*}SigmaZeroSFPoly") is None:
163
- sigma_zero_sf_poly_coefs = beta_zero_sf_poly_coefs * np.cos(
164
- np.deg2rad(scpcoa_slope_ang)
165
- )
166
- if radiometric_node.find("{*}GammaZeroSFPoly") is None:
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
- sicd = lxml.builder.ElementMaker(
561
- namespace=NSMAP["sicd"], nsmap={None: NSMAP["sicd"]}
562
- )
563
- collection_info = sicd.CollectionInfo(
564
- sicd.CollectorName(collector_name),
565
- sicd.CoreName(core_name),
566
- sicd.CollectType(collect_type),
567
- sicd.RadarMode(sicd.ModeType(mode_type), sicd.ModeID(mode_id)),
568
- sicd.Classification(classification),
569
- )
570
- image_creation = sicd.ImageCreation(
571
- sicd.Application(creation_application),
572
- sicd.DateTime(creation_date_time.isoformat() + "Z"),
573
- )
574
- image_data = sicd.ImageData(
575
- sicd.PixelType(pixel_type),
576
- sicd.NumRows(str(num_rows)),
577
- sicd.NumCols(str(num_cols)),
578
- sicd.FirstRow(str(first_row)),
579
- sicd.FirstCol(str(first_col)),
580
- sicd.FullImage(sicd.NumRows(str(num_rows)), sicd.NumCols(str(num_cols))),
581
- sicd.SCPPixel(sicd.Row(str(scp_pixel[0])), sicd.Col(str(scp_pixel[1]))),
582
- )
583
-
584
- def make_xyz(arr):
585
- return [sicd.X(str(arr[0])), sicd.Y(str(arr[1])), sicd.Z(str(arr[2]))]
586
-
587
- def make_llh(arr):
588
- return [sicd.Lat(str(arr[0])), sicd.Lon(str(arr[1])), sicd.HAE(str(arr[2]))]
589
-
590
- def make_ll(arr):
591
- return [sicd.Lat(str(arr[0])), sicd.Lon(str(arr[1]))]
592
-
593
- # Add GeoData with placeholder corners
594
- geo_data = sicd.GeoData(
595
- sicd.EarthModel("WGS_84"),
596
- sicd.SCP(sicd.ECF(*make_xyz(scp_ecf)), sicd.LLH(*make_llh(scp_llh))),
597
- sicd.ImageCorners(
598
- sicd.ICP({"index": "1:FRFC"}, *make_ll([0, 0])),
599
- sicd.ICP({"index": "2:FRLC"}, *make_ll([0, 0])),
600
- sicd.ICP({"index": "3:LRLC"}, *make_ll([0, 0])),
601
- sicd.ICP({"index": "4:LRFC"}, *make_ll([0, 0])),
602
- ),
603
- )
604
-
605
- grid = sicd.Grid(
606
- sicd.ImagePlane(image_plane),
607
- sicd.Type(grid_type),
608
- sicd.TimeCOAPoly(),
609
- sicd.Row(
610
- sicd.UVectECF(*make_xyz(row_uvect_ecf)),
611
- sicd.SS(str(row_ss)),
612
- sicd.ImpRespWid(str(row_imp_res_wid)),
613
- sicd.Sgn(str(row_sgn)),
614
- sicd.ImpRespBW(str(row_imp_res_bw)),
615
- sicd.KCtr(str(row_kctr)),
616
- sicd.DeltaK1(str(row_delta_k1)),
617
- sicd.DeltaK2(str(row_delta_k2)),
618
- sicd.DeltaKCOAPoly(),
619
- sicd.WgtType(
620
- sicd.WindowName(
621
- str(row_win),
622
- )
623
- ),
624
- ),
625
- sicd.Col(
626
- sicd.UVectECF(*make_xyz(col_uvect_ecf)),
627
- sicd.SS(str(col_ss)),
628
- sicd.ImpRespWid(str(col_imp_res_wid)),
629
- sicd.Sgn(str(col_sgn)),
630
- sicd.ImpRespBW(str(col_imp_res_bw)),
631
- sicd.KCtr(str(col_kctr)),
632
- sicd.DeltaK1(str(col_delta_k1)),
633
- sicd.DeltaK2(str(col_delta_k2)),
634
- sicd.DeltaKCOAPoly(),
635
- sicd.WgtType(
636
- sicd.WindowName(
637
- str(col_win),
638
- )
639
- ),
640
- ),
641
- )
642
- sksicd.Poly2dType().set_elem(grid.find("./{*}TimeCOAPoly"), time_coa_poly)
643
- sksicd.Poly2dType().set_elem(
644
- grid.find("./{*}Row/{*}DeltaKCOAPoly"), row_deltak_coa_poly
645
- )
646
- sksicd.Poly2dType().set_elem(
647
- grid.find("./{*}Col/{*}DeltaKCOAPoly"), col_deltak_coa_poly
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
- timeline = sicd.Timeline(
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
- image_formation = sicd.ImageFormation(
701
- sicd.RcvChanProc(sicd.NumChanProc("1"), sicd.ChanIndex("1")),
702
- sicd.TxRcvPolarizationProc(tx_rcv_polarization_proc),
703
- sicd.TStartProc(str(t_start_proc)),
704
- sicd.TEndProc(str(t_end_proc)),
705
- sicd.TxFrequencyProc(
706
- sicd.MinProc(str(tx_freq_proc[0])), sicd.MaxProc(str(tx_freq_proc[1]))
707
- ),
708
- sicd.ImageFormAlgo(image_form_algo),
709
- sicd.STBeamComp(st_beam_comp),
710
- sicd.ImageBeamComp(image_beam_comp),
711
- sicd.AzAutofocus(az_autofocus),
712
- sicd.RgAutofocus(rg_autofocus),
713
- sicd.Processing(
714
- sicd.Type(f"sarkit-convert {__version__} @ {now}"),
715
- sicd.Applied("true"),
716
- ),
717
- )
718
-
719
- radiometric = sicd.Radiometric(
720
- sicd.BetaZeroSFPoly(),
721
- )
722
- sksicd.Poly2dType().set_elem(
723
- radiometric.find("./{*}BetaZeroSFPoly"), beta_zero_sf_poly
724
- )
725
-
726
- rma = sicd.RMA(
727
- sicd.RMAlgoType(rma_algo_type),
728
- sicd.ImageType(image_type),
729
- sicd.INCA(
730
- sicd.TimeCAPoly(),
731
- sicd.R_CA_SCP(str(r_ca_scp)),
732
- sicd.FreqZero(str(freq_zero)),
733
- sicd.DRateSFPoly(),
734
- sicd.DopCentroidPoly(),
735
- sicd.DopCentroidCOA(dop_centroid_coa),
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
- new_radiometric = _update_radiometric_node(sicd_xml_obj.getroottree())
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
- sicd_xmltree = sicd_xml_obj.getroottree()
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
- xml_helper = sksicd.XmlHelper(sicd_xmltree)
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)