Hi
I am looping through a bunch of MLAC files and receive the following message on load (below). Is there some way SEADAS can throw an exception gracefully? This stops my loop and no matter how I try to continue I cannot in code. I have to restart. In MATLAB or C I would place a try-catch.
SeaDAS> match,'/home/daben/seawifs/data/INBOX_20070602/','S1997345053926',-999,-999,res
Detected SEAWIFS ftype.
grp_name=Geophysical Data
Getting navigation data from HDF file...
Warning - there are 2 scan line(s) with bad navigation
% VALUE_LOCATE: Array X does not have enough elements.
% Error occurred at: INTERPOL 161 /usr/local/rsi/idl_6.0/lib/interpol.pro
% GET_SWF_NAV 84 /usr/local/seadas5.0.5/idl_lib/get_swf_nav.pro
% GET_NAV_GEN 108 /usr/local/seadas5.0.5/idl_lib/get_nav_gen.pro
% SDP_RD_SWF_L2 302 /usr/local/seadas5.0.5/idl_lib/sdp_read_seawifs.pro
% SDP_READ_SEAWIFS 363 /usr/local/seadas5.0.5/idl_lib/sdp_read_seawifs.pro
% LOAD 644 /usr/local/seadas5.0.5/idl_lib/load.pro
% MATCH 31 /home/daben/seawifs/data/test/match.pro
% $MAIN$
% Execution halted at: GET_SWF_NAV 84 /usr/local/seadas5.0.5/idl_lib/get_swf_nav.pro
By mike
Date 2007-06-12 17:10
I'm not sure if there's a solution to this type of situation in IDL but we'll try to look into it. If any IDL experts out there have any suggestions we're all ears. If it is possible to catch such exceptions, one of the problems we'll run into is that SeaDAS wasn't programmed to catch such errors from the ground up.
I know you're asking for a general exception catch, but in the meantime if you send us your match.pro file we might be able to add some extra code to handle this particular problem. I was able to successfull load "S1997345053926.L1A_MLAC" and "S1997345053926.L2_MLAC" so I'm not sure of what is triggering your exact problem. Are you using one of these files from our browser?
Also for interactive situations here are some tips to salvage a session after an error:
http://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?tid=1955
Here is the relevant code that I use to load the file (below). It may be that I have a corrupt file -- but it seems that it goes along. I guess what is also needed it some kinda checksum for downloaded files. I downloaded the files after ordering from the browser. I am aware of the salvage tricks for interactive, but it does not help in the batch.
**********************************************************************
pro matchX, str_mlac_path, cn, sn, swf, lat, lon, results
; given a swf file, extracts the closest pixel and
; 8 neighbors to at the given lat, lon
; assumes seadas is open
;
; output is a structure of matchups
;
@sds_global.inc
;*******************************
ON_ERROR, 1 ; tried all the different options, but it always halts!
CATCH, /CANCEL ; just in case, but don't think it really does what I want
;*******************************
; make real file name for MLAC
swf_file = str_mlac_path+swf+'.L2_MLAC.x.hdf'
; define products for matchups
prods = ['chlor_a','nLw_443','nLw_490','nLw_555']
n_prod = N_ELEMENTS(prods);
; number of neighbors to get, set to 0,0 for exact match
dpix = 1;
dline = 1;
n_pix = (2*dpix+1)*(2*dline+1)
seadisp
load,swf_file,prod_name=prods
;....
END
**********************************************************************
By mark
Date 2007-06-13 15:44
I agree that your file is probably corrupt. But as Mike said, SeaDAS is not really designed to throw exceptions like that. Also, the "seadisp" command is obsolete as of SeaDAS 4.8.3. You probably want to remove that.
Mark