StaMPS CSV Export

Hello. I am trying to export my StaMPS result into a CSV file. I tried specifying a center and radius in the ps_plot(‘v-do’, ‘ts’) plot. I noticed that when I try to run the code below, it works but sometimes I get this error.

“Error using horzcat
Dimensions of arrays being concatenated are not consistent.”

Code used for exporting:
load parms.mat;
ps_plot(‘v-do’, -1);
load ps_plot_v-do.mat;
lon2_str = cellstr(num2str(lon2));
lat2_str = cellstr(num2str(lat2));
lonlat2_str = strcat(lon2_str, lat2_str);
lonlat_str = strcat(cellstr(num2str(lonlat(:,1))), cellstr(num2str(lonlat(:,2))));
ind = ismember(lonlat_str, lonlat2_str);
disp = ph_disp(ind);
disp_ts = ph_mm(ind,:);
export_res = [lon2 lat2 disp disp_ts];
metarow = [ref_centre_lonlat NaN transpose(day)-1];
k = 0;
export_res = [export_res(1:k,:); metarow; export_res(k+1:end,:)];
export_res = table(export_res);
writetable(export_res,‘stamps_tsexport7.csv’)

Hoping to get more insights on why this occurs. Thank you!

Please test increasing the radius as suggested here: StaMPS-Visualizer, SNAP-StaMPS Workflow - #7 by thho

Make it so large that all points in your data are included.

Hello, Sir.

Thank you for the suggestion! It worked for me. However, I did notice a few things after trying out different values for the reference radius.

  • At first, I tried the value of 10,000 and it was exported without a problem. Afterwards, I ran the code again but this time I set the radius to 20,000. The same error popped up.

  • I restarted my matlab and ran the code again setting the radius to 20,000 and it worked. I ran it again to double check by setting the radius to 10,000 and the error popped up once more.

I’m guessing this has something to do with my hardware (?). But nonetheless, your suggestion along with restarting the program definitely worked.

Thanks so much!

glad to hear it worked. Hard to tell what causes this problems sometimes, I also experienced it rather irregularly.

Hello. I am trying to export my StaMPS result (‘v-d’) into a CSV file and I am facing an issue in the CSV file. I have 40 images, so I expect export_res (1-40) in the first line. Apart from that, the ref lon and ref lat appears 0,0, NaN as appears below.


In the StAMPS Visualizer my values are a total mess.

Can you help me with this?