Exercises in Using IPW, TOPORAD, and TOPQUAD

1. TOPQUAD Exercises

In this exercise, you'll run TOPQUAD several times - 27 times in fact. In the tutorial, we cheated for demonstration purposes and used mean atmospheric parameters for the entire solar spectrum, even though we KNEW that was a bad thing to do!

For this exercise, make a new directory and copy your DEM.ipw file and your Albedo.ipw file into it.

1. Run TOPQUAD 27 times, once for each of the 0.1 um wavelength regions noted in the tutorial. Be sure to change the -t, -w, -g, and -x switches , and the output file names for each run.

  • Hint: this could take a while, and it's repetitive so you might make a mistake as you become increasingly bored. Try setting up a shell script to do it for you, so you can take a nap or go get coffee.

  • All you need to do is set up a file with 27 lines of input, with the appropriate changes on each line. Since the input lines are long and may probably need two lines, end the first line with a backslash \ so that IPW knows another line is coming.

  • Finally, change the file permissions to make it executable by typing


    chmod +x filename

    then execute the filename by typing it's name.

  • 2. Now you need to integrate the 27 spectral images into one image that has the total irradiance. You could guess that we might be using mux here, and you'd be right! But mux just interleaves the images together into one multiband file. We need to add them all together, which we can do using the IPW command lincom:


    lincom -- linear combination of bands

    Usage: lincom [-c coef,...] [-n #bits] [image] > [newimage]

    Options:

    c: band coefficients (default 1/nbands)
    n: # bits / output pixel (default from input image)

    Operands:

    image: input image file
    newimage: output image file

    So, to set up the spectral integration, you need to type:


    mux file1 file2 file3...file27 | lincom -c 1 > TotalSol.ipw

    You can put this at the end of your shell script, but don't forget to add the backslash at the end of every unfinished line.


    3. Compare your TotalSol.ipw file with the TquadOUT.ipw file you created in the tutorial. Are they similar? Have you improved anything by taking this longer approach?


    2. TOPORAD Exercises

    In this exercise, you'll run TOPORAD once for each hour of daylight during a single day. The day starts off cloudy, but clears through the morning, gets cloudy again during the afternoon, and finally clears off again in the evening, as shown in the figure below. Under clear conditions, the curve would ascend and descend smoothly and nearly symmetrically. These data were measured on Niwot Ridge on August 4, 1995. They are measured on a flat plane.


    The hourly average data (in W m^-2) are shown below:

    Hour	Kdown
     1  	0
     2  	0
     3  	0
     4  	0
     5  	0
     6  	4.3	*
     7  	35.9	*
     8  	180.3	*
     9 	590.4	*
     10 	778.7	*
     11 	936.7	*
     12 	995.1	*
     13 	593.1	*
     14 	414.4	*
     15 	339.4	*
     16 	249.6	*
     17 	354.6	*
     18 	322.4
     19 	203.5
     20	2.4
     21 	0
     22 	0
     23 	0
     24 	0
    

    If you use the clear sky atmospheric parameters for the entire day, you would expect to overestimate the irradiance during most of the afternoon. In this exercise, you'll run TOPORAD for part of the day using clear sky parameters, and part of the day using cloudy sky parameters. Consider only the daylight hours from 6:00 a.m. through 6:00 p.m..

    1. To begin, you need to determine which hours should be considered clear, and which should be considered cloudy. One way to do this is to compute the exoatmospheric irradiance, determine a ratio of surface/exoatmospheric irradiance on a flat surface, and use this ratio as an index of cloud cover. In doing so, you'll generate all the necessary solar geometry data you'll need to run TOPORAD later on.

    This is a good time to set up a couple of shell scripts, as described earlier in the tutorial. It will save you a lot of work!


    Run the IPW program sunang for each of the 12 hours of daylight between 6:00 a.m. and 6:00 p.m.. The following shell script will do this for you:

    sunang -t 1996,8,4,6 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,7 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,8 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,9 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,10 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,11 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,12 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,13 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,14 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,15 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,16 -z -420 -b 40,2,30 -l 105,35,0
    sunang -t 1996,8,4,17 -z -420 -b 40,2,30 -l 105,35,0
    

    Running this will output the cosines of the Zenith angles and the solar azimuths for each hour of the day.

    Now, for purposes of determining the exoatmospheric irradiance on a flat surface, you need to find out the exoatmospheric solar irradiance on a surface normal to the incidence angle (Snormal) by running the IPW program solar for the wavelength range 0.3-3.0 um.

    The exoatamospheric irradiance on a flat plane is given by:

    ESflat = cosZ * Snormal

    Now you can calculate the transmissivity index ratio T (%) as:

    			Kdown
    		T =    -------   *   100
    			ESflat
    

    Note that T is low in the early morning when it was cloudy, increases markedly through the morning to midday when it was clear, decreases again through the afternoon when it was cloudy again, and then increases in the early evening when the skies clear again.

    As an arbitrary indication for determining atmospheric parameters for TOPORAD, let's say that if T is greater than 60%, the atmosphere is clear, and if it is less than 60%, it is cloudy. You already know the clear sky atmospehric parameters; the cloudy sky parameters are given below:

    Wavelengths	tau	omega	gamma
    0.3-0.4		1.42 	.77 	.06
    0.4-0.5		0.63 	.98 	.13
    0.5-0.6		0.46 	.68 	.20
    0.6-0.7		0.36 	.59 	.26
    0.7-0.8		0.31 	.81 	.34
    0.8-0.9		0.24 	.97 	.41
    0.9-1.0		0.27 	.76 	.44
    1.0-1.1		0.16 	.96 	.49
    1.1-1.2		0.29 	.53 	.46
    1.2-1.3		0.14 	.84 	.53
    1.3-1.4		0.96 	.26 	.26
    1.4-1.5		0.55 	.13 	.44
    1.5-1.6		0.11 	.77 	.56
    1.6-1.7		0.09 	.78 	.58
    1.7-1.8		0.12 	.70 	.58
    1.8-1.9		1.58 	.01 	.40
    1.9-2.0		0.74 	.06 	.39
    2.0-2.1		0.28 	.06 	.37
    2.1-2.2		0.07 	.68 	.59
    2.2-2.3		0.09 	.30 	.45
    2.3-2.4		0.15 	.10 	.37
    2.4-2.5		0.25 	.15 	.42
    2.5-2.6		3.82 	.01 	.33
    2.6-2.7		6.58 	.01 	.25
    2.7-2.8		7.92 	.01 	.21
    2.8-2.9		1.97 	.01 	.28
    2.9-3.0		0.42 	.02 	.34
    

    2. Next, you'll need a new albedo image of 0.3's instead of 0.6's (since this is August, not May!). You can modify your mask image using a new linear quantization header to do this.

    3. Now it's time to begin the TOPORAD runs. You're going to be running TOPORAD 27 times for each of 12 hours, or 324 times! You'll definitely want to set up some shell scripts to handle the processing tasks.

    First, you'll need to run the IPW program shade once for each of the 12 hours. Since you've already run sunang for each hour, just plug the numbers into shade. To do this, you can set up a shell script similar to the one for sunang, except you'll need to write the results of each shade command to a separate file, e.g.shade6.ipw, shade7.ipw,...etc.

    Next, set up the elevrad runs. Remember you have to run elevrad once for each hour/wavelength combination - 324 times. In the interest of conserving computer space, you'll need to carefully plan out how you are going to do this.

    You need to set up 27 TOPORAD runs for each hour - thats 27 different erad images from elevrad, which then get muxed into 27 TradIN images. These are multiband images that will take up a lot of space. Set up a script or two to generate the 27 TradIN images, then run TOPORAD on each, and use the lincom command to add them all together. You'll have the solar irradiance for that hour finished, so you can delete all the erad and TradIN images and start fresh on the next hour.

    4. Once you have 12 TradOUT images, you're finished with the processing. Take a look at each of them using xv2 (remember you'll need to requantize to 8-bit first). How do the cloudy/clear hours compare?

    5. Be sure to delete unneeded image files before you quit. This includes the shade images, the elevrad images, and the muxed TradIN images.


    If you want to return to the Overview Page, Click Here!

    If you want to return to the IPW data importing tutorial, Click Here!

    If you want to return to the Viewing IPW images tutorial, Click Here!

    If you want to return to the TOPORAD/TOPQUAD tutorial, Click Here!