Tuesday, March 31, 2015

Split Granule name to find the match

I wanted the MODIS granule name from the long list of MYD35_L2. The year and daynum-hhmmss etc mattered so that I could do a pattern match.
This is an easy fix.
  [token, remain] = strsplit(scene5a{i}, 'MYD35_L2.A');
  modname = token{2};
  ahr = str2double(modname(9:10));
  amin = str2double(modname(11:12));
  mday = str2double(modname(5:7));
  year =  str2double(modname(1:4));
  obsday = yearday(year,mday);
  dofm = str2double(datestr(obsday,7));
  mth = str2double(datestr(obsday,5));
  MODobs(c) = datenum(year,mth,dofm,ahr,amin,0);

Thursday, March 26, 2015

/bin/bash^M: bad interpreter: No such file or directory

Was trying to write a shell script with if;then;fi loop. Kept getting the error message!!!
% A lesson learned: do not write unix file in windows :)

wget quit with memory exhausted

When doing simple 

wget -nc -i list.txt,

I got my wget quit with "memory exhausted" prompt. The download halted. 

I solved the issue by removing the .listing file and re-running the wget.