Thursday, June 20, 2013

Modis Chlorophyll product command line creation steps


Modis Chlorophyll product command line creation steps

Command line is usually quicker to perform, and avoid any GUI issues I am having in SeaDAS 7.0. I corrupt window default setting with ease. Once I have repeatable command line steps, automation scripts are simple to create.

  1. identify clear days via http://oceancurrent.imos.org.au/ (Australia)
  2. Download from Ocean Color Level 1 and 2 Browser
    1. if area  available in a single swarth download the L1A_LAC file
    2. otherwise download L0_LAC file.
  3. For L0_LAC files
    • Concatenate
      • cat A2011098040500.L0_LAC A2011098041000.L0_LAC > A2011098.L0_LAC
      • result is A2011098.L0_LAC
    • Create L1A_LAC
      • modis_L1A.py A2011098.L0_LAC
      • result is A2011098040500.L1A_LAC
  4. Create GEO file for L1A file
    • modis_GEO.py A2011098040500.L1A_LAC
    • If input product result of concatenation consider if -r option is required.
    • result
      • A2011098040500.GEO
  5. Extract area slightly large than area of interest. Further subsection performed later.
    • modis_L1A_extract.py A2011098040500.L1A_LAC  -n -40 -s -45 -w 142 -e 147 --verbose --log
    • results include
      • A2011098045000.L1A_LAC.sub
      • A2011098045000.GEO.sub
  6. Create L1B file for area of interest
    • modis_L1B.py A2011098sub.L1A_LAC 
    • I renamed my files 
      • A2011098sub.L1A_LAC
      • A2011098sub.GEO
    • Results include
      • A2011098sub.L1B_HKM
      • A2011098sub.L1B_LAC
      • A2011098sub.L1B_QKM
  7. Adjust the names in my l2gen par files
for example my gsm.par

ifile=A2011098sub.L1B_LAC
geofile=A2011098sub.GEO
ofile=gsm.hdf
l2prod="adg_443_gsm,bbp_443_gsm,chl_gsm"

      8. Run l2gen par=gsm.par

Only need 3 dates at the moment so using SeaDAS 7.0 GUI and ERMapper.

Wednesday, May 15, 2013

l2gen with giop

I asked this on the forum

l2gen giop algorithm error

My aim is to work with General IOP algorithm.

I am starting with basic parameter sets.

* l2gen with l2prod=chlor_a ran sucessfully
* l2gen with l2prod="a_443_giop,bb_443_giop,aph_vvv_giop,chl_giop" is unsuccessful

The end of the log is below.

----

Setting pure water aw and bbw for GIOP.
412 4.640989e-03 3.327229e-03
.
.
.
2130 2.512733e+03 2.768182e-06

dyld: lazy symbol binding failed: Symbol not found: __ZNKSt5ctypeIcE13_M_widen_initEv
  Referenced from: /Applications/seadas-7.0/ocssw/run/bin/macosx_intel/l2gen
  Expected in: /usr/lib/libstdc++.6.dylib

dyld: Symbol not found: __ZNKSt5ctypeIcE13_M_widen_initEv
  Referenced from: /Applications/seadas-7.0/ocssw/run/bin/macosx_intel/l2gen
  Expected in: /usr/lib/libstdc++.6.dylib



Advised to run otool

-bash: otool: command not found

Google response
otool command moved in Mountain Lion

I have worked with xcode before, just not since my last rebuild. Mucking around with Objective-C
--> Choose to install xcode 4.6.2

Used this post as a guide
i installed xcode but i still dont have gcc in my terminal

After completing the command tool install I tried l2gen again 
--> NO CHANGE

  otool -L /Applications/seadas-7.0/ocssw/run/bin/macosx_intel/l2gen 


2130 2.512733e+03 2.768182e-06
dyld: lazy symbol binding failed: Symbol not found: __ZNKSt5ctypeIcE13_M_widen_initEv
  Referenced from: /Applications/seadas-7.0/ocssw/run/bin/macosx_intel/l2gen
  Expected in: /usr/lib/libstdc++.6.dylib

