Skip to content

Commit

Permalink
Add changes from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Oct 1, 2022
1 parent a7553ae commit 09f3723
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 46 deletions.
11 changes: 7 additions & 4 deletions gmtsar/csh/correct_insar_with_gnss.csh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ errormessage:
# now blockmedian and surface the data at this resolution
#
gmt blockmedian ins-gps_diff.rad -Rtmp.grd > tmp.rad
gmt surface tmp.rad -Rtmp.grd -Gtmp1.grd
gmt surface tmp.rad -Rtmp.grd -T0.1 -Gtmp1.grd
#
# ----------------------
# FILTER THE CORRECTION GRID
Expand All @@ -112,10 +112,13 @@ errormessage:
#
gmt grdfilter tmp1.grd -Dp -Fg17 -Gtmp2.grd
#
# upsample to the original size
# upsample to the original size using gmt surface
# gmt grd2xyz tmp2.grd | gmt surface -R$insar -T0.1 -Gcorrection.grd
#
gmt grdsample tmp2.grd -Gtmp3.grd
gmt grd2xyz tmp3.grd | gmt surface -R$insar -T0.5 -Gcorrection.grd
# upsample to original grid size using grdsample instead
echo "...using grdsample to upsample the correction grid..."
set incre = ` gmt grdinfo -Cn $insar | awk '{printf "%d+n/%d+n \n",$9,$10}' `
gmt grdsample tmp2.grd -I$incre -Gcorrection.grd
#
# ----------------------
# PERFORM THE CORRECTION
Expand Down
2 changes: 1 addition & 1 deletion gmtsar/csh/dem2topo_ra.csh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ endif
# plotting
#
gmt grd2cpt topo_ra.grd -Cgray $V -Z > topo_ra.cpt
gmt grdimage topo_ra.grd $scale -P -Ctopo_ra.cpt -Bxaf+lRange -Byaf+lAzimuth -BWSen $V -K > topo_ra.ps
gmt grdimage topo_ra.grd $scale -P -Ctopo_ra.cpt -Bxaf+lRange -Byaf+l"Reversed Azimuth" -BWSen $V -K > topo_ra.ps
gmt psscale -Rtopo_ra.grd -J -DJTC+w5i/0.2i+h -Ctopo_ra.cpt -Bxaf -By+lm -O >> topo_ra.ps
gmt psconvert -Tf -P -A -Z topo_ra.ps
echo "Topo range/azimuth map: topo_ra.pdf"
Expand Down
2 changes: 1 addition & 1 deletion gmtsar/csh/extract_one_time_series.csh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ set ii = 1

