diff --git a/gmtsar/csh/correct_insar_with_gnss.csh b/gmtsar/csh/correct_insar_with_gnss.csh index 94f1f619..cf3c303e 100755 --- a/gmtsar/csh/correct_insar_with_gnss.csh +++ b/gmtsar/csh/correct_insar_with_gnss.csh @@ -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 @@ -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 diff --git a/gmtsar/csh/dem2topo_ra.csh b/gmtsar/csh/dem2topo_ra.csh index 22f201a1..acb8b9d9 100755 --- a/gmtsar/csh/dem2topo_ra.csh +++ b/gmtsar/csh/dem2topo_ra.csh @@ -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" diff --git a/gmtsar/csh/extract_one_time_series.csh b/gmtsar/csh/extract_one_time_series.csh index 5fc0fe3e..2f8954bd 100755 --- a/gmtsar/csh/extract_one_time_series.csh +++ b/gmtsar/csh/extract_one_time_series.csh @@ -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 diff --git a/gmtsar/csh/preproc_batch_tops.csh b/gmtsar/csh/preproc_batch_tops.csh index 64abaa52..b54d21ca 100755 --- a/gmtsar/csh/preproc_batch_tops.csh +++ b/gmtsar/csh/preproc_batch_tops.csh @@ -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:" diff --git a/gmtsar/csh/preproc_batch_tops_esd.csh b/gmtsar/csh/preproc_batch_tops_esd.csh index 890627be..155453a9 100755 --- a/gmtsar/csh/preproc_batch_tops_esd.csh +++ b/gmtsar/csh/preproc_batch_tops_esd.csh @@ -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:" diff --git a/gmtsar/csh/proj_ra2ll.csh b/gmtsar/csh/proj_ra2ll.csh index fb7b4068..e576f98d 100755 --- a/gmtsar/csh/proj_ra2ll.csh +++ b/gmtsar/csh/proj_ra2ll.csh @@ -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 @@ -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 diff --git a/gmtsar/make_gaussian_filter.c b/gmtsar/make_gaussian_filter.c index fd6563a8..477ec0af 100644 --- a/gmtsar/make_gaussian_filter.c +++ b/gmtsar/make_gaussian_filter.c @@ -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) diff --git a/gmtsar/sbas.c b/gmtsar/sbas.c index dc05266a..13da999e 100644 --- a/gmtsar/sbas.c +++ b/gmtsar/sbas.c @@ -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" @@ -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; @@ -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) @@ -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; @@ -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"); @@ -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++) @@ -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 diff --git a/gmtsar/sbas.h b/gmtsar/sbas.h index 4a4b6376..90e85287 100644 --- a/gmtsar/sbas.h +++ b/gmtsar/sbas.h @@ -5,7 +5,7 @@ #include #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); @@ -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 *, diff --git a/gmtsar/sbas_parallel.c b/gmtsar/sbas_parallel.c index 261f6087..becc2c5e 100644 --- a/gmtsar/sbas_parallel.c +++ b/gmtsar/sbas_parallel.c @@ -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" @@ -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; @@ -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) @@ -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; @@ -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]; @@ -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)) @@ -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; @@ -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); @@ -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; @@ -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"); @@ -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++) @@ -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 diff --git a/gmtsar/sbas_utils.c b/gmtsar/sbas_utils.c index 22286384..4a172f57 100644 --- a/gmtsar/sbas_utils.c +++ b/gmtsar/sbas_utils.c @@ -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" @@ -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; @@ -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++; @@ -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; @@ -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]; @@ -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)) diff --git a/preproc/GF3_preproc/src/make_slc_gf3.c b/preproc/GF3_preproc/src/make_slc_gf3.c index 42ea6181..f17283d2 100644 --- a/preproc/GF3_preproc/src/make_slc_gf3.c +++ b/preproc/GF3_preproc/src/make_slc_gf3.c @@ -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++) { diff --git a/preproc/S1A_preproc/src_assembly/assemble_tops.c b/preproc/S1A_preproc/src_assembly/assemble_tops.c index a2382a69..5ceff1a5 100644 --- a/preproc/S1A_preproc/src_assembly/assemble_tops.c +++ b/preproc/S1A_preproc/src_assembly/assemble_tops.c @@ -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]);