dyld: Symbol not found: __ZNKSt5ctypeIcE13_M_widen_initEv
  Referenced from: /Applications/seadas-7.0/ocssw/run/bin/macosx_intel/l2gen
  Expected in: /usr/lib/libstdc++.6.dylib

Trace/BPT trap: 5

Suggested Disagnois

>uname -a
Darwin MacBook-Pro.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64

>otool -L /Applications/seadas-7.0/ocssw/run/bin/macosx_intel/l2gen 
/Applications/seadas-7.0/ocssw/run/bin/macosx_intel/l2gen:
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/opt/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.17.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1094.0.0)
/opt/local/lib/gcc45/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

Alternative avenue explored. 

I did have some success when I ran it against another version of l2gen. This  version was from SeaDAS 7.0 beta, and I have performed a patch, as ftp://seadasuk.pml.ac.uk/seadas/seadas/updates/update_01/README.txt for macosx_intel.


otool -L /projects/SD/ocssw/run/bin/macosx_intel/l2gen
/projects/SD/ocssw/run/bin/macosx_intel/l2gen:
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/opt/local/lib/gcc45/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.14.0)

WhiteG response

WhiteG response refers to 'port' command which I don't have. Checked out MacPorts software,  well beyond my usual unix dabbling. 

Investigated solution not requiring MacPorts to be downloaded.
Did not gain much insight. 

Installed MacPorts, unlike 'otool', the port command is not a diagnostic but a program. 

Ran

sudo port -v selfupdate

sudo port install gcc47

* l2gen with l2prod="a_443_giop,bb_443_giop,aph_vvv_giop,chl_giop" SUCCESSFUL

Sunday, May 5, 2013

Build ceres, beam and seaDAS from source

Just a list of some issues

beam-core
fails tests if there is a space in the class path

beam-gpf 
can't find tools.jar, not in the expected location.
pom.xml or MacOSX profile wrong
I don't have java 1.7.0 installed

MODIS Aqua L2 Standard Product Notes

More of my adventures

Between 2 OS, multiple data formats and multiple software tools that metadata including to the names of layer/bands in the files is either getting removed or not displayed.

Blogger is accessible from both OS so I am writing some notes here.



Name Index
aot 869 1
angstrom 2
Rrs 412 3
Rrs 443 4
Rrs 469 5
Rrs 488 6
Rrs 531 7
Rrs 547 8
Rrs 555 9
Rrs 645 10
Rrs 667 11
Rrs 678 12
chlor a (OC3) 13
Kd 490 14
pic 15
poc 16
cdom index 17
ipar 18
nflh 19
par 20
l2 flags 21
longitude 22
latitude 23

MODIS Aqua level 1A to Level 1B

Create GEO files

modis_GEO.py

I am using the command line even though I have SeaDAS-7.0 beta installed.
There are path issues going on for me 



/Users/user 1/Desktop/Project
modis_GEO.py MYD01.A2007265.0530.005.2013122114904.hdf 

/Users/user 1/Desktop/Project
modis_GEO.py MYD01.A2007044.0425.005.2013122114642.hdf

>dir

MYD01.A2007044.0425.005.2013122114642
MYD01.A2007044.0425.005.2013122114642.GEO



Appears that l2gen can utilise Level 1A SeaWifs but not modis.

Next 

Create Level 1B files

l1bgen

In 
/Applications/seadas-7.0-beta/Processing/run/bin/macosx_intel
there is 
l1bgen_modisa

In the seaDAS-7.0-beta GUI modis_L1b.py is used.
Standard Install has no window is opened when called
Personal SeaDAS built from GIT master branch 4 May 2013

On selecting modis_l1bgen error regarding input path. Possible because I have a space in the path. 

Move my data to a short path with no spaces and checked the permissions, 

Error message indicates a dislike for my input file name.
Shortening

MYD01A2007044.hdf
MYD01A2007044.hdf.GEO
MYD01A2007265.hdf
MYD01A2007265.hdf.GEO