while ($ii <= $N)
#set name = `echo $ii | awk '{printf("disp_%.3d.grd",$1)}'`
set name = `awk 'NR=='$ii'{print $1}' scene.tab | awk '{printf("disp_%d.grd",$1)}'`
set name = `awk 'NR=='$ii'{print $1}' $5 | awk '{printf("disp_%d.grd",$1)}'`
echo "Working on date $name"
gmt grdcut $name -Gtmp_cut.grd -R$RR
gmt grdinfo tmp_cut.grd -L2 -C | awk '{print $12,$13}' >> $output
Expand Down
2 changes: 1 addition & 1 deletion gmtsar/csh/preproc_batch_tops.csh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
echo " s1a-iw1-slc-vv-20150715...001:s1a-iw1-slc-vv-20150715...001:s1a-iw1-slc-vv-20150715...001:S1A_OPER_AUX_POEORB_V20150625_20150627.EOF"
echo ""
echo " outputs:"
echo " baseline.ps align_table.ra (contains info for precise geomatric alignment)"
echo " baseline.ps (mode 1)"
echo " *.PRM *.LED *.SLC(mode 2)"
echo ""
echo " Note:"
Expand Down
2 changes: 1 addition & 1 deletion gmtsar/csh/preproc_batch_tops_esd.csh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
echo " s1a-iw1-slc-vv-20150715...001:s1a-iw1-slc-vv-20150715...001:s1a-iw1-slc-vv-20150715...001:S1A_OPER_AUX_POEORB_V20150625_20150627.EOF"
echo ""
echo " outputs:"
echo " baseline.ps align_table.ra (contains info for precise geomatric alignment)"
echo " baseline.ps (mode 1)"
echo " *.PRM *.LED *.SLC(mode 2)"
echo ""
echo " esd_mode:"
Expand Down
23 changes: 15 additions & 8 deletions gmtsar/csh/proj_ra2ll.csh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ endif
#
# check for number of arguments
#
if ($#argv < 3) then
if ($#argv != 3 && $#argv != 4) then
echo " "
echo "Usage: proj_ra2ll.csh trans.dat phase.grd phase_ll.grd"
echo "Usage: proj_ra2ll.csh trans.dat phase.grd phase_ll.grd [filter_wavelength]"
echo " trans.dat - file generated by llt_grid2rat (r a topo lon lat)"
echo " phase_ra.grd - a GRD file of phase or anything"
echo " phase_ll.grd - output file in lon/lat-coordinates"
echo " filter_wavelength - will sample every 1/4 wavelength (in meters) "
echo " "
exit 1
endif
Expand All @@ -53,13 +54,19 @@ gmt grdtrack rap -nl -bi3f -bo5f -Graln.grd -Gralt.grd | gmt gmtconvert -bi5f -b
#
# set the output grid spaccing to be 1/4 the filter wavelength
#
set filt = `ls gauss_*`
if ( $filt != "" ) then
set pix_m = `ls gauss_* | awk -F_ '{print $2/4}'` # Use 1/4 the filter width
echo "Sampling in geocoordinates with $pix_m meter pixels ..."
if ($#argv == 4) then
set filt_wave = $4
set pix_m = `echo $filt_wave | awk '{print $1/4}'`
echo "Sampling in geocoordinates with $pix_m meter pixels ..."
else
set pix_m = 60
echo "Sampling in geocoordinates with deault ($pix_m meter) pixel size ..."
set filt = `ls gauss_*`
if ( $filt != "" ) then
set pix_m = `ls gauss_* | awk -F_ '{print $2/4}'` # Use 1/4 the filter width
echo "Sampling in geocoordinates with $pix_m meter pixels ..."
else
set pix_m = 60
echo "Sampling in geocoordinates with deault ($pix_m meter) pixel size ..."
endif
endif

set incs = `m2s.csh $pix_m llp` # Get fine and crude grid interval for lookup grids
Expand Down
2 changes: 1 addition & 1 deletion gmtsar/make_gaussian_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int main(int argc, char **argv) {
double azi_px_size, rng_px_size, x, y;
double c_speed = 299792458.0;
double sig_azi, sig_rng, a, rng, cost, cosa;
double g[50][50];
double g[1024][1024];
char out_name[128] = "gauss_";

if (argc < 4)
Expand Down
21 changes: 12 additions & 9 deletions gmtsar/sbas.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ char *USAGE = "USAGE: sbas intf.tab scene.tab N S xdim ydim [-atm ni] [-smooth s
"the interferogram (m) default=866000 \n"
" -rms -- output velocity uncertainty grids (mm/yr): "
"rms.grd\n"
" -dem -- output DEM error (m): dem.grd \n"
" -mmap -- use mmap to allocate disk space for less use of memory \n\n"
" -dem -- output DEM error (m): dem_err.grd \n"
" -mmap -- use mmap to allocate disk space for less use of memory \n"
" -robust -- only work with -atm turnned on, estimate velocity with records that has atm correction\n\n"
" output: \n"
" disp_##.grd -- cumulative displacement time series (mm) "
"grids\n"
Expand Down Expand Up @@ -130,8 +131,9 @@ int main(int argc, char **argv) {
char **gfile = NULL, **cfile = NULL;
int64_t i, j, m, n, nrhs = 1, xdim, lwork, ydim, k1, k2;
int64_t N, S;
int64_t ldb, lda, *flag = NULL, *jpvt = NULL, *H = NULL, *L = NULL, *hit = NULL, *mark = NULL;
int64_t flag_rms = 0, flag_dem = 0, flag_mmap = 0;
//int64_t ldb, lda, *flag = NULL, *jpvt = NULL, *H = NULL, *L = NULL, *hit = NULL, *mark = NULL;
int64_t ldb, *flag = NULL, *jpvt = NULL, *H = NULL, *L = NULL, *hit = NULL, *mark = NULL;
int64_t flag_rms = 0, flag_dem = 0, flag_mmap = 0, flag_robust = 0;
float *phi = NULL, *tmp_phi = NULL, sf, *disp = NULL, *res = NULL, *dem = NULL, *bperp = NULL, *vel = NULL, *screen = NULL,
*tmp_screen = NULL;
float *var = NULL;
Expand Down Expand Up @@ -178,14 +180,14 @@ int main(int argc, char **argv) {
fprintf(stderr, "\n");

/* read in the parameters from command line */
parse_command_ts(argc, argv, &sf, &wl, &theta, &rng, &flag_rms, &flag_dem, &n_atm, &flag_mmap);
parse_command_ts(argc, argv, &sf, &wl, &theta, &rng, &flag_rms, &flag_dem, &n_atm, &flag_mmap, &flag_robust);

/* setting up some parameters */
scale = 4.0 * M_PI / wl / rng / sin(theta / 180.0 * M_PI);
m = N + S - 2; // number of rows in the G matrix
n = S; // number of columns in the G matrix
lwork = max(1, m * n + max(m * n, nrhs) * 16);
lda = max(1, m);
//lda = max(1, m);
ldb = max(1, max(m, n));

/* memory allocation */ // also malloc for atm(nx,ny,S), hit(N,S), sum_vec(N)
Expand Down Expand Up @@ -222,6 +224,7 @@ int main(int argc, char **argv) {
printf("%.6f %.6f %.6f %.6f\n", sf, scale, time[0], bperp[0]);

if (n_atm == 0) {
flag_robust = 0;
atm_rms = (double *)malloc(S * sizeof(double));
for (i = 0; i < S; i++)
atm_rms[i] = 0.0;
Expand All @@ -232,7 +235,7 @@ int main(int argc, char **argv) {
for (i = 0; i < xdim * ydim * S; i++)
disp[i] = 0.0;
lsqlin_sov_ts(xdim, ydim, disp, vel, flag, d, ds, time, G, Gs, A, var, phi, N, S, m, n, work, lwork, flag_dem, dem,
flag_rms, res, jpvt, wl, atm_rms);
flag_rms, res, jpvt, wl, atm_rms, flag_robust);
}
else {
fprintf(stderr, "\n\nApplying atmospheric correction by common point stacking...\n\n");
Expand Down Expand Up @@ -333,7 +336,7 @@ int main(int argc, char **argv) {

fprintf(stderr, "Computing deformation time-series...\n");
lsqlin_sov_ts(xdim, ydim, disp, vel, flag, d, ds, time, G, Gs, A, var, tmp_phi, N, S, m, n, work, lwork, flag_dem,
dem, flag_rms, res, jpvt, wl, atm_rms);
dem, flag_rms, res, jpvt, wl, atm_rms, flag_robust);
// remove the very smooth deformation signal from the data
if (kk > 1)
for (i = 0; i < xdim * ydim * N; i++)
Expand Down Expand Up @@ -401,7 +404,7 @@ int main(int argc, char **argv) {
for (i = 0; i < xdim * ydim * S; i++)
disp[i] = 0.0;
lsqlin_sov_ts(xdim, ydim, disp, vel, flag, d, ds, time, G, Gs, A, var, tmp_phi, N, S, m, n, work, lwork, flag_dem, dem,
flag_rms, res, jpvt, wl, atm_rms);
flag_rms, res, jpvt, wl, atm_rms, flag_robust);
}

// write output
Expand Down
4 changes: 2 additions & 2 deletions gmtsar/sbas.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include<stdio.h>
#include"gmt.h"

int parse_command_ts(int64_t, char **, float *, double *, double *, double *, int64_t *, int64_t *, int64_t *, int64_t *);
int parse_command_ts(int64_t, char **, float *, double *, double *, double *, int64_t *, int64_t *, int64_t *, int64_t *, int64_t *);
int allocate_memory_ts(int64_t **, double **, double **, double **, float **, char ***, char ***, int64_t **, double **,
int64_t **, double **, double **, double **, int64_t **, float **, float **, float **, float **, float **,
float **, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t **, int64_t, int64_t);
Expand All @@ -15,7 +15,7 @@ int read_table_data_ts(void *, FILE *, FILE *, char **, char **, int64_t *, floa
int init_G_ts(double *, double *, int64_t, int64_t, int64_t, int64_t, int64_t *, int64_t *, double *, float, float *, double);
int lsqlin_sov_ts(int64_t, int64_t, float *, float *, int64_t *, double *, double *, double *, double *, double *, double *,
float *, float *, int64_t, int64_t, int64_t, int64_t, double *, int64_t, int64_t, float *, int64_t, float *,
int64_t *, double, double *);
int64_t *, double, double *, int64_t);
int write_output_ts(void *, struct GMT_GRID *, int64_t, char **, int64_t, int64_t, int64_t, int64_t, int64_t, float *, float *,
float *, float *, float *, double, int64_t, int64_t *);
int free_memory_ts(int64_t, float *, float *, char **, char **, float *, double *, double *, double *, int64_t *, double *,
Expand Down
28 changes: 17 additions & 11 deletions gmtsar/sbas_parallel.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ char *USAGE = "USAGE: sbas_parallel intf.tab scene.tab N S xdim ydim [-atm ni] [
"the interferogram (m) default=866000 \n"
" -rms -- output velocity uncertainty grids (mm/yr): "
"rms.grd\n"
" -dem -- output DEM error (m): dem.grd \n"
" -mmap -- use mmap to allocate disk space for less use of memory \n\n"
" -dem -- output DEM error (m): dem_err.grd \n"
" -mmap -- use mmap to allocate disk space for less use of memory \n"
" -robust -- only work with -atm turnned on, estimate velocity with records that has atm correction\n\n"
" output: \n"
" disp_##.grd -- cumulative displacement time series (mm) "
"grids\n"
Expand Down Expand Up @@ -132,7 +133,7 @@ void dgelsy_(const int64_t *m, const int64_t *n, const int64_t *nrhs, double *G,
const int64_t *info);

int parse_command_ts(int64_t agc, char **agv, float *sf, double *wl, double *theta, double *rng, int64_t *flag_rms,
int64_t *flag_dem, int64_t *atm, int64_t *flag_mmap) {
int64_t *flag_dem, int64_t *atm, int64_t *flag_mmap, int64_t *flag_robust) {

int64_t i;

Expand Down Expand Up @@ -173,6 +174,10 @@ int parse_command_ts(int64_t agc, char **agv, float *sf, double *wl, double *the
*flag_mmap = 1;
fprintf(stderr, "mmap disk space for less use of memory\n");
}
else if (!strcmp(agv[i], "-robust")) {
*flag_robust = 1;
fprintf(stderr, "using robust velocity estimate (require -atm)\n");
}
else if (!strcmp(agv[i], "-atm")) {
i++;
if (i == agc)
Expand Down Expand Up @@ -418,7 +423,7 @@ int init_G_ts(double *G, double *Gs, int64_t N, int64_t S, int64_t m, int64_t n,
int64_t lsqlin_sov_ts(int64_t xdim, int64_t ydim, float *disp, float *vel, int64_t *flag, double *d, double *ds, double *time,
double *G, double *Gs, double *A, float *var, float *phi, int64_t N, int64_t S, int64_t m, int64_t n,
double *work, int64_t lwork, int64_t flag_dem, float *dem, int64_t flag_rms, float *res, int64_t *jpvt,
double wl, double *atm_rms) {
double wl, double *atm_rms, int64_t flag_robust) {

// float new,old;
int64_t lda, ldb, zz;
Expand Down Expand Up @@ -548,7 +553,7 @@ int64_t lsqlin_sov_ts(int64_t xdim, int64_t ydim, float *disp, float *vel, int64
sumx = 0;
sumy = 0;
sumyy = 0;
if (count > 2) {
if (count > 2 && flag_robust == 1) {
for (i = 2; i < S - 2; i++) {
if (atm_rms[i] != 0.0) {
sumxy = sumxy + time[i] * disp[i * xdim * ydim + j * ydim + k];
Expand Down Expand Up @@ -675,7 +680,7 @@ int write_output_ts(void *API, struct GMT_GRID *Out, int64_t agc, char **agv, in

if (flag_dem == 1) {
Out->data = dem;
sprintf(outfile, "dem.grd");
sprintf(outfile, "dem_err.grd");
strcpy(Out->header->title, "");
strcpy(Out->header->remark, "");
if (GMT_Set_Comment(API, GMT_IS_GRID, GMT_COMMENT_IS_REMARK, "DEM error estimated from SBAS (m)", Out))
Expand Down Expand Up @@ -1005,7 +1010,7 @@ int main(int argc, char **argv) {
int64_t i, j, m, n, nrhs = 1, xdim, lwork, ydim, k1, k2;
int64_t N, S;
int64_t ldb, lda, *flag = NULL, *jpvt = NULL, *H = NULL, *L = NULL, *hit = NULL, *mark = NULL;
int64_t flag_rms = 0, flag_dem = 0, flag_mmap = 0;
int64_t flag_rms = 0, flag_dem = 0, flag_mmap = 0, flag_robust = 0;
float *phi = NULL, *tmp_phi = NULL, sf, *disp = NULL, *res = NULL, *dem = NULL, *bperp = NULL, *vel = NULL, *screen = NULL,
*tmp_screen = NULL;
float *var = NULL;
Expand Down Expand Up @@ -1071,7 +1076,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "\n");

/* read in the parameters from command line */
parse_command_ts(argc, argv, &sf, &wl, &theta, &rng, &flag_rms, &flag_dem, &n_atm, &flag_mmap);
parse_command_ts(argc, argv, &sf, &wl, &theta, &rng, &flag_rms, &flag_dem, &n_atm, &flag_mmap, &flag_robust);

/* setting up some parameters */
scale = 4.0 * M_PI / wl / rng / sin(theta / 180.0 * M_PI);
Expand Down Expand Up @@ -1126,6 +1131,7 @@ int main(int argc, char **argv) {
printf("%.6f %.6f %.6f %.6f\n", sf, scale, time[0], bperp[0]);

if (n_atm == 0) {
flag_robust = 0;
atm_rms = (double *)malloc(S * sizeof(double));
for (i = 0; i < S; i++)
atm_rms[i] = 0.0;
Expand All @@ -1136,7 +1142,7 @@ int main(int argc, char **argv) {
for (i = 0; i < xdim * ydim * S; i++)
disp[i] = 0.0;
lsqlin_sov_ts(xdim, ydim, disp, vel, flag, d, ds, time, G, Gs, A, var, phi, N, S, m, n, work, lwork, flag_dem, dem,
flag_rms, res, jpvt, wl, atm_rms);
flag_rms, res, jpvt, wl, atm_rms, flag_robust);
}
else {
fprintf(stderr, "\n\nApplying atmospheric correction by common point stacking...\n\n");
Expand Down Expand Up @@ -1238,7 +1244,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "Computing deformation time-series...\n");
// progam below is paralleled
lsqlin_sov_ts(xdim, ydim, disp, vel, flag, d, ds, time, G, Gs, A, var, tmp_phi, N, S, m, n, work, lwork, flag_dem,
dem, flag_rms, res, jpvt, wl, atm_rms);
dem, flag_rms, res, jpvt, wl, atm_rms, flag_robust);
// remove the very smooth deformation signal from the data
if (kk > 1)
for (i = 0; i < xdim * ydim * N; i++)
Expand Down Expand Up @@ -1307,7 +1313,7 @@ int main(int argc, char **argv) {
for (i = 0; i < xdim * ydim * S; i++)
disp[i] = 0.0;
lsqlin_sov_ts(xdim, ydim, disp, vel, flag, d, ds, time, G, Gs, A, var, tmp_phi, N, S, m, n, work, lwork, flag_dem, dem,
flag_rms, res, jpvt, wl, atm_rms);
flag_rms, res, jpvt, wl, atm_rms, flag_robust);
}

// write output
Expand Down
15 changes: 10 additions & 5 deletions gmtsar/sbas_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ char *sbas_USAGE = " \n\nUSAGE: sbas intf.tab scene.tab N S xdim ydim [-atm ni]
"-range rng -- range distance from the radar to the center of the "
"interferogram (m) default=866000 \n"
"-rms -- output RMS of the data misfit grids (mm): rms.grd\n"
"-dem -- output DEM error (m): dem.grd \n\n"
"-dem -- output DEM error (m): dem_err.grd \n"
"-robust -- only work with -atm turnned on, estimate velocity with records that has atm correction\n\n"
" output: \n"
"disp_##.grd -- cumulative displacement time series (mm) grids\n"
"vel.grd -- mean velocity (mm/yr) grids \n\n"
Expand All @@ -87,7 +88,7 @@ void dgelsy_(const int64_t *m, const int64_t *n, const int64_t *nrhs, double *G,
const int64_t *info);

int parse_command_ts(int64_t agc, char **agv, float *sf, double *wl, double *theta, double *rng, int64_t *flag_rms,
int64_t *flag_dem, int64_t *atm, int64_t *flag_mmap) {
int64_t *flag_dem, int64_t *atm, int64_t *flag_mmap, int64_t *flag_robust) {

int64_t i;

Expand Down Expand Up @@ -127,6 +128,10 @@ int parse_command_ts(int64_t agc, char **agv, float *sf, double *wl, double *the
else if (!strcmp(agv[i], "-mmap")) {
*flag_mmap = 1;
fprintf(stderr, "mmap disk space for less use of memory\n");
}
else if (!strcmp(agv[i], "-robust")) {
*flag_robust = 1;
fprintf(stderr, "using robust velocity estimate (require -atm)\n");
}
else if (!strcmp(agv[i], "-atm")) {
i++;
Expand Down Expand Up @@ -377,7 +382,7 @@ int init_G_ts(double *G, double *Gs, int64_t N, int64_t S, int64_t m, int64_t n,
int64_t lsqlin_sov_ts(int64_t xdim, int64_t ydim, float *disp, float *vel, int64_t *flag, double *d, double *ds, double *time,
double *G, double *Gs, double *A, float *var, float *phi, int64_t N, int64_t S, int64_t m, int64_t n,
double *work, int64_t lwork, int64_t flag_dem, float *dem, int64_t flag_rms, float *res, int64_t *jpvt,
double wl, double *atm_rms) {
double wl, double *atm_rms, int64_t flag_robust) {

int64_t i, j, k, p, info = 0, indx;
int64_t rank = 0, nrhs = 1, lda, ldb;
Expand Down Expand Up @@ -481,7 +486,7 @@ int64_t lsqlin_sov_ts(int64_t xdim, int64_t ydim, float *disp, float *vel, int64
sumx = 0;
sumy = 0;
sumyy = 0;
if (count > 2) {
if (count > 2 && flag_robust == 1) {
for (i = 2; i < S - 2; i++) {
if (atm_rms[i] != 0.0) {
sumxy = sumxy + time[i] * disp[i * xdim * ydim + j * ydim + k];
Expand Down Expand Up @@ -602,7 +607,7 @@ int write_output_ts(void *API, struct GMT_GRID *Out, int64_t agc, char **agv, in

if (flag_dem == 1) {
Out->data = dem;
sprintf(outfile, "dem.grd");
sprintf(outfile, "dem_err.grd");
strcpy(Out->header->title, "");
strcpy(Out->header->remark, "");
if (GMT_Set_Comment(API, GMT_IS_GRID, GMT_COMMENT_IS_REMARK, "DEM error estimated from SBAS (m)", Out))
Expand Down
2 changes: 1 addition & 1 deletion preproc/GF3_preproc/src/make_slc_gf3.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ int write_slc(TIFF *tif, FILE *slc, char *orbdir) {
// printf("%d %d \n",width,height);

buf = (uint16 *)_TIFFmalloc(TIFFScanlineSize(tif));
tmp = (short *)malloc(width * 2 * sizeof(short));
width = widthi - widthi % 4;
tmp = (short *)malloc(width * 2 * sizeof(short));
printf("Writing SLC..Image Size: %d X %d...\n", width, height);

for (i = 0; i < height; i++) {
Expand Down
2 changes: 1 addition & 1 deletion preproc/S1A_preproc/src_assembly/assemble_tops.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int main(int argc, char **argv) {
}

// modify xml_tree[0] to get parameters from other xml_trees
edit_tree(nfiles, nlmx, xml_tree, azi_1, azi_2, &nb_start, &nb_end);
edit_tree(nfiles, nlmx, xml_tree, (int)azi_1, (int)azi_2, &nb_start, &nb_end);
printf("Output burst from #%d to #%d ...\n", nb_start, nb_end);

strcpy(tmp_str, argv[argc - 1]);
Expand Down

0 comments on commit 09f3723

Please sign in to comment.