@@ -59,7 +59,7 @@ static void writeArray(isce3::io::Raster* raster,
59
59
}
60
60
}
61
61
62
- static inline void writeVectorDerivedCubes (const int array_pos_i,
62
+ inline void writeVectorDerivedCubes (const int array_pos_i,
63
63
const int array_pos_j, const double native_azimuth_time,
64
64
const isce3::core::Vec3& target_llh,
65
65
const isce3::core::Vec3& target_proj, const isce3::core::Orbit& orbit,
@@ -76,7 +76,9 @@ static inline void writeVectorDerivedCubes(const int array_pos_i,
76
76
isce3::io::Raster* along_track_unit_vector_y_raster,
77
77
isce3::core::Matrix<float >& along_track_unit_vector_y_array,
78
78
isce3::io::Raster* elevation_angle_raster,
79
- isce3::core::Matrix<float >& elevation_angle_array)
79
+ isce3::core::Matrix<float >& elevation_angle_array,
80
+ isce3::io::Raster* ground_track_velocity_raster,
81
+ isce3::core::Matrix<double >& ground_track_velocity_array)
80
82
{
81
83
82
84
const int i = array_pos_i;
@@ -99,6 +101,13 @@ static inline void writeVectorDerivedCubes(const int array_pos_i,
99
101
// Get target position in ECEF (target_xyz)
100
102
const isce3::core::Vec3 target_xyz = ellipsoid.lonLatToXyz (target_llh);
101
103
104
+ // Ground-track velocity
105
+ if (ground_track_velocity_raster != nullptr ) {
106
+ const double ground_velocity =
107
+ target_xyz.norm () * vel_xyz.norm () / sat_xyz.norm ();
108
+ ground_track_velocity_array (i, j) = ground_velocity;
109
+ }
110
+
102
111
// Create target-to-sat vector in ECEF
103
112
const isce3::core::Vec3 look_vector_xyz =
104
113
(sat_xyz - target_xyz).normalized ();
@@ -270,6 +279,7 @@ void makeRadarGridCubes(const isce3::product::RadarGridParameters& radar_grid,
270
279
isce3::io::Raster* along_track_unit_vector_x_raster,
271
280
isce3::io::Raster* along_track_unit_vector_y_raster,
272
281
isce3::io::Raster* elevation_angle_raster,
282
+ isce3::io::Raster* ground_track_velocity_raster,
273
283
const double threshold_geo2rdr, const int numiter_geo2rdr,
274
284
const double delta_range)
275
285
{
@@ -311,6 +321,8 @@ void makeRadarGridCubes(const isce3::product::RadarGridParameters& radar_grid,
311
321
getNanArray<float >(along_track_unit_vector_y_raster, geogrid);
312
322
auto elevation_angle_array =
313
323
getNanArray<float >(elevation_angle_raster, geogrid);
324
+ auto ground_track_velocity_array =
325
+ getNanArray<double >(ground_track_velocity_raster, geogrid);
314
326
315
327
double azimuth_time = radar_grid.sensingMid ();
316
328
double native_azimuth_time = radar_grid.sensingMid ();
@@ -360,7 +372,8 @@ void makeRadarGridCubes(const isce3::product::RadarGridParameters& radar_grid,
360
372
los_unit_vector_y_raster == nullptr &&
361
373
along_track_unit_vector_x_raster == nullptr &&
362
374
along_track_unit_vector_y_raster == nullptr &&
363
- elevation_angle_raster == nullptr ) {
375
+ elevation_angle_raster == nullptr &&
376
+ ground_track_velocity_raster == nullptr ) {
364
377
continue ;
365
378
}
366
379
@@ -390,8 +403,11 @@ void makeRadarGridCubes(const isce3::product::RadarGridParameters& radar_grid,
390
403
along_track_unit_vector_x_raster,
391
404
along_track_unit_vector_x_array,
392
405
along_track_unit_vector_y_raster,
393
- along_track_unit_vector_y_array, elevation_angle_raster,
394
- elevation_angle_array);
406
+ along_track_unit_vector_y_array,
407
+ elevation_angle_raster,
408
+ elevation_angle_array,
409
+ ground_track_velocity_raster,
410
+ ground_track_velocity_array);
395
411
}
396
412
}
397
413
@@ -407,6 +423,8 @@ void makeRadarGridCubes(const isce3::product::RadarGridParameters& radar_grid,
407
423
writeArray (along_track_unit_vector_y_raster,
408
424
along_track_unit_vector_y_array, height_count);
409
425
writeArray (elevation_angle_raster, elevation_angle_array, height_count);
426
+ writeArray (ground_track_velocity_raster, ground_track_velocity_array,
427
+ height_count);
410
428
}
411
429
412
430
double geotransform[] = {
@@ -445,6 +463,10 @@ void makeRadarGridCubes(const isce3::product::RadarGridParameters& radar_grid,
445
463
elevation_angle_raster->setGeoTransform (geotransform);
446
464
elevation_angle_raster->setEPSG (geogrid.epsg ());
447
465
}
466
+ if (ground_track_velocity_raster != nullptr ) {
467
+ ground_track_velocity_raster->setGeoTransform (geotransform);
468
+ ground_track_velocity_raster->setEPSG (geogrid.epsg ());
469
+ }
448
470
}
449
471
450
472
void makeGeolocationGridCubes (
@@ -461,6 +483,7 @@ void makeGeolocationGridCubes(
461
483
isce3::io::Raster* along_track_unit_vector_x_raster,
462
484
isce3::io::Raster* along_track_unit_vector_y_raster,
463
485
isce3::io::Raster* elevation_angle_raster,
486
+ isce3::io::Raster* ground_track_velocity_raster,
464
487
const double threshold_geo2rdr, const int numiter_geo2rdr,
465
488
const double delta_range)
466
489
{
@@ -501,6 +524,8 @@ void makeGeolocationGridCubes(
501
524
getNanArrayRadarGrid<float >(along_track_unit_vector_y_raster, radar_grid);
502
525
auto elevation_angle_array =
503
526
getNanArrayRadarGrid<float >(elevation_angle_raster, radar_grid);
527
+ auto ground_track_velocity_array =
528
+ getNanArrayRadarGrid<double >(ground_track_velocity_raster, radar_grid);
504
529
505
530
auto height = heights[height_count];
506
531
double native_azimuth_time = radar_grid.sensingMid ();
@@ -550,7 +575,8 @@ void makeGeolocationGridCubes(
550
575
los_unit_vector_y_raster == nullptr &&
551
576
along_track_unit_vector_x_raster == nullptr &&
552
577
along_track_unit_vector_y_raster == nullptr &&
553
- elevation_angle_raster == nullptr ) {
578
+ elevation_angle_raster == nullptr &&
579
+ ground_track_velocity_raster == nullptr ) {
554
580
continue ;
555
581
}
556
582
@@ -579,8 +605,11 @@ void makeGeolocationGridCubes(
579
605
along_track_unit_vector_x_raster,
580
606
along_track_unit_vector_x_array,
581
607
along_track_unit_vector_y_raster,
582
- along_track_unit_vector_y_array, elevation_angle_raster,
583
- elevation_angle_array);
608
+ along_track_unit_vector_y_array,
609
+ elevation_angle_raster,
610
+ elevation_angle_array,
611
+ ground_track_velocity_raster,
612
+ ground_track_velocity_array);
584
613
}
585
614
}
586
615
writeArray (coordinate_x_raster, coordinate_x_array, height_count);
@@ -595,6 +624,8 @@ void makeGeolocationGridCubes(
595
624
writeArray (along_track_unit_vector_y_raster,
596
625
along_track_unit_vector_y_array, height_count);
597
626
writeArray (elevation_angle_raster, elevation_angle_array, height_count);
627
+ writeArray (ground_track_velocity_raster, ground_track_velocity_array,
628
+ height_count);
598
629
}
599
630
}
600
631
}
0 commit comments