Still getting error the null pointer exception is coming back to a file currently in flux on the development . Not worth pursuing, and I do not believe my system is not sufficiently standard to provide useful  provide feedback to the developer.

Back to command line in SeaDAS 7.0 beta processing module.

Having file names with multiple '.' is definitely an issue for the modis_L1b.py script

Trying the GUI once more after renaming

MYD01A2007044.GEO
MYD01A2007044.hdf
MYD01A2007265.GEO
MYD01A2007265.hdf

Still not able to run,

Using the names above with the command line. 

/projects/chldata>
modis_L1B.py MYD01A2007265.hdf 


MYD01A2007265.GEO
MYD01A2007265.L1B_HKM
MYD01A2007265.L1B_LAC
MYD01A2007265.L1B_QKM
MYD01A2007265.hdf

Sweet


Thursday, April 4, 2013

SeaDAS 7.0 beta setup and configuration files

Further notes on my Adventures processing MODIS files

After starting SeaDAS 7.0 beta, via the icon, I opened a terminal window so that I could tail the log.

The first line was

/Users/Kaffkar/seadas/config/seadas.env: No such file or directory

I recently had to reinstall my operating system, as some windows on my bootcamp partition thought destroying the start software would be sensible.

The result is a slightly odd setup where I have one user and 2 user directories

performed a

find . -name seadas* 

and only the expected results were returned.

>env

TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/kt/h45k9r0s2lv2x6yd7tn296vr0000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-jdUITF/Render
TERM_PROGRAM_VERSION=309
TERM_SESSION_ID=34319DE3-BBFF-416A-8949-1E4870045241
USER=Kaffkar
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-YsRd2W/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
Apple_Ubiquity_Message=/tmp/launch-MQI2sO/Apple_Ubiquity_Message
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
PWD=/Users/Kaffkar 1
LANG=en_AU.UTF-8
SHLVL=1
HOME=/Users/Kaffkar 1
LOGNAME=MacGill
_=/usr/bin/env

>java -version

java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)

>l2gen
-bash: l2gen: command not found

I am only a casual unix user but it appears both SeaDAS Gui may have been installed correctly but not the SeaDAS 

I have been referencing

HOW TO INSTALL SeaDAS 6.4
Creating True Color RGB in SeaDAS 7.0
How do I make true-color images from MODIS or SeaWiFS

2 years ago I was a Senior Java Developer, and utilised Maven to build, test and create packages so the files in GitHub actually make some sense.

SeaDAS GUI Source

my .bashrc file contains the reference

source /Users/Kaffkar/seadas/config/seadas.env

This needs to be change.
Trying this.



export OCSSWROOT=/Applications/seadas-7.0-beta/Processing
source /Applications/seadas-7.0-beta/Processing/OCSSW_bash.env

Closed all terminals and the SeaDAS Gui
Restarted SeaDAS
Opened a terminal

>l2gen

Command recognised

Tried l1bgen through GUI. No luck, at least the command line is working
Tried l1brsgen through GUI

>l1brsgen ifile=MYD021KM.A2003359.1225.005.2010067090806.hdf ofile=MYD021KMrgb.ppm geofile=MYD03.A2003359.1225.005.2010067073507.hdf subsamp=4 outmode=2 atmocor=1

This worked, now I just have to work out what it did.

Wednesday, April 3, 2013

SeaDAS 7.0-beta

My machine

OSX 10.8.3
Processor 2.2 GHz Intel Core i7
Memory 4 GB 1333 MHz DDR3

Install of SeaDAS 7.0-beta
Online Install

  • Base files
  • SeaWiFS
  • Modis Aqua
Tips and Tricks

  • Directories are not relative, after install so don't move the install around
Updates
I was experience so GUI problems, one suggestion was that SeaWiFS module needed to be installed for l2gen windows to configure.

Downloaded everything to ensure this was not the problem.
Still having issues. They are not consistent so have reported a bug yet.