Ocean Color Forum - Not logged in
By xpan
Date 2007-05-14 20:22
Hi,
Can anybody tell me how to run seadas batch command? In my unix machine, seadas is installed under bash shell shared with multiple users, and my user directory is installed under tcsh shell. I can run seadas GUI by the following command "bash -i -c seadas", but not the command "seadas". Normally, the batch command looks like "seadas -b batchfile", but it doesn't work in my situation as shown in the error "seadas: command not found".
Xiaoju
By mike
Date 2007-05-14 20:34
I think what you need to do is put a line in your ~/.bashrc file like so:
echo "source PATH_TO_SEADAS/config/seadas.env" >> ~/.bashrc
..where "PATH_TO_SEADAS" is the complete directory path to the seadas installation directory, e.g.: /home/seadas/seadas5.0
I believe you will then be able to use the command: bash -i -c "seadas -b batchfile"
By xpan
Date 2007-05-14 20:46
Thanks Mike. It does work.
By xpan
Date 2007-05-14 21:54
By mike
Date 2007-05-14 22:02
Can you:
1) post the exact command you use to start SeaDAS, e.g.: bash -i -c "seadas -b batchfile"
2) post the contents of your batch file
By xpan
Date 2007-05-14 22:07
Mike,
The followings are the input command (bash -i -c "seadas -b batch_cmd") and the output error:
[xpan@oceanbio3 idl_pros]$ bash -i -c "seadas -b batch_cmd"
xdpyinfo: Command not found.
xrdb: Command not found.
IDL Version 6.1 (linux x86 m32). (c) 2004, Research Systems, Inc.
Installation number: 12936-3.
Licensed for use by: NASA - Goddard Space Flight Ce
****************NOTE FOR RedHat Enterprise USERS********************
Some functionality in this IDL release requires the libstdc++
compatiblity libraries to be installed. To check if the libraries
are already installed, execute 'rpm -qa | grep compat', and look for
"compat-libstdc++-<version_number>". If this is not listed, install
the appropriate RPM for your distribution (from your install CD's).
**********************************************************
SeaDAS Version 5.0.2 (pid = 14680)
rm: No match.
% Attempt to call undefined procedure/function: 'BATCHMAP_OCWEBL1A'.
% Execution halted at: $MAIN$
% Attempt to call undefined procedure/function: 'WRITE_DLY_QCFLAT'.
% Execution halted at: $MAIN$
% Attempt to call undefined procedure/function: 'WRITE_WKLAVG_QCFLAT'.
% Execution halted at: $MAIN$
% Attempt to call undefined procedure/function: 'WRITE_MONAVG_QCFLAT'.
% Execution halted at: $MAIN$
By xpan
Date 2007-05-14 22:14
A part of code is shown as:
;------------------------------------------------------------------------------------
ltln_nswe= [41.5,35.0,-78.0,-71.5]
l1dir= '~/data/seawifs/level1/2000'
ancildir= '~/data/seawifs/level1/2000/ancillary'
l3dir= '~/data/seawifs/level3'
batchmap_ocwebl1a, L1A_DIR=l1dir, ANCIL_DIR=ancildir, L3HDF_DIR=l3dir,$
LATLON=ltln_nswe, COMPOSITE=1
;------------------------------------------------------------------------------------
By mike
Date 2007-05-15 02:41
You are calling non-SeaDAS IDL routines (batchmap_ocwebl1a, WRITE_DLY_QCFLAT, WRITE_WKLAVG_QCFLAT, WRITE_MONAVG_QCFLAT) and they are not being found by IDL. To call your own routines they must be either in a directory in your IDL path or in your current working directory. So where are these custom routines located?
By xpan
Date 2007-05-15 13:12
The batch file (batch_cmd) is located under the directory of /home/xpan/idl_pros/, and those non-SeaDAS IDL routines (batchmap_ocwebl1a, WRITE_DLY_QCFLAT, WRITE_WKLAVG_QCFLAT, WRITE_MONAVG_QCFLAT) are located under the directory of /home/xpan/idl_pros/ocweb_l3gen/. Seadas is installed in the directory of /data/seadas5.0/. I ran the batch command under the directory /home/xpan/idl_pros/.
By mark
Date 2007-05-15 13:55
Xiaoju,
It looks to me like there could be a number of different problems going on here.
1) You should probably update your seadas from version 5.0.2 to 5.0.5.
2) You either do not have X11 installed, or more likely, you do not have it in your $path, because of the "xdpyinfo" and "xrdb" not found messages.
3) You are getting an "rm: No match." error. Something in your batch script is failing to remove something. It's probably not significant, but may be worth looking into.
4) As Mike said, you need to either add /home/xpan/idl_pros/ocweb_l3gen to your IDL path, or copy/move those non-SeaDAS IDL routines over to your /home/xpan/idl_pros directory so that your batch script can find them. You can add the directory to your path with the following statement in your batch command script:
!path = STRTRIM('/home/xpan/idl_pros/ocweb_l3gen',2) + ':' + !path
Mark
By xpan
Date 2007-05-15 15:03
Mark,
1. I am not the administrator to install or update seadas version. However, seadas 5.02 GUI works well in processing level 1->2->3. So I think this might not a critical problem.
2. Could you please tell me how to add X11 to my path? I think it was installed.
4. After I moved the /home/xpan/idl_pros/ocweb_l3gen/* directory to /home/xpan/idl_pros directory, it still showed the error information of "undefined procedure/functions". I have other IDL programs which doesn't call seadas and works smoothly.
By mark
Date 2007-05-15 15:25
Xiaoju,
1. Okay, then leave it at 5.0.2 for now.
2. To add X11 to your path, add this to your ~/.bashrc file: export PATH=$PATH:/usr/X11R6/bin:/usr/bin/X11
4. Hmmmm. Okay, I'm not sure why it is not finding them, but did you also try adding the path to your IDL path, as I described in the previous post?
Mark
By xpan
Date 2007-05-15 15:58
Mark,
It still shows wrong. I don't know why. Maybe you can tell me another way to do it. My purpose is to process seawifs and modis level 1 to level 2 for more products (e.g. Rrs, solz, sola, gsm01_chl) in addition of standard products.
By mike
Date 2007-05-15 16:34
Xiaoju it might be easiest to start by writing a couple of very simple unrelated scripts to learn how to use SeaDAS and your own code together. It is important to understand the difference between an IDL procedure and command file. For example
in a new empty directory you could start by writing an IDL procedure called "hello.pro":
;;;;;;;;;;;;;;;;;;;;;;;;
PRO hello
print,"Hello World!"
END
;;;;;;;;;;;;;;;;;;;;;;;;
..and then write a command file called "hello.cmd" that will call this procedure:
;;;;;;;;;;;;;;;;;;;;;;;;
print,"Calling the hello procedure..."
hello
;;;;;;;;;;;;;;;;;;;;;;;;
So now in the same directory as the "hello.pro" and "hello.cmd" files, run:
bash -i -c "seadas -b hello.cmd"This should give the output:
> Calling the hello procedure...
> Hello World!
Now insert a new first line at the top of the "hello.cmd" file: !path = STRTRIM('/home/xpan/idl_pros',2) + ':' + !path
Next, move the "hello.pro" file into your /home/xpan/idl_pros/ directory and from the directory containing "hello.cmd", again try to run:
bash -i -c "seadas -b hello.cmd"If this simple example works you can follow the same technique for all your IDL procedures and command files that call the procedures. If it doesn't work let us know and we'll figure out what is wrong.
By mike
Date 2007-05-15 17:00
Also keep in mind that for certain tasks (especially processing) it may be better to just use Unix shell scripts and call the SeaDAS processing binaries directly. So for L1->L2 processing this script could be either a Unix shell script, or an IDL command file and/or an IDL procedure.
For L1->L2 processing I would actually suggest using a Unix shell script to call the
msl12 binary as is done in the first example of this
FAQ post. For this example you will need to also create a text file called "msl12.par" in the same directory that contains all the parameters you wish to specify, one per line. So your "msl12.par" file might contain the one line:
l2prod1="Rrs_412 solz sola chl_gsm01 chlor_a K_490 tau_865 eps_78 angstrom_510 nLw_412 nLw_443 nLw_490 nLw_510 nLw_555 nLw_670 l2_flags"...see the
msl12 help page for more info.
Hi,
I have tried to use the simple load command for the level 3 binned seawifs file (downloaded from ftp site)
;.....................................
seadisp, /quit
seadisp
load,'S1998001.L3b_DAY.main',prod_name='nLw_443',cat_no='1',LIMIT=[60,-10,80,10.]
;.....................................
and it does not work. I have used a similar command a year or more ago, and it worked. Now I get an answer that the..expression must be a structure in this context...WG_MAIN (SDS_WIDGET)...
Next, I would like to write an acii file with nLw data. I have used before something like
out_ascii, band_no=1, region=[pt3,pt4], vars=[2,3,4], /ll_flag
Are there recent changes with the way that the command mode works? I tried to find some information about this in the tutorials and demos with command mode info, but did not find any good examples for SeaWiFs level 3 binned files. Can you help me?
Thank you,
Malgorzata
By mark
Date 2007-06-07 02:04
Malgorzata,
What version of SeaDAS are you using?
Are you using the embedded IDL?
Mark