Ocean Color Forum - Not logged in
Forum Ocean Color Home Help Search Login
Previous Next Up Topic SeaDAS / SeaDAS 6.x - General Questions / shell script for auto processing (locked) (4161 hits)
By xpan Date 2008-05-13 13:59
Hi,
Can anyone tell me why I cannot make the script (named "modis_L12_scirpt" as copied from http://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?tid=2046) run? I am using tcsh while the seadas is installed under bash in the directory /data/seadas5.2. When I run the the script file ("modis_L12_script"), I received the following errors:

[xpan@oceanbio3 ~/bin]$ ./modis_L12_script
./modis_L12_script: line 23: modis_L1A_to_GEO.csh: command not found
./modis_L12_script: line 26: modis_L1A_extract.csh: command not found
./modis_L12_script: line 29: modis_L1A_to_L1B.csh: command not found
./modis_L12_script: line 32: ms_met.csh: command not found
./modis_L12_script: line 33: ms_ozone.csh: command not found
./modis_L12_script: line 34: ms_oisst.csh: command not found
Processing *L1A_LAC.L1B to Level 2..
./modis_L12_script: line 41: l2gen: command not found
By mark Date 2008-05-13 14:20
You are getting these errors because it cannot find the scripts and binary, since there is no path defined to them.  The *.csh scripts are located in your $SEADAS/scripts directory and the l2gen binary is located in your $SEADAS/bin directory.  You could insert the full pathname prior to the script/binary names or do it any number of other ways, but I'm guessing that would be the easiest way for you.  So for example, change the line that calls the modis_L1A_to_GEO.csh script to:

/data/seadas5.2/scripts/modis_L1A_to_GEO.csh $FILE -o $GEOFILE

Mark
By xpan Date 2008-05-13 14:39
Thanks Mark. I made change on the script by giving them the full paths. But now it comes other error messages:
  [xpan@oceanbio3 ~/bin]$ ./modis_L12_script
modis_L1A_to_GEO.csh: ERROR: The SEADAS environment variable is not set. Exiting.

modis_L1A_extract.csh: ERROR: The SEADAS environment variable is not set. Exiting.

modis_L1A_extract.csh: ERROR: The SEADAS environment variable is not set. Exiting.

ms_met.csh: ERROR: SEADAS env. variable not set. Exiting.

ms_ozone.csh: ERROR: SEADAS env. variable not set. Exiting.

ms_oisst.csh: ERROR: SEADAS env. variable not set. Exiting.

Processing *L1A_LAC.L1B to Level 2..
By mark Date 2008-05-13 14:54
In your script, after the first line where it defines the bourne shell(#!/bin/sh), put this line:

source /data/seadas5.2/config/seadas.env

which should set up your environment correctly with all of the necessary environment variables.  Mixing shell environments like you have with your own shell being tcsh while seadas is installed under bash, is generally not a good idea, so you probably should also either change your default shell environment to bash with the chsh command, or install seadas under tcsh.

Mark
By xpan Date 2008-05-13 16:26
Mark,
The script did work but something in wrong. I got the following messages.

[xpan@oceanbio3 bin]$ ./modis_L12_script
Level 1A input filename: A2002187172500.L1A_LAC.x.hdf
Output geolocation file: A2002187172500.GEO
Satellite: aqua
Year: 2002  Day: 187  Hour: 17  Minute: 25

*Terrain Correction Enabled*

Determining required definitive attitude and ephemeris files...
/data/seadas5.2/scripts/modis_definitive_atteph.csh aqua 2002187172500 2002187173000

Checking local hard disk for required definitive attitude and ephemeris files...Present on hard disk: PM1ATTNR.P2002187.1600.002
Present on hard disk: PM1EPHND.P2002187.1200.001

All required definitive attitude and ephemeris files found on your hard disk.

att_file1: /home/xpan/.seadas/atteph/2002/187/PM1ATTNR.P2002187.1600.002
att_file2: NULL
eph_file1: /home/xpan/.seadas/atteph/2002/187/PM1EPHND.P2002187.1200.001
eph_file2: NULL

Tue May 13 12:01:14 EDT 2008
Creating MODIS geolocation file...
/data/seadas5.2/bin/geogen_modis
GEO version: 5.0.6 built on Mar 31 2008 (13:50:29)
scan: 0 out of 58 Tue May 13 12:01:14 2008
scan: 10 out of 58 Tue May 13 12:01:15 2008
scan: 20 out of 58 Tue May 13 12:01:16 2008
scan: 30 out of 58 Tue May 13 12:01:18 2008
scan: 40 out of 58 Tue May 13 12:01:19 2008
scan: 50 out of 58 Tue May 13 12:01:20 2008
geogen_modis exit status: 0
Tue May 13 12:01:21 EDT 2008

Running validation test on geolocation file...
/data/seadas5.2/scripts/modis_geocheck.csh ./A2002187172500.GEO 95
Number of pixels with missing geolocation: 0
Percent of geolocated pixels (rounded): 100
Validation test passed for geolocation file A2002187172500.GEO.

lonlat2pixline A2002187172500.GEO -76.0 36.0 -73.0 38.0
start/end line : 255/541
start/end pixel: 503/620
l1aextract_modis A2002187172500.L1A_LAC.x.hdf 503 620 255 541 A2002187172500_sub.L1A_LAC

***************************************************************************
MODIS L1A extraction complete. Generating new GEO file..
***************************************************************************

modis_L1A_to_GEO.csh A2002187172500_sub.L1A_LAC -o A2002187172500_sub.GEO
Level 1A input filename: A2002187172500_sub.L1A_LAC
Output geolocation file: A2002187172500_sub.GEO
Satellite: aqua
Year: 2002  Day: 187  Hour: 17  Minute: 25

*Terrain Correction Enabled*

Determining required definitive attitude and ephemeris files...
/data/seadas5.2/scripts/modis_definitive_atteph.csh aqua 2002187172500 2002187173000

Checking local hard disk for required definitive attitude and ephemeris files...Present on hard disk: PM1ATTNR.P2002187.1600.002
Present on hard disk: PM1EPHND.P2002187.1200.001

All required definitive attitude and ephemeris files found on your hard disk.

att_file1: /home/xpan/.seadas/atteph/2002/187/PM1ATTNR.P2002187.1600.002
att_file2: NULL
eph_file1: /home/xpan/.seadas/atteph/2002/187/PM1EPHND.P2002187.1200.001
eph_file2: NULL

Tue May 13 12:01:23 EDT 2008
Creating MODIS geolocation file...
/data/seadas5.2/bin/geogen_modis
GEO version: 5.0.6 built on Mar 31 2008 (13:50:29)
scan: 0 out of 30 Tue May 13 12:01:23 2008
scan: 10 out of 30 Tue May 13 12:01:24 2008
scan: 20 out of 30 Tue May 13 12:01:26 2008
geogen_modis exit status: 0
Tue May 13 12:01:27 EDT 2008

Running validation test on geolocation file...
/data/seadas5.2/scripts/modis_geocheck.csh ./A2002187172500_sub.GEO 95
Number of pixels with missing geolocation: 0
Percent of geolocated pixels (rounded): 100
Validation test passed for geolocation file A2002187172500_sub.GEO.

lonlat2pixline A2002187172500.GEO -76.0 36.0 -73.0 38.0
start/end line : 255/541
start/end pixel: 503/620
l1aextract_modis A2002187172500.L1A_LAC.x.hdf 503 620 255 541 A2002187172500_sub.L1A_LAC

***************************************************************************
MODIS L1A extraction complete. Generating new GEO file..
***************************************************************************

modis_L1A_to_GEO.csh A2002187172500_sub.L1A_LAC -o A2002187172500_sub.GEO
Level 1A input filename: A2002187172500_sub.L1A_LAC
Output geolocation file: A2002187172500_sub.GEO
Satellite: aqua
Year: 2002  Day: 187  Hour: 17  Minute: 25

*Terrain Correction Enabled*

Determining required definitive attitude and ephemeris files...
/data/seadas5.2/scripts/modis_definitive_atteph.csh aqua 2002187172500 2002187173000

Checking local hard disk for required definitive attitude and ephemeris files...Present on hard disk: PM1ATTNR.P2002187.1600.002
Present on hard disk: PM1EPHND.P2002187.1200.001

All required definitive attitude and ephemeris files found on your hard disk.

att_file1: /home/xpan/.seadas/atteph/2002/187/PM1ATTNR.P2002187.1600.002
att_file2: NULL
eph_file1: /home/xpan/.seadas/atteph/2002/187/PM1EPHND.P2002187.1200.001
eph_file2: NULL

Tue May 13 12:01:28 EDT 2008
Creating MODIS geolocation file...
/data/seadas5.2/bin/geogen_modis
GEO version: 5.0.6 built on Mar 31 2008 (13:50:29)
scan: 0 out of 30 Tue May 13 12:01:28 2008
scan: 10 out of 30 Tue May 13 12:01:29 2008
scan: 20 out of 30 Tue May 13 12:01:31 2008
geogen_modis exit status: 0
Tue May 13 12:01:32 EDT 2008

Running validation test on geolocation file...
/data/seadas5.2/scripts/modis_geocheck.csh ./A2002187172500_sub.GEO 95
Number of pixels with missing geolocation: 0
Percent of geolocated pixels (rounded): 100
Validation test passed for geolocation file A2002187172500_sub.GEO.

Determining pass start and end times..
*** ERROR: Could not determine start time for A2002187172500.L1B. Exiting.

Determining pass start and end times..
*** ERROR: Could not determine start time for A2002187172500.L1B. Exiting.

Determining pass start time..
*** ERROR: Could not determine start time for A2002187172500.L1B. Exiting.

Processing A2002187172500.L1B to Level 2..
By mark Date 2008-05-13 17:05
xpan,

I need to see your script, since it looks like you may have made some changes to the script.  It strangely appears like it repeats the geolocation and extraction processes twice and then skips over the L1B portion.  You will not be able to post your script on the forum due to security filters, so just mail the script to our user support e-mail address:  seadas   a t   seadas.gsfc.nasa.gov

Mark
By xpan Date 2008-05-13 17:21
Mark,
I just sent out the script. Please check it. Thanks
By xpan Date 2008-05-13 17:47
Mark,
Thanks. The script works well now. I have another question. Is there a script to do the mapping works like seadas GUI: "SeaDAS Main Menu" > "Utilities" > "Data Manipulation" > "Map Projection"?
By mark Date 2008-05-13 18:58
Xiaoju,

You can add statements to your script following the usage info given here:

http://oceancolor.gsfc.nasa.gov/seadas/doc/seadisp/map_proj_widget.html

Mark
By xpan Date 2008-05-13 19:33
Mark,
After I change the l2prod1 (as following) in the script to add more outputs, why are the final output L2 files still in default products?

l2prod1='chlor_a,chl_gsm01,chl_clark,nLw_412,nLw_443,nLw_488,nLw_531,nLw_551,nLw_667,nLw_678,nLw_748,nLw_869,Rrs_412,Rrs_443,Rrs_488,Rrs_531,Rrs_551,Rrs_667,Rrs_678,Rrs_748,Rrs_869,Lw_412,Lw_443,Lw_488,Lw_531,Lw_551,Lw_667,Lw_678,Lw_748,Lw_869,Es_412,Es_443,Es_488,Es_531,Es_551,Es_667,Es_678,Es_748,Es_869,Lr_412,Lr_443,Lr_488,Lr_531,Lr_551,Lr_667,Lr_678,Lr_748,Lr_869,La_412,La_443,La_488,La_531,La_551,La_667,La_678,La_748,La_869,solz,sola,senz,sena,K_490,Kd_412_lee,Kd_443_lee,Kd_488_lee,Kd_531_lee,Kd_551_lee,Kd_667_lee,Kd_678_lee,Kd_748_lee,Kd_869_lee,bbp_443_gsm01,aph_443_gsm01,adg_443_gsm01,bbp_443_qaa,adg_443_qaa,aph_443_qaa,par,l2_flags' \
By mark Date 2008-05-13 20:05
Xiaoju,

I'm not sure, mail us your $BASE.log file.

Mark
Previous Next Up Topic SeaDAS / SeaDAS 6.x - General Questions / shell script for auto processing (locked) (4161 hits)



Responsible NASA Official: Gene C. Feldman
Curator: OceanColor Webmaster
Authorized by: Gene C. Feldman
Updated: 27 November 2007
Privacy Policy and Important Notices NASA logo