function s2n = readimgs(x)
   cd(uigetdir);
   files = uigetfile('*.fit','MultiSelect','on');
   files = sort(files);
   n = size(files);
   n = n(2);
   for i = 1:n
       filename = cast(files(i),'char');
       img = fitsread(filename(:));
       img = img - 100;
       colormap(gray);
       sample = img(x(3):x(4),x(1):x(2));
       subplot(1,6,i)
       imagesc(sample);
       axis image
       s2n = mean(sample(:))/std(sample(:))
   end
   