load aster

From DavinciWiki
Jump to: navigation, search

Description

Read an ASTER instrument image and store it in a variable as a davinci structure

Please check the GDAL information for more information about gdal.

Arguments and Return Values

Arguments: Accepts a HDF 4 formatted image file.

Return Value: A davinci structure containing .data, and meta-data

Usage

Syntax: load_aster(filename [, convert, gdal_path][,consolidate=BOOL][,geo=BOOL])

filename - path of the ASTER HDF

convert - Boolean specifies whether to apply correction coefficients to data bands and convert to floating point. 1 --> convert to floating point. Default is 1 -> Yes.

gdal_path - String specifying alternate path to gdal_info utility.

consolidate - restructure the output to a more usable format. Default is 1.

geo - perform a projection from camera like coordinates to the file specified projection using GCPs

Examples

 # load_aster() imports and applies floating point corrections for:
AST_05 -> Surface Emissivity
AST_07 -> Surface Reflectance
AST_08 -> Surface Kinetic Temperature
ASTL1B -> Level 1-B data 
# The function creates temporary PGM files for all bands in the $TMPDIR directory. I also saves the output
from the gdalinfo utility in $TMPDIR/gdal_info.txt
dv> a = load_aster("La_Paz.hdf")   # Load ASTER Level 1B image file into integer buffers
struct, 73 elements
   swir_pointing_angle: "2.884"
   tir_pointing_angle: "2.863"
...
   data_browse_id: "ASTL1A 0008291507420301010377B"
   band1_offset: "-0.675999999046326"
...
   band14_offset: "-0.00522499997168779"
   band1_corr_coeff: "0.675999999046326"
...
   band14_corr_coeff: "0.00522499997168779"
   band1_path: "/tmp/dv_31214//band_1.pgm"         # Note: ALL bands are stored as PGM images withing $TMPDIR/
...
   band14_path: "/tmp/dv_31214//band_14.pgm"       # Note: ALL bands are stored as PGM images withing $TMPDIR/
   short_name: "ASTL1B"
   gdalinfo_file: "/tmp/dv_31214//gdalinfo.txt"    # Note: output of gdalinfo is located in $TMPDIR/gdalinfo.txt
   data: struct, 15 elements
       band1: 4980x4200x1 array of byte, bsq format [20,916,000 bytes]
       band2: 4980x4200x1 array of byte, bsq format [20,916,000 bytes]
       band3N: 4980x4200x1 array of byte, bsq format [20,916,000 bytes]
       band3B: 4980x4600x1 array of byte, bsq format [22,908,000 bytes]
       band4: 2490x2100x1 array of byte, bsq format [5,229,000 bytes]
       band5: 2490x2100x1 array of byte, bsq format [5,229,000 bytes]
       band6: 2490x2100x1 array of byte, bsq format [5,229,000 bytes]
       band7: 2490x2100x1 array of byte, bsq format [5,229,000 bytes]
       band8: 2490x2100x1 array of byte, bsq format [5,229,000 bytes]
       band9: 2490x2100x1 array of byte, bsq format [5,229,000 bytes]
       band10: 830x700x1 array of short, bsq format [1,162,000 bytes]
       band11: 830x700x1 array of short, bsq format [1,162,000 bytes]
       band12: 830x700x1 array of short, bsq format [1,162,000 bytes]
       band13: 830x700x1 array of short, bsq format [1,162,000 bytes]
       band14: 830x700x1 array of short, bsq format [1,162,000 bytes]
...
dv> display(sstretch(a.data.band1, ignore = 0))    # Stretch and display visible wavelength band 1
dv> a =  load_aster("La_Paz.hdf", 1)   # Load ASTER Level 1B image file into floating point buffers
struct, 73 elements
   swir_pointing_angle: "2.884"
   tir_pointing_angle: "2.863"
...
   data_browse_id: "ASTL1A 0008291507420301010377B"
   band1_offset: "-0.675999999046326"
...
   band14_offset: "-0.00522499997168779"
...
   short_name: "ASTL1B"
   gdalinfo_file: "/tmp/dv_31214//gdalinfo.txt"       # Note: output of gdalinfo is located in $TMPDIR/gdalinfo.txt
   data: struct, 15 elements
       band1: 4980x4200x1 array of float, bsq format [83,664,000 bytes]
       band2: 4980x4200x1 array of float, bsq format [83,664,000 bytes]
       band3N: 4980x4200x1 array of float, bsq format [83,664,000 bytes]
       band3B: 4980x4600x1 array of float, bsq format [91,632,000 bytes]
       band4: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band5: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band6: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band7: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band8: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band9: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band10: 830x700x1 array of float, bsq format [2,324,000 bytes]
       band11: 830x700x1 array of float, bsq format [2,324,000 bytes]
       band12: 830x700x1 array of float, bsq format [2,324,000 bytes]
       band13: 830x700x1 array of float, bsq format [2,324,000 bytes]
       band14: 830x700x1 array of float, bsq format [2,324,000 bytes]
...
dv> display(sstretch(a.data.band14, ignore = 0))    # Stretch and display thermal IR band 14
dv> a  = load_aster("Seoul_AST_07.hdf", 1)   # Load ASTER Surface Reflectance image file. Apply corrections
struct, 78 elements
   swir_pointing_angle: "-8.492"
...
   scale_factor_1: "0.0"
   scale_factor_2: " 0.0"
   scale_factor_3N: " 0.0"
   scale_factor_3B: " 0.0"
   scale_factor_4: " 0.001"
   scale_factor_5: " 0.001"
   scale_factor_6: " 0.001"
   scale_factor_7: " 0.001"
   scale_factor_8: " 0.001"
   scale_factor_9: " 0.001"
   scale_factor_10: " 0.0"
   scale_factor_11: " 0.0"
   scale_factor_12: " 0.0"
   scale_factor_13: " 0.0"
   scale_factor_14: " 0.0"
   gdalinfo_file: "/tmp/dv_31214//gdalinfo.txt"       # Note: output of gdalinfo is located in $TMPDIR/gdalinfo.txt
   data: struct, 6 elements
       band4: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band5: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band6: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band7: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band8: 2490x2100x1 array of float, bsq format [20,916,000 bytes]
       band9: 2490x2100x1 array of float, bsq format [20,916,000 bytes]

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Recent Library Changes

Created On: 03-06-2009
Modified On: 04-25-2013

Personal tools