SeaDAS training course


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

SeaDAS training course

  1. 1. SeaDAS Training Course NASA Ocean Biology Processing Group Laboratorio de Oceanograf ía y Manejo Costero Universidad Nacional Costa Rica February 22-24, 2008
  2. 2. -The SeaWiFS Data Analysis System (SeaDAS) is a comprehensive image analysis package for the processing, display, analysis, and quality control of ocean color data. -SeaDAS is intended for use with all of the OBPG supported sensors: MODIS/Aqua, MODIS/Terra, SeaWiFS, OCTS, CZCS. -SeaDAS can also be very useful as a general scientific imagery/data analysis package. What is SeaDAS?
  3. 7. Processing -All sensors L0 or L1A to SMI -subscening -browse products Data Visualization -image package (reads many formats) -geolocated display (coastline, gridlines, etc.) -various image/data functions Data Manipulation -projection -band operations -output data SeaDAS Functionalities
  4. 8. -SeaDAS runs on “UNIX-like” systems (UNIX/linux/OS X) -This means it does NOT run on Windows. -Dedicated UNIX computer best, but there are options for Windows users. UNIX linux Mac OS X SGI IRIX Sun Solaris Microsoft Windows UNIX
  5. 9. -UNIX is a fully featured modern Operating System -History (AT&T Bell Labs, Berkeley, UNIX, linux, OS X) -It is available in a variety of ‘flavors’ -It is comprised of simple tools (commands) that perform a single function well - These tools can be used together to perform complex tasks - Powerful Command line -GUI What is UNIX?
  6. 10. Sample linux directory structure
  7. 12. The UNIX Command Line
  8. 13. UNIX Directory Structure: -At login, you are in your home directory. -This is your “current working directory”. -All files and directories below your home directory usually belong to you. -You change your working directory by changing to another directory with the “cd” command. UNIX Basics
  9. 14. Binaries and Libraries -binaries are executable files created by compiling code -mainly used for data processing (e.g. msl12 = L1->L2 processing) -made from C and/or Fortran code -SeaDAS also includes HDF binaries and libraries UNIX Shell Scripts -Shell scripts are executable text files containing many commands -mainly used as “wrappers” for processing -there are also stand-alone utility scripts IDL Code SeaDAS is made up of binaries and libraries, UNIX shell scripts, and IDL code.
  10. 15. -IDL stands for the Interactive Data Language -Made by ITT Visual Information Solutions, ITT VIS (formerly RSI) -It is a scientific programming language (similar to Matlab) -It is also a “ scientific environment ” -SeaDAS GUI written in IDL -SeaDAS also uses IDL for data display and analysis functions -non-SeaDAS IDL functionalities are also available! Runtime SeaDAS - free, but no SeaDAS command line or procedures Purchasing IDL - command line, procedures, full IDL environment IDL (Interactive Data Language)
  11. 16. SeaDAS Directory Structure seadas/ - - - - - - - - - - - - SeaDAS root directory bin/ - - - - - - - - - - C and Fortran processing binaries config/ - - - - - - - - - SeaDAS config files (Imake and default files) data/ - - - - - - - - - - Data files used for processing and display common/benchmarks/ - Data files/scripts for running SeaDAS benchmarks common/luts/ - - - - Color LUTs directory (store custom LUTs here) common/metoz/ - - - MET/OZONE ancillary files storage directory common/oisst/ - - - OISST ancillary files storage directory modis/atteph/ - - - MODIS attitude and ephemeris storage directory demo/ - - - - - - - - - - Demo and test data files doc/ - - - - - - - - - - SeaDAS HTML documentation files etc/ - - - - - - - - - - Stand-alone data processing wrapper scripts examples/ - - - - - - - - Example batch scripts hdf/ - - - - - - - - - - HDF software (binaries and libraries) idl_lib/ - - - - - - - - Copy of all SeaDAS IDL routines idl_rt/ - - - - - - - - - Required directory for Runtime SeaDAS mode inc/ - - - - - - - - - - Include files for C and Fortran routines lib/ - - - - - - - - - - C and Fortran compiled libraries src/ - - - - - - - - - - Root directory of all SeaDAS source code c4idl/ - - - - - - - C routines used within IDL programs c_procs/ - - - - - - Main data processing C routines idl_procs/ - - - - - IDL routines idl_utils/ - - - - - IDL utility routines lib/ - - - - - - - - C and Fortran routines for SeaDAS libraries utils/ - - - - - - - Utility programs used by wrapper scripts util/ - - - - - - - - - - SeaDAS general utilities directory var/ - - - - - - - - - - Miscellaneous ancillary navigation files
  12. 17. Operating Systems : -linux (Red Hat, Fedora, CentOS, etc.) -Mac OS X 10.3, 10.4 (PPC or Intel) -Sun Solaris 2.7, 2.8 -SGI IRIX 6.5 -Vmware on Windows / Knoppix Live CD RAM : 128MB minimum, 1GB+ best Display : 1024x768 minimum, millions of colors Disk space : 1.5GB for SeaDAS install plus space for data Optional : full IDL license Optional : gcc and fortran compilers SeaDAS Requirements
  13. 19. There are 3 ways to use SeaDAS: 1. Graphical User Interface (GUI) 2. Command Line : -IDL command line -UNIX command line 3. Automated : -IDL command (batch) files -IDL procedures -UNIX shell scripts SeaDAS Modes
  14. 20. On the server: -Change directory into your home (~/) directory: cd -List the contents of your home (~/) directory: ls -l Change directory into your home (~/) directory: cd $SEADAS -List the contents of the SeaDAS directory: ls -l -List the contents of the SeaDAS bin directory: ls bin -List the contents of the SeaDAS etc directory: ls etc -List your shell environment variables: env -change directory into your data directory: cd data -List the contents of your data directory: ls -l data Exercise Understanding the SeaDAS Environment
  15. 21. -On the server: cd ~/data/process seadas Display the SeaWiFS Level 1 subscene S2004111164518.L1A_MLAC.x.hdf : -Click Display -Select the S2004111164518.L1A_MLAC.x.hdf file and click Ok -Select the 555nm product and click Load -In the Band List Selection window click Display -Resize display window by dragging the lower right corner -Using the Functions menu : *overlay a Coastline and latitude/longitude Grid *turn on the Color Bar *turn on the Cursor Position window *Select Color LUT->Load LUT and select different color LUTs Exercise Displaying data with SeaDAS
  16. 22. Review of OBPG Satellite Data
  17. 23. Data Processing
  18. 25. Data Processing using the SeaDAS GUI
  19. 26. Operational MODIS Ocean Band Suite VIS/NIR Ocean Color Thermal SST
  20. 27. Data Levels & Flow <ul><li>Level 0 </li></ul><ul><ul><li>raw digital counts </li></ul></ul><ul><ul><li>native binary format </li></ul></ul><ul><li>Level 1A </li></ul><ul><ul><li>raw digital counts </li></ul></ul><ul><ul><li>HDF formatted </li></ul></ul><ul><li>Level 1B </li></ul><ul><ul><li>calibrated reflectances </li></ul></ul><ul><ul><li>converted telemetry </li></ul></ul><ul><li>Level 2 </li></ul><ul><ul><li>geolocated geophysical products for each pixel </li></ul></ul><ul><li>Ancillary data </li></ul><ul><ul><li>wind speed </li></ul></ul><ul><ul><li>surface pressure </li></ul></ul><ul><ul><li>total ozone </li></ul></ul><ul><ul><li>Reynolds SST </li></ul></ul><ul><li>GEO </li></ul><ul><ul><li>geolocation </li></ul></ul><ul><ul><li>radiant path geometry </li></ul></ul><ul><li>ATT & EPH </li></ul><ul><ul><li>spacecraft attitude </li></ul></ul><ul><ul><li>spacecraft position </li></ul></ul>
  21. 28. Data Levels & Flow <ul><li>Level 0 </li></ul><ul><ul><li>raw digital counts </li></ul></ul><ul><ul><li>native binary format </li></ul></ul><ul><li>Level 1A </li></ul><ul><ul><li>raw digital counts </li></ul></ul><ul><ul><li>HDF formatted </li></ul></ul><ul><li>Level 1B </li></ul><ul><ul><li>calibrated reflectances </li></ul></ul><ul><ul><li>converted telemetry </li></ul></ul><ul><li>Level 2 </li></ul><ul><ul><li>geolocated geophysical products for each pixel </li></ul></ul><ul><li>Ancillary data </li></ul><ul><ul><li>wind speed </li></ul></ul><ul><ul><li>surface pressure </li></ul></ul><ul><ul><li>total ozone </li></ul></ul><ul><ul><li>Reynolds SST </li></ul></ul><ul><li>GEO </li></ul><ul><ul><li>geolocation </li></ul></ul><ul><ul><li>radiant path geometry </li></ul></ul><ul><li>ATT & EPH </li></ul><ul><ul><li>spacecraft attitude </li></ul></ul><ul><ul><li>spacecraft position </li></ul></ul><ul><li>Level 1A Subset </li></ul><ul><ul><li>reduced to standard ocean bands only </li></ul></ul>
  22. 29. L0 to L1A
  23. 30. 1. Display A2005205180000.L1A (choose EV_3959_22) 2. Functions -> Cursor Position 3. Process -> MODIS -> modis_subscene 4. Enter SW-Corner : 40, -75 / NE-Corner : 43, -65 L1A Subscene
  24. 31. L1A to L1B
  25. 32. MSL12 Multi-Sensor Level-1 to Level-2 <ul><li>Common software for Level-2 processing of MODIS, SeaWiFS and other sensors in a consistent manner. </li></ul><ul><li>Supports a multitude of product algorithms and processing methodologies. </li></ul><ul><ul><li>standard and non-standard, validated and experimental </li></ul></ul><ul><ul><li>run-time selection of output product suite </li></ul></ul><ul><li>For MODIS, replaced: </li></ul><ul><ul><li>PGE09, PGE10 </li></ul></ul><ul><ul><li>products MOD18 - MOD28 </li></ul></ul>
  26. 33. L1B to L2 (msl12)
  27. 34. -As data is processed by msl12 from Level 1 to Level 2, checks are made for different defined conditions . -When certain tests and conditions are met for a given pixel, a flag is set for that pixel for that condition. -A total of 31 flags can be set for each pixel. -These msl12 Level 2 processing flags are stored in the Level 2 data file as the &quot;l2_flags&quot; product. -The storage method sets bits to 0 or 1 in 32-bit integers that correspond to each pixel. Level 2 Processing Flags
  28. 35. Level 2 Processing Flags (flags in red are masked during Level 3 processing)
  29. 36. Chlorophyll RGB Image Glint Sediments Cloud Level-2 Flags and Masking
  30. 37. nLw (443) RGB Image Glint Sediments Cloud Level-2 Flags and Masking Add masking for high glint Add masking for straylight
  31. 38. -For Level 1 to Level 2 processing (msl12), masked pixels are not processed and are typically set to zero so as to eliminate them from future analysis. -For products where zero could be a valid data value, a number outside the possible data range is substituted. -For SeaWiFS and MODIS, msl12 currently has 8 predefined L1A processing masks (each comprised of only one flag) that can be turned on (1) or off (0) by the user. These 8 masks and their default settings are: maskland=1 maskcloud=1 maskhilt=1 maskbath=0 maskglint=0 masksatzen=0 masksunzen=0 maskstlight=0 Processing Masks
  32. 39. SeaDAS Level 2 Flags Display Function
  33. 41. SST Quality Tests SST Quality Levels
  34. 42. SeaDAS Data Functions
  35. 43. SeaDAS can export data files as HDF, SeaDAS Mapped, flat binary, ascii text, png, and postscript Importing and Exporting Data using SeaDAS
  36. 44. -All OBPG HDF Data files (MODIS, SeaWiFS, OCTS, CZCS) -Some non-OBPG legacy Ocean HDF formats - General HDF (any 2D SDS in an HDF file) - Navigated HDF (a 2D SDS plus a “lat” SDS and “lon” SDS) -“ SeaDAS Mapped ” HDF files -AVHRR V5 w/ standard NASA or NOAA SDS attribute names -AVHRR V4 SST/JPL PO.DAAC HDF Pathfinder Best SST -AVHRR V4 SST/JPL PO.DAAC HDF MCSST - Binary flat files - PNG files - True Color files -Multi-column ascii text files SeaDAS can read / display / analyse:
  37. 45. Data Product Geographic Resolution, Mapping and Binning
  38. 46. Definitions Projection - any process which transforms a spatially organized data set from one coordinate system to another. For MODIS Ocean data products this will refer to two-dimensional data sets. Mapping - a process of transforming a data set from an arbitrary spatial organization to a uniform (rectangular, row-by-column) organization, by processes of projection and resampling. Binning - a process of projecting and aggregating data from an arbitrary spatial and temporal organization, to a uniform spatial scale over a defined time range. Ideally the binning process will preserve both the central tendency (e.g., average) and the variation in the data points that contribute to a bin.
  39. 47. Ocean Product Projections Equal-area: sinusoidal, with equally space rows and number of bins per row proportional to sine of latitude; resolutions of 4.6 and 9.2 km Equal-angle: rectangular (Platte Carre) with rows and columns equally spaced in latitude and longitude; resolutions of 24 and 12 points per degree. Ocean equal-area and equal-angle projections are equivalent at the equator.
  40. 48. Sinusoidal Equal-Area Projection
  41. 49. Level-3 Binned vs Mapped <ul><li>bin files </li></ul><ul><ul><li>multiple products </li></ul></ul><ul><ul><li>stored as float </li></ul></ul><ul><ul><li>sampling statistics included </li></ul></ul><ul><li>map files </li></ul><ul><ul><li>single product </li></ul></ul><ul><ul><li>stored as scaled integer </li></ul></ul>bin file grid map file grid
  42. 50. Increasing Pixel Size MODIS “Bowtie” Effect
  43. 51. One MODIS scan at ~45 degrees scan angle
  44. 52. Two MODIS scans showing overlap of pixels
  45. 53. Multiple MODIS scans showing pixel overlap
  46. 54. Bin boundaries overlaid on pixel locations
  47. 55. Ocean coverage over time for binned files
  48. 56. Binned and Mapped Products Binned products : generated daily from Level-2, and then aggregated to: -8 days -monthly -seasonal -annual -mission Standard mapped image (SMI) products are generated at each temporal resolution by projecting binned files to the equal-angle grid.
  49. 57. Level-3 Processing <ul><li>Standard Products </li></ul><ul><li>Bin resolution 4.6 x 4.6 km 2 </li></ul><ul><li>Mapped resolution </li></ul><ul><ul><li>0.042-deg </li></ul></ul><ul><ul><li>0.084-deg </li></ul></ul><ul><li>Composite Periods </li></ul><ul><ul><li>Daily </li></ul></ul><ul><ul><li>8-day </li></ul></ul><ul><ul><li>Monthly </li></ul></ul><ul><ul><li>Seasonal </li></ul></ul><ul><ul><li>Yearly </li></ul></ul><ul><ul><li>Mission </li></ul></ul><ul><li>Level 3 binned </li></ul><ul><ul><li>geophysical products averaged spatially and/or temporally </li></ul></ul><ul><ul><li>sinusoidally distributed, equal area bins </li></ul></ul><ul><li>Level 3 mapped </li></ul><ul><ul><li>images created by mapping and scaling binned products </li></ul></ul><ul><ul><li>user-friendly, cylindrical equiangular projection </li></ul></ul><ul><li>Level 2 </li></ul><ul><ul><li>geolocated geophysical products for each pixel </li></ul></ul>
  50. 58. Level 2 Processing Flags (flags in red are masked during Level 3 processing)
  51. 59. SeaDAS Command Line Processing
  52. 60. - All SeaDAS processing can also be done using the SeaDAS (IDL) command line. -Virtually everything you can do via the GUI can be done using the SeaDAS command line. -IDL commands can be intermixed with SeaDAS commands. -If you haven’t purchased IDL, you can still use command (batch) files to access the command line functionality. SeaDAS/IDL Command Line
  53. 61. SeaDAS> modis_l1bgen,/help Usage: modis_l1bgen, ifile=&quot;ifile&quot;, geofile=&quot;geofile&quot;, ofile=&quot;ofile&quot;, filehkm=&quot;filehkm&quot;, fileqkm=&quot;fileqkm&quot;, refllutfile=&quot;refllutfile&quot;, emislutfile=&quot;emislutfile&quot;, qalutfile=&quot;qalutfile&quot;, delete1km=delete1km, deletehkm=deletehkm, deleteqkm=deleteqkm, savelog=savelog, wait=wait (Note use of quotes around path/filenames) Example: modis_l1bgen, ifile=&quot;$SDSDEMO/A2005191123500.L1A_LAC&quot;, geofile=&quot;./A2005191123500.GEO&quot;, /wait SeaDAS> SeaDAS/IDL Command Line
  54. 62. SeaDAS> print, “Hello World!” Hello World! SeaDAS> SeaDAS> modis_l1bgen, ifile=&quot;A2005205180000.L1A_sub”, geofile=&quot;A2005205180000.GEO_sub&quot;, /wait % seadas -em -b simple_commands.txt Example Processing using the SeaDAS command line
  55. 63. % modis_L1A_to_L1B.csh Usage: modis_L1A_to_L1B.csh L1A_file GEO_file [OPTIONS] Options: -o L1B_1KM_filename Output MODIS L1B 1KM HDF filename -h L1B_HKM_filename Output MODIS L1B HKM HDF filename -q L1B_QKM_filename Output MODIS L1B QKM HDF filename -rlut REFL_LUT_filepath Full path and filename of Reflective LUT file -elut EMIS_LUT_filepath Full path and filename of Emissive LUT file -qlut QA_LUT_filepath Full path and filename of QA LUT file -delete-1km Delete 1km resolution L1B file -delete-hkm Delete 500m resolution L1B file -delete-qkm Delete 250m resolution L1B file -save-log Save the Level 1B processing log % UNIX Command Line
  56. 64. Level 1B processing example: % modis_L1A_to_L1B.csh A2005205180000.L1A_sub A2005205180000.GEO_sub -delete-hkm -delete-qkm Example Processing using the UNIX command line
  57. 65. Level 2 processing example: % ms_met.csh A2005205180000.L1B_LAC % ms_ozone.csh A2005205180000.L1B_LAC % ms_oisst.csh A2005205180000.L1B_LAC ...this will create three files: A2005205180000.L1B_LAC.met_list A2005205180000.L1B_LAC.ozone_list A2005205180000.L1B_LAC.sst_list ...then you could run msl12 on the UNIX command line: % msl12 par=A2005205180000.L1B_LAC.met_list par=A2005205180000.L1B_LAC.ozone_list par=A2005205180000.L1B_LAC.sst_list ifile=A2005205180000.L1B_LAC geofile=A2005205180000.GEO_sub ofile1=A2005205180000.L2 Example (cont’): Processing using the UNIX command line
  58. 66. SeaDAS can be completely automated using: - IDL command files , and/or - IDL procedures , and/or - UNIX shell scripts For certain things it makes sense to use IDL, other things can be done more simply and quickly using UNIX. Automating SeaDAS Processing
  59. 67. ;;; this is an IDL command file ;;; ; modify &quot;*L2_LAC&quot; to match the filename pattern of your L2 files filenames=findfile('*L2_LAC') for i=0, n_elements(filenames)-1 do begin & $ base=strmid(filenames,0,14) & $ outfile = base+'.L3b' & $ print, &quot;Running l2bin on &quot;, filenames(i) & $ l2bin, ifile=filenames(i), $ ofile=outfile(i), resolve=4, $ FLAGUSE='ATMFAIL,LAND,HILT,HISATZEN,STRAYLIGHT,CLDICE,COCCOLITH, HISOLZEN,LOWLW,CHLFAIL,NAVWARN,ABSAER,MAXAERITER,CHLWARN,ATMWARN, NAVFAIL,FILTER' & $ endfor print, &quot;Finished!” Example Using an IDL command file to automate processing
  60. 68. #!/bin/sh for FILE in *L2_LAC do BASE=`echo $FILE |awk -F. '{ print $1 }'` echo &quot;Running l2bin on $FILE&quot; l2bin infile=$FILE ofile=$BASE.L3b resolve=4 >/dev/null done ls -1r *.L3b >list.txt echo &quot;Running l3bin&quot; l3bin in=list.txt out=M20052022005205.L3b noext=1 >/dev/null echo &quot;Running smigen&quot; smigen ifile=M20052022005205.L3b prod=chlor_a ofile=M20052022005205_smi_CHLOR_A_auto.hdf resolution=4km latnorth=48.0000 latsouth=35.0000 lonwest=-78.0000 loneast=-62.0000 echo &quot;Finished!&quot; Example Using a UNIX shell script to automate processing
  61. 69. fin
  62. 71. When you are assigned a guest # and server, please log onto your server and test SeaDAS: ssh -X guest#@192.168.1.### username: guest# password: guest123 Execute: seadas SeaDAS Server Login