(NASA-CR-176612) A LABORATOR Y INVESTIGATION N86-23436

OF TBE VABIABILITY OF CLOUD EEfLECTED

RADIANCE FIELDS Final Technical Report

(Colorado State Univ.) 72 p EC A04/MF A01 Unclas

CSCL 20F G3/74 05745

FINAL TECHNICAL REPORT

FOR

NASA Grant NAG5-387

entitled

A Laboratory Investigation of the Variability

of Cloud Reflected Radiance Fields

Principal Investigator: Thomas B. McKee

Co-Investigator: Stephen K. Cox

Department of Atmospheric Science

Colorado State University

Fort Collins, Colorado 80523
FINAL TECHNICAL REPORT

TABLE OF CONTENTS

Page

1.0 Design and construction of a laboratory apparatus (CFOS) to

simulate the interaction of cloud fields with visible

radiation 1

A. The Source 1

B. The Cloud Field Assembly 4

C. Sensor Array 5

D. Data Display/Collection Station 5

2.0 Verification of CFOS by comparing experimental results from

it with calculations performed with a Monte Carlo radiative

transfer model 7

A. Selection of Suitable Materials for Cloud Simulation 7

B. The Optical Depth of Simulated Clouds 10

C. Retrieval of Basic Finite Cloud Features 11

3.0 Development of a Software Library to Process, Reduce and

Display CFOS Data for use in Research Studies 14

Introduction 14

Part I 15

A. Laboratory Procedures 15

B. Section 1 15

1. Source Alignment 15

C. Section 2 17

1. Calibration 17

2. A Typical Data Collection Session 19

Part II . 20

References 23

5.0 Publications and Reports 38

6.0 Statement on Inventions 39

APPENDIX - Data Reduction and Analysis Programs

for the Cloud Field Optical Simulator 40
- 2 -

FINAL TECHNICAL REPORT

During the term of support by NASA of this research program, we have

successfully developed a new approach to determining the radiative

properties of complex cloud fields. This innovative research began as a

unique, untried concept and has matured into a verified, useful

technique. The accomplishments of this research are highlighted below.

Following the highlights are brief explanations of each accomplishment.

Accomplishments:

o Design and construction of a laboratory apparatus (CFOS) to

simulate the interaction of cloud fields with visible

radiation.

o Verification of CFOS by comparing experimental results from it

with calculations performed with a Monte Carlo radiative

transfer model.

o Development of a software library to process, reduce and

display CFOS data for use in research studies.

o Utilization of CFOS to study the reflected radiance patterns

from simulated cloud fields.

1.0 Design and construction of a laboratory apparatus (CFOS) to simulate the

interaction of cloud fields with visible radiation.

The CFOS apparatus is designed to measure the simulated reflection

of shortwave radiation by optically thick clouds. The CFOS basically

consists of a light source, a target cloud field, an array of radiation

detectors and a data display/collection system. Fig. 1 shows a schematic

of the CFOS which is housed in a 10 m X 10 m dark room at the Department

of Atmospheric Science at Colorado State University. Each of the

components which comprise the CFOS has been selected or designed to

simulate as closely as possible the actual interaction of visible solar

radiation with real clouds and to perform measurements on the simulation

analogous to the real world case. Each aspect of the CFOS is described

below along the rationale used in selecting various options in the

components design.

A. The Source

In simulating the interaction between the visible solar irradiance

and clouds it is desirable to duplicate as closely as possible three

characteristics of the natural source. First, the source should possess,

to the extent possible, a visible spectrum of a 5700 K blackbody

radiator. Second, the beam irradiance should be uniform across the area

of the cloud field, and third, the beam should be parallel. Because the

cost of constructing a solar simulator approaching the above description

would have been prohibitive, efforts were focused on achieving the latter

two characteristics for the following reasons. First, theoretically, the

spectral distribution of the incident radiation is important only in

relation to the microphysical properties of the cloud; i.e. scattering
- 3 -

data display/collection

Light Source

Detail of Detector

Configuration

1mm

I4m

n

m

I 1mm

T. .i

T

T

I4mm

3mm diameter

diameter

1mm thick

^Schott 8G-18 Filter

EG8G PV-IOOA

PHOTODIODE

Detail of Lamp

Configuration

18cm

radius

Light Source Consists

of 5 G.E. 240 PAR56WFL Lamps

Figure 1. A schematic drawing of the Cloud Field Optical

Simulator (CFOS) designed to simulate the

interaction of visible solar radiation with optically

thick clouds.
- 4 -

properties at a wavelength A are determined only as a function of the

ratio \/r, and where r is the radius of the droplet. Since simulated

clouds used in the CFOS are not composed of droplets (much less the

specific droplet distributions measured in real clouds) and in view of

the considerations given above, achieving the proper spectral response

was given a lower priority and emphasis was given to designing a source

which fulfilled the remaining criteria. Maintaining the proper spatial

characteristics of the beam, as specified in the second and third

criteria listed above, assures that the effects of cloud geometry are

accurately taken into account. Doing so, even at the expense of

achieving less than optimum spectral characteristics, is consistent with

recent findings concerning the importance of cloud geometry. To these

ends it was found that an array of low voltage display lamps provided

illumination with the best spatial uniformity over the target cloud

field. The low voltage design of the lamps allows small filament

assemblies to be precisely placed at the focal points of accurately

molded reflectors. The result is a smooth illumination curve which

decreases slowly (1% in the first 4°) as a function of the angle from the

beam axis of each lamp. Use of an array of overlapping beams, each aimed

at a different section of the cloud field, results in an irradiance

uniform to within ±3% of the mean value in the plane of the cloud field.

The source was placed behind a circular aperture 0.5 m in diameter to

shield the cloud field from stray light and to constrain the beam to

within 3° of its axis, thus assuring nearly parallel light. The beam is

reflected by a large plane mirror in order to allow enough distance

(20 m) for the nearly parallel beam to diverge to a cross section

sufficient to illuminate the entire target area (-3 m2). Although the

source output is reasonably constant in " time, it is monitored by a wide

field-of-view detector near the cloud field so that the effects due to

even small variations may be accounted for in the analysis.

B. The cloud field assembly

The target cloud field assembly consists of the simulated clouds and

the hardware necessary to support and orient the clouds with respect to

the incoming radiation and the detectors. The assembly is contained in a

separate ilmX^mX^ m black box in the laboratory room. The types of

materials used to construct the simulated clouds are discussed in

Sections 3a-c. As shown in Fig. 1 , the target cloud field is mounted in

a circular area ~2 m in diameter. The incoming radiation enters through

a large aperture in one face of the box. The target cloud field is

oriented in a vertical plane and has two rotational degrees of freedom.

The first of these allows rotation about the vertical axis of the cloud

field and simulates changing solar zenith angle. The second-rotation is

about a horizontal axis through the center of and perpendicular to the

plane of the cloud field which allows simulation of a change in solar

azimuth angle. Each of these rotations is driven by a separate motor and

may be controlled at the data display station. The rotations are

monitored to the nearest degree through the use of optical encoders and

associated logic circuitry. Any sun-cloud geometry of interest may be

easily simulated in the CFOS as a result of this design.
- 5 -

C. Sensor array

In order to examine the relationship between the summative and

component properties of radiation reflected from the simulated clouds it

is necessary to sample the radiation field from a number of angular

viewing coordinates. The placement of the CFOS sensors with respect to

the cloud field may be seen in Fig. 1. Fifteen sensors are mounted on a

semi-circular ring whose ends are attached to the cloud field apparatus

at points above and below the cloud field on its vertical diameter which

serves as an axis of rotation for the ring. The sensors are spaced at

increments of 10° of arc along the ring, beginning at the center of the

ring and proceeding toward its ends. This sensor configuration permits a

density of angular sampling of the reflected radiation which is more than

adequate to establish the relationships between the desired quantities.

Each sensor consists of a high-quality silicon photodiode with a

built-in high-gain operational amplifier circuit. The diodes are mounted

in small cylindrical enclosures each of which contains a spectral filter

and two circular diaphragms. The diaphragms limit the field of view of

each photodiode to 7.5° half-angle. The relative spectral responses of

the detectors with and without the optical filters are shown in Fig. 2.

The filtered spectral response corresponds closely to that of the human

eye. Thus, features visually observed should be evident also in the

measurements. The field of view of the detectors is such that the center

detector resolves a circular area 0.5 m in diameter when viewing the

cloud field at the nadir. By using the relationships between the optical

and geometric properties of simulated and real clouds (see Sections 3a~c)

it is possible to associate the CFOS sensor configuration with that of a

real world sensor 100 km above the earth's surface with a nadir ground

resolution of 25 km.

D. Data display/collection station

One of the advantages of a laboratory investigation of the radiative

properties of clouds lies in the ability to observe an unchanging cloud

field from a variety of angular coordinates. This feature is fully

appreciated by observing the changes in the various detector voltages as

the "sun-cloud-sensor" geometry changes. The output of each sensor

including the source monitor may be read from digital voltmeters at the

data display/collection station. An array of light-emitting diode bar

graph displays indicates the voltage outputs of all 15 diodes

simultaneously, giving an instantaneous sample of the radiance patterns.

The simulated solar zenith and azimuth angles and the angle of rotation

of the detector ring are controlled from and monitored at the display

station.

In order to examine the structure of the radiance patterns and to

detect changes in the field or image as the clouds' geometric properties

are changed it is necessary to assemble all measurements into a single

representation of the reflected radiance pattern. This is accomplished

in two stages by the CFOS. First, the data are recorded using an Apple

II microcomputer as a smart data collection device. Various parameters

such as sampling rates and the numbers of measurements included in

average readings may be programmed into the data collection process.

Second, the data from the floppy diskette in the Apple II are transferred
- 6 -

I 0

09

03

S °7

I °6

t/1

£ °5

<U 04

>

^ 03

OJ

o: 02

o i

o

o i

Original Response

Filtered Response

o s 06 07 O 8 09 10

Wavelength in Microns

Figure 2. The relative spectral responses of the detectors used

in the CFOS with and without optical filters.

JO 5 06 "°"

 n •>- — °""~^7

( r

I65"< <£ < ISO'

09

08

07

Monte Carlo Calculated, r=74

Cotton Simulated, T'80

0'< <b < 15'

Figure 3- A comparison of the relative radiances reflected into

the principal plane by cotton-simulated clouds (measured

by the CFOS) to those calculated using a Monte Carlo model

for water clouds. Comparisons are shown for solar zenith

angles of 60° and 0 °. (Only one of the symmetric branches

is shown in the 0° case). Note that the uncertainty in

observed and modeled relative radiances are a function of

the observation zenith angle. The error brackets shown are

maximum values typical at y = 0.55. Uncertainties near

y = 1.0 are about half these maximum values and are indicated

by the error bars.
to an Apple III microcomputer where they are processed. The processing

is relatively simple; measurements are rotated into a nadir-relative

azimuth angle coordinate system, voltages are divided by relative

sensitivities, effects caused by variations in the source are removed,

the reflected radiances are integrated over the lower hemisphere to

obtain a flux density, and various graphical displays are generated. The

total time of the processing of the data is -15 min. Thus, experiments

may be repeated for slight perturbations in the cloud field geometry and

changes in the radiance field may be appreciated within a short time.

Also, data and displays from the radiance patterns may be saved on

diskette files for later viewing and comparison.

The CFOS apparatus described above should provide insight into the

composition of wide field of view satellite measurements and images. It

offers an interactive setting in which cloudy scenes may be created,

observed visually, and whose relative radiance fields may be measured

quantitatively. The next section describes the verification of the CFOS

and in doing so furthers the appreciation of the similitude between the

CFOS and the real world.

2.0 Verification of CFOS by comparing experimental results from it with

calculations performed with a Monte Carlo radiative transfer model.

The previous sections have described a laboratory device designed to

measure the simulated radiative properties of clouds of a realistic

shape. In the sections which follow the properties of the simulated

clouds and the relationship of their scattering properties to those of

simulated water clouds are discussed. The verification of the CFOS is

based not on analogies between the microphysical properties of real and

simulated clouds, but rather on comparisons of observable radiative

properties.

A. Selection of suitable materials for cloud simulation

The validity of measurements obtained from the CFOS depends, almost

entirely, on the measurable radiative properties of the simulated clouds.

Several materials were examined in a search for one which adequately

simulates the visible reflective properties of optically thick clouds.

The criteria which were examined in the selection process were first, the

behavior of the radiances reflected into the principal plane by a

horizontally semi-infinite cloud, and second, the visual appearance of

the simulated clouds and cloud fields. Based on these criteria, two

materials emerged as superior to all others tested; they are surgical

quality sterilized cotton and decorative billet (DB) styrofoam which is

marketed by Dow Chemical under product code #81568.

It should be emphasized that the manner in which light interacts on

the microphysical scale with the materials selected may differ

considerably from the classical picture of independent Mie scattering in

a spherical polydispersion. For example, the surgical cotton used in the

experiments consists of long fibers of mainly cellulose from 10 to 25 ym

in diameter. The mean index of refraction of cellulose is 1.55 in the

mid-visible. The DB styrofoam is a polystyrene extrusion. It contains

no pigments or other suspensions and has a mean cell dimension of 1.9 mm.

The index of refraction of polystyrene is 1.59-1.60 in the visible.
o-o-o Monte Carlo Calculated, r-^

Slyrofoom Simulated, r = 38

165" A <I80'

Figure 4. As in Fig. 3, but for styrofoam-simulated clouds,
- 9 - ORIGINAL PAGE IS

OF POOR QUALITY

Figure 5. Photographs of a styrofoam-simulated cloud system.

The bottom photograph is an enlargement of the first

showing the detail of the area between the simulated

cumulonimbus clouds.
- 10 -

Polystyrene is a transparent plastic. The white appearance of styrofoam

results 'from multiple reflections of the incident light from the many

facets which surround the individual cells. Thus, it would be difficult

to draw an analogy between the local scattering process in water clouds

and the multiple reflection process in styrofoam. Moreover, recent

studies have shown that cloud shape may dominate microphysical scattering

as the most important factor affecting the radiance pattern. Also, it is

doubtful that any material which closely duplicates the scattering

process in water clouds would possess an extinction coefficient great

enough to permit simulation of optically thick clouds in a laboratory

setting. The goal of the CFOS experiment is to determine if it is

possible to simulate the observable properties of optically thick clouds

of a realistic shape and not necessarily to duplicate the exact

scattering process on the microphysical scale. Thus the determination of

which materials are best qualified as simulation materials is based on

comparison of observable optical properties of the simulation materials

with those predicted by radiative transfer models of real water clouds.

Such comparisons have been made for "horizontally infinite" and cubic

finite cloud shapes.

Figures 3 and 4 show comparisons between the radiances reflected

into the principal plane by horizontally infinite cotton and styrofoam

simulated clouds compared with theoretical curves derived from a Monte

Carlo radiative transfer calculation. The model was run for a C.1

(Deirmendjian, 1969) droplet distribution with an absorption for a

wavelength of 0.7 ym and for solar zenith angles with cosines of y =1.0

and u = 0.5. The radiances have been normalized to the value at the

zenitn and are displayed as a function of the cosine of the zenith angle

(M) and the relative azimuth angle <j> into which they are reflected.

Scattering into the forward direction (0° £ <}> S15°) is depicted in the

right halves of the figures and backscatter (165° ^ <J> ^ 180°) is

indicated in the left halves. The materials are almost equivalent in

satisfying the first criterion. The styrofoam-simulated clouds display a

slightly more realistic behavior in the backscatter direction.

Both materials do well in simulating the visual appearance of real

clouds. Fig. 5 shows photographs of styrofoam-simulated clouds of a

realistic shape. If we add a third criterion, the ease of working with

the materials, styrofoam is preferable for the following reasons. First,

styrofoam is rigid and will maintain a constant ratio of geometric to

optical depth, and the shape of simulated clouds will be retained

regardless of orientation. Second, the simulated styrofoam clouds are

easily placed and maneuvered in a cloud field and may be categorized and

stored for use in other cloud scenes. Finally styrofoam clouds are

easily made into regular shapes i.e., cubes, cylinders, spheres, etc., so

that their radiation properties may be compared with theory.

B. The optical depth of simulated clouds

In order to relate the reflective properties of simulated clouds to

real water clouds it is necessary to have an accurate estimate of the

optical depth of the simulated clouds. One means of doing so is based on

the bulk radiative properties of a 'horizontally-infinite1 sheet of the

cloud material at 0° zenith. Specifically, theory predicts that the

ratio of the spectral reflectance R to the spectral transmittance TA of

a semi-infinite cloud over a non-reflecting surface is nearly a linear
- 11 -

function of optical depth (see, e.g., Coakley and Chylek, 1975; Stephens,

1978). Fig. 6 shows a plot of the ratio of R/T generated from the

parameterization of Stephens (1978) for water clouds in the visible

portion of the spectrum. The solid curve shown in the figure is the

result of a linear regression of the form R/T = tdm + 8.307)7153- 1 49,

which is nearly linear for 10 < T < 200. Also shown is the ratio (R./T,)

calculated using an Eddington model for various microphysical

distributions and a few results of the HA/TA ratio from Monte Carlo

calculations. The nearly linear dependence between R/T and T, the

visible optical depth, is apparent.

An equivalent visible optical depth de) may be assigned to the CFOS

cloud material by measurement of the ratio of R/T for a sheet of the

material with a large ratio of horizontal to vertical dimension. Once T

is established for a large slab of styrofoam several clouds may be

"sculptured" from the slab while maintaining in each the vertical

dimension of the original slab. The procedure requires an additional

stop in the case of cotton since the vertical structure of the original

"slab" (surgical cotton is available in 12" X 60" sheets) cannot be

maintained while forming clouds of a realistic shape. However, it was

found that the mass of the material in a vertical column of unit cross

section is also related to the ratio of the R/T in a nearly linear manner

(see Fig. 7). Thus, for a cloud simulated from surgical cotton on

approximate visible optical depth may be assigned by weighing the cloud

and measuring its cross-sectional area to determine the area mass

density, then using the R/T line as a transfer function to obtain T .

s

C. Retrieval of basic finite cloud features

A crucial test of the CFOS is the ability to measure the reflected

radiances of finite clouds. Figs. 8 and 9 show comparisons between

radiances reflected into the principal plane by finite clouds as measured

on the CFOS and the same quantities predicted by the theoretical Monte

Carlo model described in McKee and Cox (1976). The radiances in each

case have been normalized by the radiance measured or calculated at the

zenith. The CFOS profiles have been retrieved from measurements over a

field of simulated (styrofoam) cubic clouds cut from a slab of material

whose R/T ratio corresponded to an equivalent vertical optical depth

T

e = 76. The simulation clouds were placed at the centers of adjacent

squares of sides 5w, where w is the dimension of the finite cubic cloud.

This arrangement resulted in a true fractional cloud cover f = 0.04. The

cloud rows were aligned along two mutually perpendicular axes, one of

which formed the line of intersection of the principal plane with the

surface. Figs. 8 and 9 show measured retrievals. The first (applicable

only for observation of the cloud field in the direction of the cloud

rows) assumes that as the observation zenith angle (0) increases, the

solid angle of the observed cloud field relative to the underlying

surface increases by a factor of 1 +• tan6, resulting in a modified

fractional cloud cover f given by

, =/f(i + tane), e < emax

In the above,

 F

max is the fractional cloud cover derived as the tops and

sides of the cubic clouds maximally obscure the inter-cloud spacing.

Note, in the present case, for observations taken in the principal plane
- 12 -

£ 6 1

o

'-> 3

_0

O

2 ' '

&

S,'

* Eddinqton, C 5, X : O7u m

o Eddington, Best , X = 07um

x Monte Corfo, C I, X = 0 7um

• Eddington, C I, X = 07um

— Stephens, (1978). visible

IO 20 3O 40 50 60 70 80 90 IOO

Visible Opticol Depth

Figure 6 . The ratio of reflectance to transmittance for horizontally

infinite clouds plotted as a function of optical depth in

the visible region of the spectrum for a solar zenith angle

of 0°. Values of the ratio from the Eddington and Monte

Carlo models are valid at 0.7 ym, values from Stephens (1978)

are representative in the visible (X < 0.75 ]_im) .

Equivolent Opttcol Depth re

60 90

01 02 03

Area Moss Density (9/cm 2)

Figure 7. The ratio of reflectance to transmittance for cotton

simulated "horizontally infinite" clouds plotted as a

function of the area mass density of the material which

is used as a transfer function to obtain the equivalent

optical depth of simulated clouds.
- 13 -

,-•1 0

t-*H h4"l

I i c

o .

•5

a

a:

>

o

a: .

o_o-o Monte Carlo, r=73 5

, 5 * * * CFOS, v 7&- f'--Ml+fon0)

,4 xxx CFOS, re= 76, Summation of Ucld

1 3

I 2

l i

05 06 07 OB 09 O9 08 O7 06 OS

Figure 8. A comparison between calculated and simulated radiances reflected

from finite cubic clouds into the principal plane for a solar

zenith angle of 0° using styrofoara as the cloud simulation

material. (Only one of the symmetric btanches is shown for the

modeled results.) Note that the uncertainty in observed and

modeled relative radiances are a function of the observation

zenith angle. The error brackets shown are maximum values typical

at u = 0.55. Uncertainties neary= 1.0 are about half these

maximum'values and are indicated by the error bars.

Ho-05

05

I65'< <j> * ISO*

09

09

0 7

06

05

o—o—o Monte Corlo, r - 73 5

+ » » CFOS, rf= 76,f'=f(MonSl

xxx CFOS, T, =76, Summation of field

!

T

09 O8 07 06 05

15'

Figure As in Fig. 8, but for a solar zenith angle of 60C
- 14 -

(parallel to the row directions), f = 0.20 and 9max = 76°, which is

larger than the zenith angle of any of the observations depicted below,

so that the first line in the equation above applies. The second

treatment utilized the exact geometry of the cloud field and the CFOS

detectors, counted the clouds in the field of view, and calculated the

total solid angle subtended by the clouds and their shadows. In this

interpretaiton the radiance measurement (N) is given as

N = N'Q+ N . ' fl. + n ' 8 ^ eld eld

 1Ncir cir u sdw

where the subscripts eld, clr, and sdw represent cloud, clear and shadow,

respectively, and ti is the fractional solid angle subtended by each

target component. It was assumed that there was no radiance contribution

from the shadow regions. The clear measurements were made of the surface

on which the clouds were mounted in the absence of the clouds. The

albedo of the surface was 0.02. The second treatment resulted in a

"noisier" curve because a single cloud was either considered completely

within or exterior to the field of view. Nevertheless, smoothed versions

of the curves are in good agreement. The apparent disagreement between

the curves for the 0° solar zenith case at large observation zenith

angles is principally from two factors. First, the styrofoam material is

least faithful in its reproduction of the reflected radiance of real

clouds at the larger observation angles as evidenced in the comparisons

for horizontally infinite clouds in Fig. 1. Second, in the Monte Carlo

model, for a 0° solar zenith angle, there is no radiation incident on the

vertical side walls of the cubic clouds. However, in the laboratory, the

incident radiation is not parallel in the strictest sense. Thus, over

the extended cloud field, some incident radiation falls on the vertical

walls of some of the simulated clouds. This results in relatively

brighter side walls in the simulated case which contribute greatly to the

radiance field at larger observation zeniths.

It should be-noted that the retrieval of the finite cloud reflected

radiances described above represents a rigorous test of the CFOS concept.

The low surface albedo (0.02) combined with the extremely small

fractional cloud cover (0.04) resulted in reflected radiances at the

lowest bound of the domain for which the CFOS was designed. Larger

clouds, smaller cloud spacing and more realistic simulated surfaces will

all tend to increase the radiance signal. In addition, the above

experiment represents the retrieval radiances reflected from only part of

the scene. Measurements of total scene radiances are of a more stable

nature.

3.0 Development of a software library to process, reduce and display CFOS

data for use in research studies.

Introduction

This manual was written in order to provide a transfer of established

methodology used in the operation of the Cloud Field Optical Simulator

(CFOS) to interested users of the device. Throughout this document it is

assumed that the reader is familiar with the basic design and purpose of

the CFOS. If this is not the case the reader is referred to a publication

Davis, Cox and McKee (1983), which will provide sufficient backround
- 15 -

information and which may be found in Appendix A. This manual is divided

into two parts. Part one is a description of the methodology of data

collection. In part one the reader will find a discussion of alignment of

the CFOS, calibration of the sensors, and the normal procedure which has

been developed to collect meaningful data. Part two is a discussion of

data processing. The main thrust of part two focuses on how to proceed

from the raw data to an array of bi-directional reflectance data. This,

of course, is not the only product for which the CFOS was designed but

the basic methods are demonstrated in obtaining this type of data. Part

two necessarily discusses some of the application software which has been

written for the CFOS although additional software exists for particular

tasks. All the software is listed in Appendix B along with a brief

statement of its purpose. Finally, it must be noted that all of

procedures associated with the CFOS have been in a constant state of

flux. CFOS itself has always been in part the object of the ongoing

research effort. Thus, especially in using the applications software,

some user familiarity with the code must be established. CFOS is not now,

nor in all probability will ever become a black-box laboratory device.

I. PART I

A. Laboratory procedures

Part I is divided into two sections. Section one presents

suggescions, advice and procedures to ensure that the basic laboratory

device is aligned for data collection. Certain care must be taken before

any data is collected especially if there has been a significant down

period or if it is discovered that the device has been moved or altered

as may happen for instance if items not related to CFOS have been moved

in or out of the basement annex. Section two discusses the calibration

and method of data collection which has been found to provide the best

results to date. It should be stressed at the outset that calibration

should be considered part of the data collection process since it has

been found that the calibration coefficients are not constants. In all of

part one it is assumed that the reader has been briefed on the proper way

to power up the laboratory and on the functions of the various controls

accessed at the data display station.

B. Section 1

1. Source alignment

The source may need to be realigned periodically because of the

reasons mentioned above. The source alignment consists of adjustment of

the relative position and orientation of the light source itself and

the mirror and establishing the zero degree position of the cloud field

ring all of which are interdependent. An iterative procedure has been

developed which seems to work reasonably well; however, it is somewhat

time consuming. One begins by ensuring that the normal to the cloud field

ring is pointing in the approximate direction of the light source. Then

by adjusting the position of the array of lamps so that its lateral

positioning behind the aperture appears symmetric when viewed by an

observer standing on either side of the cloud field ring. In other words,

if you can see all the lamps except for part of one of the lower lamps
- 16 -

when standing on one side of the cloud field ring, then if you move to

the other side of the ring you should be able to see all of the lamps

except for a similar portion of the other lower lamp. The position and

orientation of the mirror may also need adjustment in order to accomplish

this. It may take a few to several adjustments obtain the desired

symmetric alignment.

Next, the true zero zenith angle must be set. To do so it is first

necessary to establish the center of the cloud field with respect to the

direction of the incoming beam. An aluminium bar has been constructed for

this purpose. It is fitted with cylindrical feet on each end which may be

inserted into the holes in the cloud field ring. A small hole has been

drilled in the middle of the bar through which the source light may pass

to form a small image of the lamp source on the cloud field backround.

The image marks the center of the cloud field with respect to the

incoming beam. Next, an alignment photodiode which is mounted in a

circular magnetic support is placed on the cloudfield backround at the

center point. The photodiode is connected to an operational amplifier

circuit and thus requires a supply votage of +/- 15 volts. The output of

the device may be read using a digital voltmeter. By examining the output

of the device for changes in the simulated solar zenith angle about the

initial orientation, one may establish the center of the response

pattern. This point marks the true zero of the solar zenith angle

regardless of the reading on the data display panel meter. The zero

readout may be reset once the optical zero is established. It should be

pointed out that near the zero of the solar zenith angle there will be

little change in the output of the device due to the nature of the cosine

response. Thus one would be well advised to look for symmetric points at

larger angles about the zero in solar zenith.

After the optical zero zenith angle is established the next step in the

general alignment procedure is to check the spatial homogeneity of the

incident irradiance field. The magnetically held diode may be used to

check the homogeneity of the incident radiance field. By moving the

device about to different positions on the cloud field and comparing the

output voltage at the various points homogeneity may be established. If

the incident pattern is not homogeneous then the orientations of the

individual lamps must be must be adjusted relative to each other. This

may be a time consuming process depending on how non-homogeneous the

field is and on how large the region is where homogeneity is desired. It

is convenient to employ a second digital voltmeter to monitor the output

of the test diode. The second dvm should be placed near the lamp source

so that it can be read at the source. Then while adjusting the individual

lamps with the test diode placed in a region of particularly high or low

irradiance the effect of the re-aiming of the individual lamp may be

monitored. The dvm located near the interior of the CFOS is convenient to

monitor changes in the test diode output as the diode is moved about on

the cloud field. Two items should be noted while checking the homogeneity

of the incident beam. First, the test diode circuit outputs a dark

current voltage which must be subtracted from the readings before

establishing the relative magnitude of the incident irradiance. Second,

the reorientation of the individual lamps changes to some extent the

optical zero zenith angle. If in the process of smoothing the incident

light one upsets the optical zero the preceding step should be repeated.

The next item in this section concerns the cleanliness of the glass

surfaces in the CFOS. The large mirror will need cleaning from time to
- 17 -

time and the frequency of the cleaning will be obvious. Also, the

photodiode glass covers and the glass optical filters housed within each

collimating can should be cleaned periodically, especially after

significant down time. When,this is done the individual diodes invariably

become misaligned and uncalibrated. Recalibration will be covered in

section 2 of part 1. To re-align each diode a simple flashlight device

has been construced which may be mounted over the exterior of each diode

can and which projects a small spot of light toward the center of the

cloud field backround. The device is powered by any !).5 volt d.c. source.

It is helpful to mount a white piece of paper or cardboard at the center

of the cloud backround and to turn off the main lights since the

projected spot of light is rather dim. The center of the cloud field may

be established on the white reflector as explained above using the large

aluminium bar. In this manner each diode's field of view may be centered

at the center of the cloud field after the glass surfaces have been

cleaned.

The final item to be discussed in this section concerns the alignment of

the detector arc. This is one of the simplest of the procedures. The

optical zero of the detector ring is established at the position where

the shadow of the detector ring falls on the center of the cloud field.

Actually, there are five shadows since there are five lamps, but it is

fairly oovious where one should place the detector arc zero point. The

readout may be reset to zero at this point if desired but this is not

necessary if the offset is programmed into the software.

C. Section 2

This section presents a discussion of procedures used more on a

daily basis or even more often to ensure quality data. These methods

pertain to the actual process of collecting the data and maintaining

calibration. It is easiest to begin with the data collection device—the

Apple II plus computer and the data logging program. After turning the

computer on, with the disk labeled "cfos prodos" inserted, the logging

program is initiated by typing "run calib." This program will prompt the

user to insert a properly formatted data disk and to select the number of

data scans to be included in each measurement. In an actual data

collection session 30 data scans have usually been used. However, for

merely observing the diode outputs a smaller number is more convenient.

The program then displays the output of each of the diodes and the

relevant angle settings. Nothing else will happen until the user presses

a "control p" which initiates a write to the disk at the end of the

current scanning sequence. Data may be taken in this manner for as many

different geometries as desired. When it is desired to end the recording

session the user must press the "escape" key which will terminate the

file. This is the basic way used to collect the data. Small adjustments

to the basic process and specific cautions will be found below as they

pertain to collection of bi-directional reflectance data, calibration

etc.

1. Calibration

In all the applications for which CFOS was constructed only the relative

sensitivities need be determined. Even so, it has been found that

constant checks must be made on the diode relative sensitivities since

they may change significantly even with the temperature excursions
- 18 -

induced by the heating system in the basement annex. Thus what follows

may seem like overkill, but it has been found that only by continually

updating the sensitivities can one expect to obtain results valid to

within a few percent.

Each diode circuit has a very high amplification factor which causes

a significant dark current signal. It is mainly this compontent of the

signal which is temperature sensitive. In order to "predict" the

magnitude of the dark current signal, (which is impossible to monitor in

an experiment with light incident on the diodes), a separate diode

circuit identical to the others has been masked off so that no light may

enter the diode can. Note that it is important to ensure that the back of

the collimator can is also masked off since it has been observed that

sufficient light may enter the can from the backside and cause erroneous

results. The purpose of this diode is to put out only a dark current

signal which will respond to temperature changes and which may be used to

infer the behavior of the dark current signals in the remaining diodes.

Simple linear regression has been found to provide predictions of the

required dark current signals which are highly correlated to the actual

measured valued. (Correlation coefficients greater than 0.99 are not

uncommon.) The regression relations should be re-calculated periodically

using the following procedure.

It is desirable to collect the regression data over a period of time

when the temperature extremes in the CFOS laboratory are similar to those

encountered during the data collection session. Thus it may be desirable

to collect the data over the weekend before a series of measurements will

be made or if the outside ambient temperature has changed drastically to

collect a new set overnight. By modifying the data logging program

slightly the system may be placed in a continuous logging mode and

serveral hundred scans may be recorded from which the regression data may

be generated.

The modification consists of inserting the line,

"1516 GOSUB 600"

Depending on the amount of time the program is left to record data,

a very large may be generated. The software which processes this data is

described in Part II. During the time these data are being collected it

is necessary that the curtains on CFOS remain closed and is would be

preferable if the main overhead lighting remain off.

Once the regression data have been collected the relative sensitivities

may be determined. These numbers also change and must be continually

updated. In fact, below in the description of a typical data collection

session note that a calibration update is performed before each scene

measurement. To obtain the relative calibration coefficients an isotropic

reflector is used. It has been found that ordinary polyurethane foam

provides a surface which is nearly istropic out to observation angles of

nearly 60 degrees when illuminated at normal incidence. It is convenient

to use magnets to mount the foam on the cloud field backround since it

must be mounted and removed frequently. With the foam in place the

reflected signal from all the lamps is too large for the highly sensitive

detectors. In order to circumvent this problem a separate power supply

has been connected only to the center lamp of the light source. A circuit

breaker is provided to ensure that the output of this power supply may be
- 19 -

isolated at all times from the AC supply which normally operates the

source.

Thus using only the center lamp one may collect data and record it

on a disk file which may be analyzed to obtain the relative

sensitivities. It is advisable to set the detector arc angle at about 10

to 15 degrees in order to displace the shadow it casts as far as possible

from the center of the foam. The software to produce the diode

sensitivities is descibed in Part II.

2. A typical data collection session

To begin a typical data collection session it is assumed that the

regression data have been collected and that the relative sensitivities

are known fairly well. What is described here is a procedure which when

followed will produce data with standard deviations of a few percent of

their respective mean values.

Although dark current data have already been collected best results

will be obtained if this information is updated prior to each experiment.

To do so the CFOS curtains are closed and a data file is written with all

lights off. This file need consist of only 10 to 20 records each

containing 30 or so scans. While this data is being collected the lights

should remain off and none of the motor controls should be activated

since the motors and switches may introduce noise into the diode signals.

End the file with the usual escape sequence.

Next leaving the main AC power off the center lamp of the source array is

activated by powering up the separate DC supply. The circuit breaker

switch at the lamp source must also be turned on. Open the curtains and

mount the calibration foam so that it is as much in the center of the

cloud field support as possible. Offset the detector arc angle to about

15 degrees so that the shadow will not be in the field of the detectors.

Write a file of about 10 scans to establish current calibration

coefficients. End the file with the escape sequence.

Now the system is ready for data collection. Turn off the center

lamp supply and open the circuit breaker. Turn on the main lamp switch.

It is best to let the source lamps heat up as their output will fall

considerably in the first 5 minutes or so. Variation in source strength

is accounted for in the data reduction software but a constant source is

best. Remove the foam calibration reflector and mount the cloud field

target. It is easiest if the cloud field is premounted on a separate

backround so that it may be rapidly mounted and removed. Normally

bi-directional reflectance data is collected by scanning the detector arc

through plus and minus 60 degrees with the cloud field set at the desired

zenith angle. It is best to confine the total target to within about 9

inches of the center in order to avoid errors intoduced by changes in the

solid angle subtended by cloud elements as the detectors are rotated. So

beginning with the detector arc offset at 60 degrees from the center, on

a new data file, record a data scan. Then proceed every 10 degrees in

detector arc across the reflectance field. The data record which is being

averaged while the arc is moved should be not be recorded since moving

the arc will introduce noise into the data. Only the next record during

which no arc movement has occurred should be recorded. After some

practice it is possible to move the arc while the computer is writing to

disk in which case the next record may be used. If, after the "control

p" sequence has been entered, it is desired to inhibit the write to disk,

press any key on the Apple II keyboard and the current record will not be
- 20 -

written to disk. This happens occasionally if doors are opened or in some

cases people may need to walk across the path of the incident beam. These

records should be discarded. It often happens that moving the arc will

cause some change in the zenith angle setting in which case the zenith

angle should be adjusted to the desired value. When all the data have

been collected for a particular scene the file should be ended with the

escape sequence. For best results the same scene should be repeated as

many as four times to assure the quality of the data. (This should yield

results with standard deviations of less than 2% of the mean values.)

Each time the experiment is repeated the dark current and sensitivities

should be redone as explained above.

At the end of the session the curtains should be closed, the

computer turned off and the lamps should be turned off. However, the

power to the main control panel should be left on. It has been found that

the stability of the entire system is highest if the amplifier circuits

are constantly powered up. The data disk should be removed and saved for

processing, which is the subject of Part II below.

II. PART II

In part two the software which has been developed for the processing

of bi-direcional reflectance data is described. Additional software

exists and is listed in Appendix B. Only a mention of the particular use

of this latter software will be given since it is unlikely that a new

user will have need for these routines without some modification. As

mentioned in the introduction, it is assumed that the user will become

familiar with the software. Many will require some user interaction. All

of the programs which are discussed below are found on the Davong system

hard disk under volume prefix /area! or .H1 or on the CFOS software

backup diskette included with this manual.

We begin by assuming the user has completed a session in the CFOS

laboratory and has written a data disk containing a file for establishing

the dark current regression coefficients, one for updating the

coefficients, a file containing relative calibration data and one or more

files containing data for analysis of bi-directional reflectance data.

All of the files written by the Apple II in the CFOS laboratory have a

file name of the type D.mmddyy.hhmm, where mm is the two digit designator

of the month, dd designates the day of the month yy the year, hh the hour

on a 24 hour clock and mm the minute when the file was written. For

example, the last dark current regression data recorded is listed on the

first page of the Appendix B as D.082484.1348.

The first task is to run the regression program which will establish

the initial regression coefficients between the masked diode and the

remaining detectors. Run the program called "CFOSREG". It will prompt you

for the name of the file containing the regression data. It expects to

find the file on device .d2. After the file name is input the regression

coefficients will be calculated and written to a file on the Davong

system hard disk called "/area!/cfos.cal/coeff". As the data is processed

the values of the slope, intercept and regression coefficients will be

written to the screen. If the file contains a large amount of data the

processing may take several minutes to a half hour. Once the regression

coefficients have been calculated it is a good idea to transfer the raw

data file to the hard disk for temporary storage in case the file
- 21 -

containing the coefficients is lost as has been done with the file

d.082484.1348.

The program above is utilized only occasionally after a new

regression is needed for whatever reason. More often the file

"/areal/cfos.cal/coeff" will already exist on the hard disk and these

coefficients will need to be updated. This is the task of the program

called "/areal/cfos.cal/cfosdark" using the data collected just prior to

the relative sensitivity measurement described in Part I. This program

also prompts for the name of the data input file which it expects to find

on device .d2. The program uses the regression coefficients in

"/areal/cfos.cal/coeff" and simply updates the offset coefficients which

it then writes to a file called "/areal/cfos.cal/adjust". This procedure

is normally repeated for each new bi-directional reflectance data set

prior to running the relative calibration program described next.

Now the program "/areal/cfos.cal/cfossens" is run to process the

relative sensitivity measurements. The user is asked for the name of the

data file which it expects to find on device .d2 after which the contents

of "/areal/cfos.cal/cfoscoeff" and "/areal/cfos.cal/adjust" are used

along with the current data file to establish sensitivities relative to

diode #8. These values are written to a file "/areal/cfos.cal/sensiv".

The preliminaries out of the way it is now possible to process

meaningful bi-directional reflectance data. This is the task of the

program "/areal/cfos.bdr/cfosbdr" which expects to find the raw data in

the subdirectory "/areal/cfos.back/". If several bi-directional

reflectance files have been collected it is convenient to use the filer

to transfer these files to the hard disk prior to the data processing

session. The present routine uses the data in the files

"/areal/cfos.cal/coeff", "/areal/cfos.cal/adjust", and

"/areal/cfos.cal/sensiv" along with the present raw data to establish the

normalized bi-directional data set. Normally the regime of detector arc

angles is limited to +/- 60 degrees in these data. The program terminates

by writing to a file in the subdirectory "/areal/cfos.bdr/" concatenated

with the current raw data file name. The bi-directional field,the number

of detector arc angle scans, the normalizing flux density and the minimum

and maximum of the field are also written to the file for later use.

This completes the main processing for bi-directional reflectance

data. However, now that the field has been established it is fairly

common to continue the process further to obtain a denser interpolated

field which may be plotted or used for error analysis, for example. So

continuing along the data processing chain of events one may run the

program "/areal/cfos.interp/cfosinterp" which performs a weighted

interpolation on the normalized bi-directional reflectance data. The

weighting is based on the inverse of the angular distance between the

point at which the interpolation is desired and a neighborhood around

this point which may be changed to include all of the normalized data

points or just a surrounding few. The running time is highly dependent on

the number of points used in the interpolation. The program prompts for

the number of nadir and azimuthal points at which interpolated results

are desired as well as the input data file name. This latter file name

should be the concatenated portion of the normalized data which was

written by "/areal/cfos.bdr/cfosbdr" to the subdirectory

"/areal/cfos.bdr/". This is of course just the "d.mmddyy.hhmm" designator

of the original raw data. The product of this program is an interpolated

field which is written to a file under the subdirectory
- 22 -

"/areal/cfos.plot/" concatenated with the "d.mmddyy.hhmm" designator of

the original data.

One final product of this line of processing is a polar plot of the

bi-directional reflectance data. Such a plot is the product of a program

"/areal/cfos.plot/cfosplot". This program utilizes the HP 7470A plotter

to produce the drawing. The input data set is the product of the previous

interpolation program and is requested by the program. Another use of the

interpolated field is variance estimation. It is desirable from time to

time to analyze the variance in the bi-directional reflectance data for

the same scene measured several times or the variance among sets of data

for slightly different scenes. This type of analysis is the object of the

program "/areal/cfosste" which prompts for first the number of

interpolated data fields and then the name of each one. Again, it is

assumed that the interpolated fields are to be found in under the

subdirectory "/areal/cfos.plot/" with concatenations of the raw data file

names to be input by the user. The program presently assumes that 144

interpolated data points are available for each scene in a 12 by 12 array

over the azimuth and nadir regime. The poduct is the standard error at

each grid point and an average standard error for all grid points. This

program was used to establish the basic precision of the bi-directional

reflectance analysis which has been outlined in this manual.

This completes the description of the software needed to obtain

bi-directional reflectance information. There are several other programs

listed in Appendix B. What follows is a very brief description of the

remaining software.

"/areal/cfos.cal/cfoscal" was the predecessor to the current

sensitivity procedure. It assumed the dark current coefficients were

constants and were entered in DATA statements within the program.

"/areal/cfos/cldareadist" is a simple algorithm which implements a

cloud field statistical model given by Planck.

"/areal/cfos/clddist1" is a simple algorithm which implements the

cloud field distribution program by Hozumi.

"/areal/cfos/cfosmovie" was used to provide a "movie" type graphical

display of bi-directional reflectance fields. The input files to this

program were previously generated fotofiles and are assumed to exist on

device .hi.

"/areal/cfos/cfosfin" was used to produce graphical displays on the

monitor and a pricipal plane graph on the silentype of bi-directional

reflectance patterns for finite cloud fields.

"/areal/cfos/cfosback" was originally used experimentally to adjust

for the backround reflectance pattern but was not found to be useful.

"/areal/cfos/cfosoff" was used to analyze the effect of displacing a

single cloud or a small field clouds from the center of the CFOS cloud

field support.
- 23 -

"/areal/plot.pack/myplot", "/areal/plot.pack/myplotl", and

"/areal/plot.pack/hp.text" were prototype plotting routines from which

the cfos plotting routines were patterned.

"/areal/plot.pack/rectterp" and "/areal/plot.pack/recplot" are

routines analagous to their cfosinterp and cfos.plot

counterparts(described above) and were used originally to interpolate

and plot the radiance patterns exiting modeled and measured finite cubic

clouds.

References

Coakley, J. A., and P. Chy'lek, 1975: The two stream approximation in

radiative transfer: Including the angle of the incident radiation. J.

Atmos. Sci., 32, 409-418.

Davis, J. M., S. K. Cox, and T. B. McKee, 1983: Design and verification of a

cloud field optical simulator. J. Appl. Meteor., 22, 9^7-958.

Deirrnendj ian, D., 1969: Electromagnetic Scattering on Spherical

Poly-dispersions. Elsevier, 290 pp.

Stephens, G. L., 1978: Radiation profiles in extended water clouds. II:

Parameterization schemes. J. Atmos. Sci., 35, 2123-2132.
- 34 -

List of Figure Legends

Figure 1. A photograph of the radiance pattern from an optically thick cubic

cloud under normal irradiation as simulated in the CFOS.

Figure 2. Contours of relative radiance (measured) exiting the side of a

simulated cubic cloud irradiated at norpial incidence.

Figure 3. Contours of relative radiance (calculated^ exiting the side of a

modeled cubic cloud irradiated at normal incidence.

PRECEDING PAGE BLANK NOT FILMED '
- 35 -

ORIGINAL PAGE IS

OF POOR QUALITY

Figure 1
- 3

6 -

IDQJ i-P

tfl O0)eOCgTJOir(D0) CC

»*-otnCou

CD O O 5J- q in

o o d d —: CD ii u 11

 " .E g , E £

1-22

O to o

CJ — — OOOCXDO odd

Q>

Ji oo •H
- 37 -

O O

_: CD

11 it

=£>•

o o OJ OJ

O 10

d d

.b o

TJ

OJ

a

o

o

c

o

'ID

o

a:

a>

IT

to

C

o

o

mOmO 10 O «n o

Tj"3roro cvj cvj — —

ddod dod o

in

q

d

rn

0)

D

co

•H
- 38 -

5.0 Publications and Reports

McKee, T. B., J. M. Davis, and S. K. Cox. Design and Verification of a Cloud

Field Optical Simulator. Published in Preprint of the Fourth Conference

on Atmospheric Radiation, Toronto, Ontario, Canada, June 16-18, 1981.

Davis, J. M., S. K. Cox, and T. B. McKee, 1983: Design and verification of a

cloud field optical simulator. J. Appl. Meteor., 22, 9*17-958.

Davis, J. M., S. K. Cox, and T. B. McKee. The role of finite clouds in scenes

scharaccerized by forward scattering bi-directional reflectances.

International Radiation Symposium '84, August 21-29, 1984.

Davis, J. M. and S. K. Cox, 1986: Additional confirmation of the validity of

laboratory simulation of cloud radiances. Accepted for publication in

J. Climate and Appl. Meteor., February, 1986.
- 39 -

6.0. Statement on Inventions

There were no patentable inventions made during the performance of this work.
APPENDIX

Data Reduction and Analysis

Programs for the Cloud Field Optical Simulator
A-l

10 REM PROGRAM CFDS

20 PRINT" CFOS CALIBRATION PROGRAM"

30 DIM A*(15)

40 DIM VALUE(500,20)

57 DIM DC(19)

7O DIM SLOP(15),OFFS(15),SENS(15)

75 DATA -633,57,66,195,-357,-240,-52,-59,21,-1,-84, -221,-192,-182,307

80 DATA 1.3758,0.811,0.839,0.694,1.486,1.049,1.149,O.78,.85,0.89,1.05,1.13,1

.215,1.041,0.597

100 FOR K=l TO 15

110 READ QFFSO )

120 NEXT h

130 FOR H=l TO 15

140 READ SLOP(k)

155 NEXT K

190 DTRD=3.14159/180.

250 OPENttl AS INPUT,".D2/D.O91784.1247"

251 T£="TEST.DARK"

26O B*=""

28O INPUT#1,1;B$

37O NS=VAL<B*)

38O PRINT NS

400 FOR K=l TO NS

410 B£=""

420 INPUTttl ,K+1;B$

43O POS1=1

435 FOR J=l TO 20

44O SPACE=POS1

450 POS2=INSTR<B£," ",SPACE)

46O NOC=POS2-POS1

470 VALUE(k,J)=VAL(MID£<B$,POS1,NOC))

480 POS1=POS2+1

49O PRINT VALUE(K,J)

50O NEXT J

510 NEXT K

520 FOR K=l TO NS

530 FOR J=l TO 15

540 SENS(J)=SENS(J)+(VAL(K,J)*SLOP(J)+OFFS(J))/NB

55O NEXT J

560 NEXT K

57O FOR K=l TO 15

580 SENS(J)=SENS(J)/SENS(8)

59O NEXT K

60O OPEN#4 AS OUTPUT,".SILENTYPE"

610 OUTPUT#4

620 FOR K=l TO 15

630 PRINT SENS(K)

640 NEXT r.

65O END
A-2

10 REM PROGRAM CFOS

20 PRINT" CFOS DARK CURRENT UPDATE PROGRAM"

30 DIM A*(15) ,VALUE <100,2O)

40 DIM SLOP(IS),OFFS(15)

50 PRINT"INPUT FILE NAME OF DARK CURRENT UPDATE RUN"

60 INPUT D£

250 OPENtfl AS INPUT,"/AREA1/CFOS.CAL/COEFF"

26O FOR J=l TO 15

270 READS1,J;SLOP(J),OFFS<J)

280 NEXT J

290 OPEN#2 AS INPUT,".D2/"+D*

3OO &£=""

310 INPUT#2,1;NS

320 NS=NS-2

380 PRINT NS

400 FOR h=l TO NS

410 B£=""

420 INPUT#2,K>1;B*

430 POS1=1

435 FOR J=l TO 20

440 SPACE=POS1

450 POS2=INSTR<B$," ",SPACE)

460 NOC=POS2-POS1

470 VALUE(K,J)=VAL<MID*<B£,POS1,NQC))

480 POSl=POS2+i

490 PRINT VALUE(K,J)

500 NEXT J

510 NEXT K

520 FOR J=l TO 15

530 DIFF=0

540 FOR K=l TO NS

550 DIFF=DIFF+<VALUE(K,16)*SLOP<J)+OFFS<J)-VALUE<K,J))/NS

560 NEXT K

570 OFFS(J)=OFFS(J)-DIFF

575 PRINT DIFF

580 NEXT J

600 OPENttS AS OUTPUT,"/AREA1/CFOS.CAL/ADJUST"

610 FOR J=l TO 15

620 WRITE#5,J;QFFS<J)

630 NEXT J

640 CLOSE

65O END
A-3

10 REM PROGRAM CFOS

20 PRINT" CFOS DARK CURRECT OFFSET PROGRAM"

3O DIM A*(15)

40 DIM VALUE(650,20)

5O DIM SLOP(15),OFFS<15)

100 PRINT"INPUT THE NAME OF THE DATA INPUT FILE"

110 INPUT D-T

120 DTRD=3.14159/180.

150 OPENttl AS INPUT,"/.D2/"+D$

160 B$=""

180 INPUT-81 ,1;B$

190 DTRD=3.14159/130.

270 NS=VAL<B£)

280 PRINT NS

300 FOR K=l TO NS

31O B£=""

320 INPUTttl,K+1;B*

330 POS1=1

335 FOR J=l TO 20

340 SPACE=POS1

350 POS2=INSTR<B*," ",SPACE)

36O NOC=POS2-POS1

37O VALUE(K,J)=VAL(MID$<B$,POS1 ,NOC) )

380 POS1=POS2+1

390 PRINT VALUE<K,J)

400 NEXT J

410 NEXT K

415 FOR J=l TO 15

420 N=0

43O SX=0

440 SY=0

45O SXX=0

46O SYY=0

470 SXY=0

480 FOR K=l TO NS

490 N=N+1

5OO X=VALUE(K,16)

510 Y=VALUE<K,J)

52O SXY=SXY+X*Y

530 SX=SX+X

540 SY=SY+Y

550 SXX=SXX+X*X

560 SYY=SYY+Y*Y

570 NEXT K

580 BETA1=<N*SXY-SX*SY)/(N*SXX-SX*SX)

610 BETAO=SY/N-BETA1*SX/N

62O PRINT BETA1,BETAO

630 R=(N*SXY-SX*SY)/SOR((N*SXX-SX*SX)*<N*SYY-SY*SY))

640 PRINT R

650 SLOP(J)=BETA1

660 OFFS(J)=BETAO

67O NEXT J

680 OPENtt3 AS OUTPUT,"/AREA1/CFOS.CAL/COEFF"

69O FOR J=l TO 15

700 WRITEtt3,J;SLOP(J),OFFS(J)

710 NEXT J

720 CLOSE

730 END
A-4

10 REM PROGRAM CFOS

20 PRINT" CFOS CALIBRATION PROGRAM"

3O DIM A-fUS) , VALUE (10O,20)

40 DIM SLOPU5) ,QFFSC15) ,COFFS<15> ,SENS<15)

50 PRINT"INPUT FILE NAME OF DARK CURRENT CALIBRATON RUN"

60 INPUT D$

150 OPENttl AS INPUT,"/AREA1/CFOS.CAL/COEFF"

160 FOR J=l TO 15

170 READttl,J;SLOP(J),OFFS(J)

180 NEXT J

200 OPEN#2 AS INPUT,"/AREA1/CFOS.CAL/ADJUST"

210 FOR J=l TO 15

220 READ#2,J;COFFS<J)

230 NEXT J

240 PRINT" CURRENT DARK CURRENT OFFSET UPDATE VALUES"

25O FOR J=l TO 15

260 PRINT COFFS(J)

270 NEXT J

280 CLOSE#2

290 OPEN#2 AS INPUT,".D2/"+DS

300 Bt-""

310 INPUT#2,l;NS

320 NS=NS-2

380 PRINT NS

400 FOR H=l TO NS

410 B*=""

420 INPUT#2,K+l;B-£

430 PO51=1

435 FOR J=l TO 20

440 SPACE-POS1

450 POS2=INSTR(B$," ",SPACE)

460 NOC=POS2-POS1

47O VALUE(k,J)=VAL(MID^(B*,POSl,NOC))

48O POS1=POS2+1

490 PRINT VALUE(K,J)

50O NEXT J

510 NEXT K

52O FOR J=l TO 15

530 SENS(J)=0. '

54O FOR K=l TO NS

550 SENS(J)=SENS(J)+(VALUE(K,J)-VALUE(K,16)*SLOP(J)-COFFS<J))/NS

56O NEXT K

570 PRINT SENS(J)

575 NEXT J

580 FOR J=l TO 7

59O SENS<J)=SENS(J>/SENS<8)

60O SENS(J+8)=SENS(J+8)/SENS<8)

61O NEXT J

62O SENS(8)=1

625 OPENttS AS OUTPUT,"/AREA1/CFOS.CAL/SENSIV"

63O FOR J=l TO 15

640 WRITE+t5,J;SENS(J)

650 NEXT J

66O CLOSE

67O OPENttl AS OUTPUT,".SILENTYPE"

68O FOR J=l TO 15

69O PRINTttlSENS(J)

70O NEXT J

710 CLOSE

720 END
A-5

10 PRINT"ENTER THE TOTAL CLOUD COVER"

20 INPUT ST

30 PRINT"ENTER THE CHI PARAMETER"

4O INPUT CHI

50 PRINT"ENTER THE DIAMETER LIMITS Dl AND D2"

6O INPUT D1,D2

70 PRINT"ENTER THE EXPONENT ALPHA"

8O INPUT ALPHA

100 D1A=D1*ALPHA

110 D2A=D2*ALPHA

120 A=-(ST/ <2*CHI)*(EXP(~D2A)*<D2A"2+2*D2A+2>-EXP(-DlA)*<DlA-'"2+2*DlA+2)

130 PRINT D1,D2,A

140 END
A-6

10 REM CLOUD DISTRIBUTION PROGRAM A LA HQZUMI

20 DIM D(50) , N (50 < ,A(50) ,V(50)

25 OPENttl AS OUTPUT,".PRINTER"

HO FOR M=5 TO 95 STEP 1O

120 A=124*EXP(-4.7*M*.01>

13O B=4.5*EXP(-3.5*M*.O1)

135 ASUM=0

140 FOR 1=1 TO 20

150 01=1*0.50-0.50

16O 02=1*0.50

170 N(I)=A/B*(EXP(-B*D1)-EXP(-B*D2))*40

175 DB1=D1*B

176 DB2=D2*B

180 A ( I) =3. 14159*A/ (4*B-"3> * (EXP (-DB1) * (DBl*DBH-2*DBl+2) -EXP <-DB2) * (DB:

B2-»-2*DB2+2) ) /IGO

19O ASUM=ASUM+A(I)

280 PRINT#1M,D1,D2,N(I),A(I)

290 NEXT I

295 PRINTS1ASUM:PRINT#1:PRINT*1

300 NEXT M

310 END
A-7

1 500

1510

15 2O

1530

1540

1550

1 560

1570

1580

1590

1 60O

1605

1 6 1 0

1620

1625

1 63O

1640

1650

1660

1670

1680

1690

1700

1710

1720

1 730

1740

OPEN#2,".(

INVOI- E".D

PERFORM II

PERFORM Gl

PERFORM F

PERFORM Gl

PERFORM G(

PERFORM Gl

PERFORM Gl

PERFORM Gl

PERFORM Gl

PERFORM I!

PERFORM Gl

PERFORM Gi

FOR K=l Tl

PERFORM Gi

PERFORM Gl

PERFORM Gl

PERFORM Gl

PERFORM G

PERFORM Gl

PERFORM G

PERFORM 61

PERFORM G

FOR K=l TI

GOTO 1540

END

6RAFIX"

Dl/BGRAF.INV"

INITGRAFIX

GRAF I XMODE (7.1 ,7.1)

FILLPORT

GLOAD.".HI/FOAM.60DEGGRAF"

GRAFIXON

GRAF I XMODE < 7.1 , 7.2)

GLOAD.".H1/FOAM.30DEGGRAF"

GRAFIXON

GRAF I XMODE (7.1,7.1)

INITGRAFIX

GLOAD.".HI/FOAM.ODEGGRAF"

GRAFIXON

1000:PERFORM GRAFIXON:NEXT K

GRAF IXMODE < 7.1 ,7.2)

GLOAD.".HI/FOAM.6ODEGPLOT"

GRAFIXON

GRAF I XMODE (7.1,7.2)

GLOAD.".HI/FOAM.30DEGPLQT"

GRAFIXON

GRAF I XMODE (7.1 ,7.1)

GLOAD.".Hl/FOAM.ODEGPLOT"

GRAFIXON

1000:PERFORM GRAFIXON:NEXT K
A-8

1O REM PROGRAM CFOS

20 PRINT" CFOS DATA REDUCTION PROGRAM"

3O PRINT:PRINT:PRINT" THE DIODE SENSITIVITIES USED IN THIS PROGRAM ARE

40 DIM DI ANGUS) , SENS (15) ,DC(19) ,NADANG(5OO) ,RAZANG(SOO) , VOLT (500) "

5O DIM DID<19),ANG(3),NR(36),NRN<36),MEAS(500,2)

55 DIM A4r(15>

60 DATA 2O,30,40,50,60,70,80,9O,100,11O,12O,130,140,150,16O

70 DATA 1. ,1 - 06,.88,.94,.84,.95,1. 18,.79,.94,1.O3,.86,.98,.98,1.06,1.04

75 DATA 1098,125,477,852,427,573,314,338,193,652,185,503,73,220,287,25,3

SO FOR 1=1 TO 15

90 READ DIANG(I)

100 NEXT I

110 FOR 1=1 TO 15

120 READ SENS(I)

130 NEXT I

140 PRINT" DIODE NUMBER DIODE ANGLE DIODE SENSITIVITY"

143 NP=8

150 FOR 1=1 TO 15

160 PRINT USING 170;I,DIANG(I),SENS(I)

170 IMAGE 10X,2#,14X,3#,16X,1#.2#

180 NEXT I

19O DTRD=3.14159/180.

200 REM DEFINE ARCOS FUNCTION

210 DEF FN ACOS(X)=ATN<SQR(1-X*X)/X)

220 L=O

225 AVZEN=0

250 OPENS 1 AS INPUT,".D2/BACKZ6O"

251 T4r="FOAH"

255 FOR LL=1 TO 2

260 B£=""

270 FOR 1=1 TO 15

28O GET#1;A*(I)

290 IF A£(I)=CHR$(13> THEN 280

300 IF A$(I>=CHR$(10) THEN 34O

310 IF A*(I)=CHR*(32> THEN 34O

320 NEXT I

340 FOR K=l TO I

350 B$=B*+A*<K)

360 NEXT K

370 NS=VAL(B£)

380 PRINT NS

400 FOR K=l TO NS

410 B$=""

420 FOR J=l TO 18

430 B4?=""

440 FOR 1=1 TO 15

450 GET#1;A*(I>

460 IF A$(I)=CHR*<13) THEN 450

470 IF AJ:<I)=CHR*<32) THEN 500

480 IF A$<I)=CHR$<10) THEN 500

490 NEXT I

500 FOR M=l TO I

510 B4r=B$<-A4;(M)

520 NEXT M

53O DIO(J)=VAL(B£)

535 DIO(J)=(DIO(J)-DC(J))/1OOO.

540 IF K=l THEN REF=DIO(18)

545 NEXT J

550 FOR J=l TO 3

560 B*=""
5GO

590

60 O

610

620

630

64O

650

660

665

670

680

690

695

7OO

705

710

720

730

740

750

760

770

775

776

780

790

800

811

812

815

820

830

8

—»cr

•_•*_!

840

841

842

843

844

845

850

860

900

910

920

930

940

95O

960

970

98O

990

1OOO

1010

1020

1O40

1100

1 12O

1130

114O

1150

116O

12OO

1210

1 220

GETttl : A£< n

IF A$< I >=CHR4r< 13)

IF A$< I >=CHR$(32>

IF A4" ( I ) =CHR£ (10)

NEXT I

FOR M=l TO I

THEN 58O

THEN 630

THEN 63O

A- 9

IF

I F

IF

IF

NEXT M

ANG<J)=VAL(B£>

NEXT J

FOR 1=1 TO 15

ALPH A= ANG ( 2 1 -ANG ( 1 )

X=SIN (DIANG ( I ) *DTRD) *CQS ( ALPHA*DTRD>

NAD= FN ACOS(X)

L=L+1

NADANG(L)=NAD

COMP= ( D I ANG ( I ) -90 ) *DTRD

DEN= ( B I N ( NAD ANG ( L ) ) *S I N ( ALPHA*DTRD ) )

IF DEN=O. THEN 750

X= (COS (COMP) -COS (NADANG (L) ) *CQS ( ALPHA*DTRD> ) /DEN

IF DEN=0. THEN X=.OOOO1

DIANG(IX9O. THEN X=-X

NADANG ( L ) .-- . OOOOO 1 THEN 775 : ELSE X = 1 . 0

X.-l. THEN X=l.

X- -1. THEN X=-l.

RAZANG (L)= FN ACOS(X)

IF ALPHA, 0. THEN RAZANG (L) =RAZANG (L) +180*DTRD

IF RAZANG (LXO. THEN RAZANG (L) =360. *DTRD+RAZANG (L)

MEAS (L , LL) =DIO ( I ) /SENS ( I ) *REF/DIO ( 18)

VOLT (L) =MEA9 (L , 2) -MEAS (L, 1 )

PRINT L,NADANG(L) /DTRD, RAZANG (L) /DTRD, VOLT (L)

NEXT I

PR I NT: PR I NT

AVZEN=AVZEN+ANG ( 1 ) /NS

NEXT k

CLOSEttl

IF LL=2 THEN 850

OPENttl AS INPUT, ".D2/FIN6O. Z60CUBE"

L=0:AVZEN=O.

NEXT LL

NMEAS=L

GOSUB 1200

REM SUBROUTINE INTERP

DELTA=30*DTRD

SUMF=O. :SUMW=0.

FOR 1=1 TO NMEAS

Z=NADANG ( I ) : A=RAZANG ( I )

IF ABS(Z-ZINT) .-DELTA THEN 104O

IF ABS(A-AINT) >DELTA THEN 1040

THETA=COS(Z) *COS < ZINT) +SIN (Z ) *SIN (Z INT) *COS ( A-AINT)

IF THETAX). THEN 1 OOO: ELSE 1000

THETA= FN ACOS(THETA)

GOSUB 1100

SUMW=SUMW+W

SUMF=SUMF+W*VOLT ( I )

NEXT I

REM SUBROUTINE WEIGHT

WGHT=1.E+06

I F THET A ' . 000 1 THEN 1 1 40 : ELSE 1 1 50

W=WGHT: RETURN

WGHT=DELTA/THETA

W=WGHF: RETURN

REM SUBROUTINE MAX ---------- MIN

MAX=0

M T N- 1 on
d27.7 IF NA&ANGd) 60*DTRD THEN 126O

1240 IF VOLT<n MAX THEN MAX=VOLT(I) A_1Q

1250 IF VOLT(I> MIN THEN MIN=VOLT(I)

126O NEXT I

1265 PRINT MIN,MAX

1300 REM SUBROUTINE INTEGRATE RADIANCES

1Z 10 SUM-O. : TQTNUM=0

1315 FOR J=i TO 36 0RK3INAL PAG

1320 NR (J) =0: NRN (J ) =0 pp POOR

1325 NEXT J

1330 NINC=90*DTRD/36.

1335 FOR 1=1 TO NMEAS

1340 J=INT(NADANG(I) /NINO+1

1345 NR(J)=NR(J)+VOLT(I)

1350 NRN<J)=NRN(J)+1

1355 NEXT I

1360 FOR 1=1 TO 36

1365 IF NRN<I>=0 THEN 1395

1370 ANG=(2*1-1)/2*NINC

1375 SUM=SUM+NR(I)/NRN(I)*COS(ANG)*SIN < ANG)*NINC

1380 TQTNUM=TQTNUM+NRN(I)

139O NINC=90.*DTRD/36.:GOTO 140O

1395 NINONINC+NINC

1400 NEXT I

1410 FLUXUP=3. 14159*-2*SUM

1420 PRINT FLUXUP

1430 STOP

1435 OPEN#5 AS OUTPUT,".SILENTYPE"

1436 OUTPUTtt5

1437 FOR K=S TO 375 STEP 15

1438 VaLTa-) = (MEAS(K,2)-MEAS<K, 1) * < 1-F* (1+TAN <NADANG (K) ) ) ) )/F/ < 1+TAN (NAD

G(K)))

1439 PRINT MEAStK, 1) ,MEAS(K,2) ,VOLT(1-::) , NADANG (K)/DTRD , < 1-COS (NADANG <K> ) )

1440 NEXT K

1441 PRINT:PRINT

1445 END

1500 OPEN82,".GRAF IX"

1510 INVOKE".Dl/BGRAF.INV"

1520 PERFORM INITGRAFIX

1530 PERFORM GRAFI XMODE (7.1 , 7.1)

1540 PERFORM FILLPORT

155O RAD=60

1560 GOSUB 1880

1570 PERFORM PENCOLOR (7.15)

1580 NPOINTS=72

159O PERFORM GRAF IXON

1600 FOR h. = l TO 3

1610 Xl=r*30*DTRD

1620 R=RADx-SIN(Xl)

1630 PERFORM MOVETO (7. (R*140/192*2+140) , 7.96)

1640 FOR 1=1 TO 365 STEP 5

1650 X=R*COS <I*DTRD)*14O/192+7O:X=2*X

1660 Y=R*SIN<I*DTRD)*192/140+96

167O PERFORM LINETO (7.X , 7.Y)

1680 NEXT I

1690 NEXT K

1700 ANGINC=30*DTRD

1710 PERFORM MOVETO (7.140, 7.96)

1720 FOR 1=1 TO 12

1730 ANG=ANGINC*I

1740 X=RAD*COS<ANG)*140/192+70:X=2*X

175O Y=RAD*SIN(ANG)*192/140+96

1760 PERFORM LINETO (7.X , 7.Y)

1770 PERFORM MOVETO (7.140 , 7.96)

1 7Pr> Mtrvr T
1300

1802

1304

1806

1308

1810

1312

1814

1816

1818

1820

1822

1825

1830

1340

1850

I860

1870

1875

1880

1385

1890

1895

1900

1905

1910

1920

1925

1930

1935

1940

195O

1960

1970

198O

1990

20OO

2010

2020

2025

2030

20 4 O

2050

3000

3O10

3020

3O30

304O

3050

3060

3070

3100

3110

3120

3130

3140

Z150

3155

3160

3170

3180

3185

y. \ 9o

PERFORM MOVETO ( V.230 , X.98 )

PRINT*?;"ISO"

PERFORM MO VETO (V. 10, V.I 88)

PRINTttZ USENG 1PO4;AVZEN

IMAGE "Z=",##.

PERFORM MOVETO ('/. 180 , 7.188)

PRINT#2 USING 1810;FLUXUP

IMAGE "F=",tt.##

PERFORM MOVETO (7.10 , 7.8)

PRINT#2 USING 1816;MIN

IMAGE "MIN=",#.#

PERFORM MOVETO (7.180 , 7.8)

PRINT#2 USING 1822;MAX

IMAGE "MAX=",#.#

PERFORM MOVETO (7.126, 7.188)

PRINT#2;"90"

PERFORM MOVETO < 7.30 , 7.98)

PRINT#2;"0"

PERFORM MOVETO (7.12O,7.8)

PRINT#2;"270"

GOTO 3000

PERFORM GRAFIXON

PERFORM INITGRAFIX

PERFORM XFROPTION<7.O)

CQLINC=(MAX-MIN)/1O.

FOR h'=l TO NMEAS

IF NADANGdO >60*DTRD THEN 2025

R=-RAD*SIN(NADANG(K))

X=R*COS<RAZANG<K))*140/192+70:X = X*2

XS=3*COS(NADANG<K>)+l:XS=XS*2

Y=R*SIN(RAZANG(K))*192/140+96

YS=6*COS(NADANG(K))+3

IF COLINC=0. THEN COLOR=10:ELSE COLOR=<VOLT(K)-MIN)/COLINC

COLOR=INT(COLOR)

PERFORM FILLCOLOR < 7.COLOR)

R=X+XS

L=X-XS

T=Y+YS

B=Y-YS

PERFORM

PERFORM

NEXT K

PERFORM INITGRAFIX

RETURN

END

REM SUBROUTINE PRINCIPAL PLANE RADIANCE GRAPH

REM FIND THE MAX AND MIN VOLT IN THE PRINCIPAL PLANE

MAX=0.:MIN=100.

FOR 1=8 TO(NS-l)*15+8 STEP 15

IF VOLT<I):;MAX THEN MAX=VOLT (I)

IF VOLTUKMIN THEN MIN=VOLT(I)

NEXT I

PRINT MAX,MIN

REM SET XSCALE AND XINC

XRANGE=NADANG <8)+NADANG < (NS-1)*15+8)

XRANGE=XRANGE/DTRD

XRANGE=INT((XRANGE/2+1O)/10)

XINC=40

REM SET YSCALE AND YINC

MID=INT< (NS+D/2)

FOR 1=8 TO(NS-l)*15+8 STEP 15

IF NADANG(I)<:8*DTRD THEN NORM=VOLT (I)

NEXT I

J=0 ;

T=P rn cMQ-t ^ *i s-t-n <=;TFP is

VIEWPORT < 7.L , 7.R , 7.B, 7.T)

FILLPORT
.32 1 0

3220

3230

3240

325O

326O

3265

327O

3275

328O

3290

331O

33 2O

3330

3340

335 O

3360

3370

3330

3400

3410

342O

34 3O

3440

3450

347O

3490

35 OO

3510

3520

3530

3540

3550

3560

3570

3575

3580

359O

36OO

3610

3620

3622

3625

363O

3635

3640

3645

3650

3660

3670

3675

368O

3690

3695

3700

3701

37O5

3710

3720

3730

3740

3750

3760

3770

NR ( J ) -VOLT ( I ) /NORM

NEXT I

MAX=MAX / NORM : M I N=M I N/NORM

REM SET VRANGE AND YINC

A-12

YRANGE=MAX-MIN

PERFORM GRAFIXMODE < 7.

GRAF IX ON

FILLPORT

MQ VETO (7.280, 7.30)

MOVEREL(7.-3,7.3)

MO VETO ( 7.280 , 7.30 )

MOVEREL(7.0,7--10)

' 7.2)

PERFORM

PERFORM

PERFORM

PERFORM

PERFORM

PERFORM

ANG=0

PRINT#2ANG

FOR K=-l TO 1 STEP 2

FOR 1=1 TO XRANGE

XR=280+K*I*40:YR=30

PERFORM MOVETO (7.XR-1 ,7.YR+3)

PRINT#2;"I"

PERFORM MOVETO (7.XR,7.YR>

PERFORM MOVEREL (7.-3,'/.-10)

ANG=I*10

FRINT#2:ANG

NEXT I

NEXT K

LL=280-XRANGE*40

LR=2SO+XRANGE*40

PERFORM MOVETO (7.LL, 7.30)

PERFORM LINETO(7.LR,7.30)

PERFORM MOVETO (7.280 ,7.30)

FOR J=l TO 3

XR=280:VR=30+J*50

PERFORM MOVETO (7.XR-3 , 7.YR+2)

PRINT82;"-"

PERFORM MOVETO (7.XR,7.YR)

PERFORM MOVEREL (7.10, 7.0)

PRINTS2;J

NEXT J

PERFORM MOVETO (7.XR,7.YR)

PERFORM LINETO (7.280 , '/130)

PERFORM MOVETO (7.280 , 7.30)

J=0:L=0

FOR 1=8 TO(NS-l)*15+8 STEP 15

IF VOLT(I)=0 THEN 3710

k= 1

J=J+1

IF RAZANG(I) .'Sx-DTRD THEN K=-l

X=280+K*-NADANG < I) /DTRD*4

Y=NR(J)*50+30

PRINT NR(J) ,NADANG <I)/DTRD,RAZANG <I)/DTRD,X,Y

X=INT(X)

Y=INT(Y)

IF ABS(X-509X3 THEN 3710

IF L=0 THEN PERFORM MOVETO (7.X ,7.Y) : ELSE PERFORM LINETO (7.X ,7.Y)

L=L+1

PERFORM DOTAT(7.X,7.Y)

NEXT I

PERFORM MOVETO (7.1 OO, 7.180 )

PRINT#2 USING 3740;T$

IMAGE "RELATIVE RADIANCES IN THE PRINCIPAL PLANE FOR

OA

PERFORM MOVETO (7.40, 7.170)

PRINT#2 USING 3770;AVZEN

7FMTTM C,l\jni F =
3790,

3800

3810

3820

3830

3840

11438

PR I NTS2" ANT I -SOLAR SIDE"

PERFORM MO VETO r/,400 , 7.1O)

SOLAR SIDE"

MOVETO ( V.240 ,7.1O)

NADIR ANGLE"

PRINT#2

PERFORM

PRINT#2

END

A- 13

= (MEAS(K,2)-MEAS(K,l)*(l-F*(l+TAN(NADANB(K) ) ) ) ) / (F* < H-TAN <NADAN

G ( K ) ) ) )
A-14

1O REN PROGRAM CFOS

2O PRINT" CFOS CALIBRATION PROGRAM"

40 DIM DIANG(50)

45 DIM DARK(500)

50 DIM DIO(4O),ANG(3),NR<36).NRN(36)

55 DIM A*(15)

56 DIM VALUE(50O,2O)

57 DIM DC(19)

58 DIM SENS(1O,16)

6O DATA 20.3O,4O,50,60,7O,80,90,100,11O,120,130,14O,15O,160

70 DATA 1.00,.91,1.07,.98,.99,.96,1.2,1.09,1.03,1.23,.89,1.O2,1.10,.88,.96'

75 DIM BDR(50)

190 DTRD=3.14159/180.

200 REM DEFINE ARCOS FUNCTION

21O DEF FN ACOS(X)=ATN(SQR(1-X*X)/X)

220 L=0

225 AVZEN=0

250 OPENttl AS INPUT,"/AREA1/CFOS.BACK/D.O71684.1244"

251 T*="TEST.DARK"

260 B-?=""

280 INPUTtfl,1;B£

37O NS=VAL(B*)

375 NS=NS-2

380 PRINT NS

40O FOR K=l TO NS

41O Bt=""

420 INPUT#1,K+1;B$

430 POS1=1 '

435 FOR J=l TO 20

440 SPACE=POS1

450 POS2=INSTR(B£," ",SPACE)

460 NOC=POS2-POS1

47O VALUECK,J)=VAL(MID£(B$,POS1,NOC))

480 POS1=POS2+1

49O PRINT VALUE(k,J)

500 NEXT J

510 NEXT K

520 REF=VALUE(1,17)

530 NS2=NS/2

540 FOR J=l TO NS

550 VALUE(J,8)=VALUE(J,8)*REF/VALUE(J,17)

56O DARK <J)=VALUE(J,9)*0.761652+163.5

580 NEXT J

6OO F=.01

61O FOR J=l TO NS

620 DIANG(J)=VALUE(J,19)

630 IF DIANG(J)<0. THEN DIANG(J)=360.-DIANG(J)

640 PRINT DIANG(J)

650 NEXT J

66O FOR J=l TO NS

670 DIANG(J)=((DIANG(J)+VALUE(J,IB))-360)*DTRD

68O DIANG(J)=ABS(DIANG(J))

685 SINE=ABS(SIN(DIANG(J)))

686 COSE=ABS(COS(DIANG(J)))

69O DIO(J)=(VALUE<J,8)-DARK<J>)

700 NEXT J

701 DIO(7)=(DIO(8>*DIO<6)>/2.

710 FOR J=l TO NS

72O PRINT DIO(J)/DIO(7),DIANG(J)/DTRD

73O NEXT J

740 SUM=0.
753 SINE=ABS(SIN(DIANG(f. ) ) >

756 CQSE-ABS<COS<DIANG<h>> >

 A

~

15

760 SLIM=SUM+DIQ(H ) *-COSE*SINE*10*DTRD*l*3. 14159

780 NEXT K

790 SOLANG=(1.0-COS(DIANG(1)))*2.0*3.14159

795 OPEN#2 AS OUTPUT,".SILENTYPE"

796 OUTPUT#2

800 FOR h =1 TO NS

810 BDR(K)=DIO<K)*3.14159/SUM

820 PRINT BDR(K),COS(DIANG(K))

830 NEXT K

840 END

850 NMEAS=L

900 FOR K=l TO 5

910 FOR J=l TO 18

920 DC(J)=DC(J)+VALUE(K,J)/5

930 NEXT J

940 NEXT K

950 FOR K=l TO 19

960 PRINT DC(K)

970 NEXT K

1OOO FOR h>6 TO NS

1010 J=(K-5)-15*INT<(K-5)715)

1020 IF J=0 THEN J = 16

1030 I=INT((K-6) / 15) +1

1040 REF=VALUE(5+1,1)

1042 SENS(I,J)=(YALUE(K,J>-DC(J)>/REF*VALUE<1+5,18)/VALUE(K,18)

1050 PRINT I,J,K,VALUE(K,J),SENS<I,J)

1060 NEXT K

1100 END

1200 FOR 1=1 TO 4:FOR J=2 TO 16:SENS(I,J)=SENS<I,J)/SENS<I,1):NEXT JrNEXT I

1210 FOR 1=1 TO 5:FOR J=l TO 16:PRINT SENS(I,J):NEXT J:NEXT I

1300 OPEN4+3 AS OUTPUT ,". SILENTYPE"

1310 OUTPUT#3

1320 FOR J=l TO 16

1330 PRINT SENSU ,J) ,SENS(2,J) , SENS (3, J) ,SENS(4, J) ,SENS(5,J)

1340 NEXT J
A-16

10 REM PROGRAM CFOS

20 PRINT" CFOS CALIBRATION PROGRAM"

40 DIM DIANG(5O)

45 DIM DARK. <500)

50 DIM DIO(40),ANB(3),NR(36),NRN(36)

55 DIM A*<15)

56 DIM VALUE(500,20 )

57 DIM DCU9)

58 DIM SENS(10,16)

6O DATA 20,30,40,50,60,70,80,90,100,110,12O,13O,140,150,160

70 DATA 1.OO,.91,1.07,.98,.99,.96,1.2,1.O9,1.03,1.23,.89,1.02,1.10,.88,.96

75 DIM BDR<50)

190 DTRD=3.14159/180.

200 REM DEFINE ARCOS FUNCTION

210 DEF FN ACOS(X)=ATN(SOR(1-X*X)/X)

22O L=0

225 AVZEN=0

250 OPENS 1 AS INPUT,"/AREAl/CFOS.OFF/D.071984.O826"

251 T*="TEST.DARK"

260 B£=""

280 INPUTttl,1;B$

370 NS=VAL(B£)

375 NS=NS-2

380 PRINT NS

4OO FOR K=l TO NS

410 B4r=""

420 INPUT#1,K+1;B$

430 POS1=1

435 FOR J=l TO 2O

440 SPACE=POS1

450 POS2=INSTR<B$," ",SPACE)

460 NOC=POS2-POS1

47O VALUE<K,J)=VAL<MID$<B$,POS1,NOC>)

480 POS1=POS2+1

490 PRINT VALUE<K,J)

500 NEXT J

510 NEXT K

520 REF=VALUE<1,17)

530 NS2=NS/2

540 FOR J=l TO NS

550 VALUE(J,8)=VALUE(J,8)*REF/VALUE(J,17)

560 DARH (J)=VALUE< J,9)*0.871844+47.374

580 NEXT J

6OO F=.01

610 FOR J=l TO NS

620 DIANG<J)=VALUE<J,19)

630 IF DIANG(J) '.0. THEN DIANG < J ) =36O. -DIANG (J )

640 PRINT DIANG<J)

650 NEXT J

66O FOR J=l TO NS

670 DIANG(J)=((DIANG(J)+VALUE(J,18))-360)*DTRD .

680 DIANG(J)=ABS(DIANG(J))

685 SINE=ABS(SIN(DIANG(J)))

686 COSE=ABS(COS(DIANG(J)))

690 DIO(J)=(VALUE(J,B)-DARK(J))

700 NEXT J

701 DIO(7)=(DIO(6)+DIO(8))/2.

710 FOR J=l TO NS

720 PRINT DIO(.J)/DIO(7) , DIANG (J) /DTRD

730 NEXT J

74O qiiM=r>.
755 SINE=ABS(SIN(DIANG(k)))

756 COSE=ABS(COS<DIANG(K)))

760 SUM=SUM+DI0(k)*COSE*SINE*1O*DTRD*1*3.14159

780 NEXT k

790 SQLANG=<1.0-COS(DIANG(1)))*2.0*3.14159

795 OPEN#2 AS OUTPUT,".SILENTYPE"

796 OUTPUTS2

800 FOR H =1 TO NS

810 BDR(K)=DIO(k)*3.14159/SUM

82O PRINT BDR(k),COS(DIANG(k))

830 NEXT k

84O END

850 NMEAS=L

900 FOR k=l TO 5

910 FOR J=l TO 18

920 DC<J)=DC(J)+VALUE<K,J>/5

930 ' NEXT J

940 NEXT K

950 FOR K=l TO 19

960 PRINT DC(k)

970 NEXT k

1OOO FOR k=6 TO NS

1010 J=<k-5)-15*INT<(K-5)/15)

1020 IF J=0 THEN J=16

103O I=INT<(k-6)/15)+1

1040 REF=VALUE(5+I,1)

1042 SENS(I,J)=(VALUE<K,J)-DC(J))/REF*VALUE(1+5,18)/VALUE(K,18)

1050 PRINT I,J,k,VALUE(K,J),SENS(I,J)

1060 NEXT k

1100 END

1200 FOR 1=1 TO 4:FOR J=2 TO 16:SENS<I,J)=SENS(I,J)/SENS(I,1):NEXT J:NEXT I

1210 FOR 1=1 TO 5:FOR J=l TO 16:PRINT SENS(I,J):NEXT JsNEXT I

1300 OPEN#3 AS OUTPUT,".SILENTYPE"

1310 OUTPUT#3

1320 FOR J=l TO 16

1330 PRINT SENS<1,J),SENS(2,J),SENS(3,J),SENS(4,J),SENS(5,J)

1340 NEXT J
A-18

10 REM PROGRAM CFOS

20 PRINT" CFDS BI-DIRECTIONAL REFLECTANCE PROGRAM

40 DIM DIANG<15),SENS(15),COFFS(15),NR(5O),NRN(50)

45 DIM DARH (20,15),DIO(2O,17),BDR(20,15),OFFS<15),SLOP(15)

50 DIM ANG(20,3),NAD(20,15),AZI(20,15)

60 DATA 20,3O,40,50,6O,70,80,9O,100,11O,120,130,14O,1SO,160

SO FOR 1=1 TO 15

90 READ DIANG(I)

100 NEXT I

110 OPENttl AS INPUT,"/AREA1/CFOS.CAL/COEFF"

120 OPEIM#2 AS INPUT, "/AREA1/CFOS. CAL/ADJUST"

130 OPEN#3 AS INPUT,"/AREA1/CFOS.CAL/SENSIV"

140 FOR J=l TO 15

150 READttl,J;SLOP(J),OFFS(J)

16O READ#2,J;COFFS(J)

170 READ#3,J:SENS<J)

180 OFFS(J)=COFFS(J)

190 NEXT J

20O CLOSE

205 DTRD=3.14159/180.

210 REM DEFINE ARCOS FUNCTION

215 DEF FN ACOS(X)=ATN(SQR(1-X*X)/X)

220 PRINT" INPUT DATA FILE NAME "

225 INPUT D*

250 OPENttl AS INPUT,"/AREA1/CFOS.BACK/"+Df260 B*=""

280 INPUT#1,1;B*

37O NS=VAL(B£)

375 NS=NS-2

380 PRINT NS

400 FOR K=l TO NS

410 B$=""

420 INPUTttl ,K+1;B4?

43O POS1=1

435 FOR J=3 TO 17

440 SPACE=POS1

445 PQS2=INSTR(B4V' ",SPACE)

450 NOC=POS2-POS1

455 DIO(K,J)=VAL(MID*(B*,POS1,NOC))

460 POS1=POS2+1

465 PRINT DIO(K,J)

470 NEXT J

475 FOR J=18 TO 2O

480 SPACE=POS1

485 POS2=INSTR(B$," ",SPACE)

490 NOC=POS2-POS1

4<?5 ANG(K,J-17)=VAL(MID*<B$,POS1,NOC))

500 POS1=POS2+1

505 PRINT ANG(H',J-17)

510 NEXT J

515 NEXT K

520 REF=DIO(1,17)

530 NS2=NS/2

540 FOR J=l TO NS

545 FOR K=l TO 15

550 DARK(J,K)=DIO(J,16)*SLOP(K)+OFFS<K>

560 DIO(J,h) = (DIO(J,h )-DARH (J,K) )/SENS(K)

570 DIO(J ,K')=DIO(J,K)*REF/DIO(J, 17)

590 NEXT K

600 NEXT J

610 FOR J=l TO NS
,635 •

64O

650

680

690

700

7 1 0

720

730

740

750

760

770

775

776

7SO

79O

800

810

820

83O

840

850

860

870

880

9OO

910

920

930

940

950

96O

97O

98O

1000

1010

1020

1O30

1 040

1 050

1060

107O

1090

1100

1110

1120

1130

1140

1150

1160

1170

118O

119O

12OO

1210

1220

1230

1300

1310

1320

133O

134O

1350

ANG(J ,2;=-ANG(J,2)

PRINT ANG(J,2)

FOR \ =1 TO 15 A- 19

ALPHA=ANG(J,2)-ANG(J,1)

X=SIN(DIANG(K ) *DTRD) *COS ( ALPHA*DTRD)

NAD(J,K)= FN ACOS ( X )

COMP= ( D I ANG ( K ) -90 ) *DTRD

DEN=(SIN<NAD(J,K) > *SIN < ALPHA*DTRD) )

IF DEN=0. THEN 75O

X=(COS(COMP)-COS (NAD(J ,K) ) *COS ( ALPHA*DTRD) ) /DEN

IF DEN=0. THEN X=O.OOO01

IF DIANG(h )<"9O. THEN X=-X

IF NAD(J, 10 -O.O0001 THEN 775:ELSE X=1.0

IF X ' 1. THEN X=l.

IF X<-1. THEN X=-1.0

AZKJ,M = FN ACOS(X)

IF ALPHA- 0.0 THEN AZ K J ,K> =AZ I ( J , K) +180. 0*DTRD

IF AZI <J,K)<..0. THEN AZ I ( J ,K> =360. O*DTRD+AZ I ( J ,K)

PRINT J,K,NAD<J,K) /DTRD,AZI < J , K) /DTRD, DID <J ,K)

NEXT h'

NEXT J

SUM=0

TOTNUM=O

FOR J=l TO 36

NR(J)=0

NRN(J)=0

NEXT J

NINC=90*DTRD/36.

FOR J=l TO 13

FOR K=l TO 15

I = INT (NAD (J,K) /NINO +1

NR(I)=NR(I)+DIO(J,K)

NRN < I ) =NRN ( I ) + 1

NEXT H.

NEXT J

FOR 1=1 TO 36

IF NRN(I)=0 THEN 1O70

ANG=( 2*1-1 )/2*NI IMC

SUM=SUM+NR ( I ) /NRN ( I ) *CQS ( ANG) *SIN ( ANG) *NINC

TOTNLIM=TOTNLIM+NRIM ( I )

N I NC=90 . *DTRD/36 .

GOTO 1090

NINC=NINC+NINC

NEXT I

FLUXUP=3. 14159*SUM*2.

PRINT"UPWARD FLUX DENSITY" ; FLUXUP

MAX=0

MIN=90

FOR J=l TO 13

FOR K=l TO 15

IF NAD(J,K) .;-MAX THEN MAX=NAD < J ,K)

IF NAD(J,KXMIN THEN MIN=NAD < J ,K>

NEXT K

NEXT J

PRINT MI N, MAX

SOLANG=2.0*3. 14159* ( 1 . -COS <MAX ) )

FRACSA=SOLANG/<2.*3. 14159)

PRINT SOLANG,FRACSA

FOR J=l TO 13

FOR K=l TO 15

BDR(J,K)=DIO<J,K)*3. 14159/FLUXUP

PRINT J,K,NAD(J,K) /DTRD, AZI (J,K) /DTRD, BDR<J,K)

NEXT K

NEXT J

MAY— n

ORIGINAL PAGE IS

OE POOR QUALfTY
1375 1=1

1380 FOR J=l TO 13 A-20

1390 FOR h=l TO 15

1400 IF BDR(J,10,MAX THEN MAX=BDR (J , K )

1410 IF BDR(J,K)-MIN THEN MIN=BDR<J,K)

14-0 NEXT K

1430 NEXT J

1440 PRINT MIN,MAX

1460 QPENtt3 AS OUTPUT,"/AREA1/CFOS.BDR/"+D*

1470 WRITE33,1;NS,FLUXUP,MIN,MAX

1475 1=1

1480 FOR J=l TO NS

1490 FOR f'=l TO 15

1500 I = H-1

1510 WRITE#3,I;J,K,NAD(J,R),AZI(J,K),BDR(J,K)

1520 NEXT K

1530 NEXT J

1540 CLOSE

1550 END
A-21

1 HOME

5 X 0=0 . 0 : Y0=0 . 0 : X 1 =<b : Y 1 =4

10 DIM V(ll) ,SCALEX<21) ,SCALEY(21) ,XNUM<21) ,YNUM<21)

15 DIM XG ( 200 ) , YG ( 200 > , BDN (6,12) , BDA (2,12) , BD ( 3O ) , NA ( 1 4 )

8O FOR 1=1 TO 1O

90 P 1 X = 1 500 : P 1 Y= 1 500

95 X 0=0 . 0 : YO=O . 0 : X 1 =6 : Y 1 =4

100 XMIN=0:YMIN=0. : XMAX=180: YMAX=3. 0

110 ND I VX= 1 2 : ND I VY=5 : NP= 1 4 : D I RUN= 1 . 0 : D I R I SE=0 .

115 DTRD=3. 14159/180

120 SAW=. 1*2. 54: SAH=. 13*2.54

125 GOSUB 500

150 END

200 REM INITIALIZE PLOTER

2O 1 OPEN#9, ".RS232"

202 PRINTtt9;CHR*(27> : ". 132; ; 17: " : PRINT#9; CHR* (27) ; ".N; 19; "; "IN; "

203 P1X*=CQNV*(P1X) :P2X*=CQNV*(P2X) : PI Y*=CONV* (PI Y) : P2Y*=CONV* (P2Y) :

204 P2X=P 1 X+ < X 1 -XO ) * 1 0 1 0 : P2Y=P 1 Y+ ( Y 1 -YO) * 10 1 0

205 I F X 0= XI THEN PI X =500 : P2 X = 1 OOOO : P 1 Y=60O : P2 Y=750O

206 P1X*=CQNV* (P1X) : P2X*=CONV* (P2X ) : P1Y*=CQNV* (PI Y) : P2Y*=CONV* (P2Y)

207 PFIELD$=P1X*+", "+P1Y*+" , "+P2X*+" , "+P2Y*

208 PR I NTtt9 ; " I P " ; PF I ELD* ; " ; "

210 REM SUBROUTINE TO SCALE AXISES

211 REM XO,X1,YO,Y1 DEFINE STARTING AND ENDING POINTS IN INCHES

212 REM XMIN,XMAX,YMIN,YMAX ARE THE MAX AND MIN VALUE ON AXISES

213 REM SCALEX,SCALEY=SCALED DATA FOR TIC MARKS

214 REM NDIVX,NDIVY=NUMBER OF DIVISIONS ON AXISES

215 DELTAX=(X1-XO> /NDIVX

216 DELTAY=(Y1-YO) /NDIVY

217 SCALEX (1)=XO:SCALEY(1)=YO

218 FOR ISUB=1 TO NDI VY: SCALEY ( ISUB+1 ) =SCALEY ( ISUB) +DELTAY: NEXT

219 FOR ISUB=1 TO NDI VX : 9CALEX ( ISUB+1 ) =SCALEX ( ISUB) +DELTAX : NEXT

220 SC*=CQNV* ( XO ) + " , " +CQNV* ( X 1 ) + " , " +CQNV* ( YO ) + " , " +CONV* (YD

22 1 PR I NT#9 ; " SC " ; SO* ; " ; " : RETURN

225 REM SUBROUTINE TO SET SYMBOL MODE

226 SYM1-*=CONV*<W>+" , "+CONV*(H)

227 PRINT#9; "SI";SYM1*; "SM";SYM£; "; "

228 RETURN

230 REM THIS SUBROUTINE PLOTS SYMBOL SYM* AT LOCATION X,Y

231 REM PD=0 ,FOR PEN UP; PD=1 FOR PEN DOWN; LINET=LINE TYPE(O-4)

232 REM LINEL= LENGTH (PERCENT OF DIST. BETWEEN PI AND P2)

233 IF PD=0 THEN PRINT#9; "PU; " ; : ELSE PRINT#9; "PD; " ;

234 IF PD=0 GOTO 239

235 IF LINEL=0 THEN LINEL=4

236 LT*=CONV* ( L I NET ) + " , " +CONV* ( L I NEL )

237 PR I NT#9 ; " LT " ; LT* ; " ; "

239 SYM24r=CONV-F(X) <-" , "+CQNV* ( Y) : SYMB*=SYM*

240 PRINTS9; "PA";SYM2*; "; "

24 1 RETURN

245 REM PLOT AXIS

246 PRINTS9; "PU; "

247 XO$=CONV$(XG) : Y04:=CONV* (YO) : X 1$=CONV* (X 1 ) : Y1*=CONV* ( Yl )

248 PRIIMT#9; "PA"; XO*; ","; YO*; " ; " ; "PD; PA" ; XI*; ","; YO*; "; "; "PU; "

249 PRINTS9; "PA"; XO*; " , "; YO*; "; " ; "PD;PA"; XO*; " , ";Y1*; "; "; "PU; "

250 PR I NT#9 ; " TL 1 . 0 , 0 . O ; PA " ; XO* ; " , " YO* ; " ; "

251 FOR ISUB=1 TO NDIVX+1 : SCALE*=CONV* (SCALEX ( ISUB) )

252 PRINTtt9- "PA"; SCALE*; " ,"; YO*; ";XT; " : FOR 1 = 1 TO 100: NEXT I -.NEXT ISUB

253 PR I NT#7 ; " TL 1 . 0 , 0 . 0 ; PA " ; XO* ; " , " YO* ; " ; "

54 FOR ISUB=1 TO NDIVY+1 : SCALE*=CONV* (SCALEY ( ISUB) )

PRINT#9; "PA"; XOi ; ","; SCALE*; ";YT; ": FOR 1=1 TO 100: NEXT I : NEXT ISUB

RETURN
261 , REM LOCATION IS THE LOWER LEFT HAND CORNER

262 REM DIRUN,DIRISE: SET DIRECTION . 1,O FOR HORIZONTAL A-22

263 REM SAW,SAH SET WIDTH AND HEIGHT IN CM.

264 IF SAW=0 THEN SAW=0.1:SAH=O.15

266 AXX-T=CONV*(AXX) : AYY*=CONV* (AYY) :AXNUM*=CONV*<AXNUM)

267 PRINT#9; "SI " ; CONY* (SAW) ; " , " ;CQNV*(SAH) ; "; "

263 PRINTS9; "PA"; AXX£; " , "; AYY-S; " ; LB" ; AXNUM*; CHR* (3)

26^ RETURN

270 REM SUBROUTINE TO PLOT TEXT TXT* AT LOCATION TXX,TYY

271 REM LOCATION IS THE LOWER LEFT HAND CORNER

272 REM DIRUN,DIRISE; SET DIRECTION . 1,0 FOR HORIZONTAL

273 REM SAW,SAH SET WIDTH AND HEIGHT IN CM.

274 IF SAW=0 THEN SAW=0.1:SAH=O.15

276 TXXf=CONV*(TXX) :TYY*=CQNV*(TYY)

277 PRINTS?; "SI";CONV*(SAW) : ", ";CONV*(SAH) ; "; "

275 PRINT#9;"DI";CONY*(DIRUN);",";CONV*(DIRISE);";":FOR M=l TO 999:NEXT M

279 PRINT#9;"PA";TXX*;",";TYY^;";LB";TXT*;CHR*(3)

280 RETURN

281 REM SUBROUTINE TO CENTER DIGITS ON X AXIS

282 NUMDIGIT=LEN<CONV*(AXNUM))

283 AXX=AXX-(NUMDIGIT*SAW)/2/2.54

284 RETURN

285 REM SUBROUTINE TO CENTER DIGITS ON Y AXIS

236 AYY=AYY-SAH/2/2.54:RETURN

287 REM PLOT A CURVE OF NP POINTS IN XG,YG

283 XP=(XG(1)-XNUM(5))*DX:YP=<YG<1)-YNUM<1))*DY

289 SYM2*=CONV*(XP)+","+CONV*(YP)

290 FRINT#9;"PU;FA";SYM2*;";PD;"

291 FOR IPLOT=2 TO NP

292 XP=(XG(IPLOT)-XNUM(5))*DX:FOR D=l TO 200:NEXT D

293 YP=(YG(IPLOT)-YNUM(1»*DY

294 SYM2f=CONV$(XP>+","+CQNV*(YP)

295 PRINT#9;"PA";SYM2^;"; ":NEXT IPLOT

296 PRINTtt9;"PU;"

297 RETURN

299 RETURN

300 REM SUBROUTINE TO GET ERRORS ON HP

301 PRINT#9;CHF$(27);".£;"

302 PRINT«9;"OE;":INPUTtt9; ERROR*:PRINT ERROR*

303 RETURN

500 GOSUB 200

510 GOSUB 245

520 FOR 1=1 TO 11

525 XNUM(I)=(I-1)*0.10

530 NEXT I

535 FOR 1=2 TO 10

540 XNUM(I+10)=1.1-1*.1

545 NEXT I

550 FOR 1=1 TO 6

560 YNUM(I)=(I-1)*.5O

570 . NEXT I

575 SAW=.10*2.54:SAH=.10*2.54

580 AXX=SCALEX(2)

590 AYY=-.15*2.54

600 FOR 1=1 TO NDIVX-1

610 AXNUM=XNUM(I+5)

620 GOSUB 281

625 FOR J=l TO 100:NEXT J

630 GOSUB 260

640 AXX=SCALEX(I+2)

650 NEXT I

660 DX=(X1-XO) / (XNUM(NDIVX-H)-XNUM(l) )

665 DXH=DX

630 TXT*="COSINE OF THE OBSERVATION ZENITH"

6<?0 NUMI F.T=I FM
7 1 0 .

720

725

726

730

740

750

76O

770

775

780

790

800

810

820

830

840

850

855

860

870

880

890

900

9 1 0

920

930

940

950

960

970

980

985

990

1000

1O05

1010

1020

1 030

1040

1045

1050

1060

1070

1100

1105

1120

1130

1140

1145

1150

1160

1170

1 1 80

1 1 90

1195

1200

1210

1220

1225

1230

1240

125O

1260

TVY=-. 3 »-2. 54

GOSUB 270

DY^(Yl-v'O) / <YNUM(NDIVY+1)-YNUM<1) >

AXX=-. 2*2. 54: AYY=0

FOR 1=1 TO NDIVY+1

AXNUM=YNUM(I )

GOSUB 285

FOR J=l TO 200: NEXT J

GOSUB 260

FOR J=l TO 200: NEXT J

AYY=SCALEY(I+1)

NEXT I

TXT£="NORMALIZED RADIANCE"

TXX=-0.35*2.54

DIRUN=0.

DIRISE=1

NUMLET=LEN<TXT4?)

TYY=Yl/2. -NUMLET*SAW/2/2. 54

FOR J = l TO 800: NEXT J

GOSUB 270

FOR 1=1 TO NDIVX+1

XNUM(I) = (I-1)*O. 1

NEXT I

FOR !• =1 TO NP

PRINT K

INPUT BD(K)

NEXT K

FOR K=l TO NP

REM PR I NT Y : I NPUT X G ( K )

YG<K)=BD<K)

PRINT XG(K) ,YG(K)

NEXT K

DX=5.

GOSUB 287

SYM$="X"

W=.2:H=.2

FOR K=l TO NP

X=(XG(K) -XNUM(5) ) *DX

Y= (YG (K ) -YNUM ( 1 ) ) *DY

FOR J=l TO 40O:NEXT J

GOSUB 225

GOSUB 230

NEXT K

END

TXT*="OCEAN BDR IN THE PRINCIPAL PLANE"

D I RUN= 1 . 0 : D I R I SE=0 : SYM$= " " : GOSUB 225

TXX=1.25

TYY=5

GOSUB 270

END

TXX=1.5

TYY=4.5

SAW=. 075*2. 54: SAH=0. O75*2. 54

TXT£="0 - COSINE OF THE SOLAR ZENITH =

GOSUB 270

END

TYY=4.25

TXT*="X - COSINE OF THE SOLAR ZENITH =

GOSUB 270

END

TYY=4.0

TXT4>'="0 - 0.2 CLOUD COVER"

GOSUB 270

END

A-23

ORIGINAL PAQE &S

OF POOR QUALfTY

0.
A-24

1 HOME

5 X 0=O.O:Y0=0.O:X1=6:Y1=4

10 DIM V<11),SCALEX(21),SCALEY(21),XNUM(21),YNUM(21)

15 DIM XG(200>,YG<200),BDN(6,12),BDA(2,12),BD(3O),NA(14)

80 FOR 1=1 TO 1O

90 P1X =1500:P1Y=150O

95 X 0=O.0:Y0=0.0:X1=6:Y1=4

100 XMTN=0:YMIN=0.:XMAX=180:YMAX=3.0

110 NDIVX = 12:NYDIV=5:NP=24:DIRUN=1.0:DIRISE=0.

115 DTRD=3.14159/18O

120 SAW=.1*2.54:SAH=.13*2.54

125 GOSLIB 500

150 END

200 REM INITIALIZE PLOTER

201 OPEN#<?,".RS232"

202 PRINT#9;CHR.£(27>;".132;;17:":PRINT#9;CHR*<27);".N;19;";"IN;"

203 P1X4T=CONV£(P1X) :P2X-£=CONV$(P2X) : PI Y$=CONV* (PI Y) : P2Y$=CONV$ (P2Y) :

204 P2X=P1X +(X1-XO)*1010:P2Y=P1Y+(Y1-YO)*1010

205 IF XO=X1 THEN PIX=5OO:P2X=10000:PIY=600:P2Y=7500

206 P1X-?=CQNV*<P1:O :P2X$=CQNV£(P2X> : PI Y$=CQNV£ <P1 Y) : P2Y*=CQNV4r <P2Y)

207 PFIELD3=PlX4r+" , "+P1Y*+" , "H-P2X$+" , "+P2Y*

208 PR I NT#9 ; " IP " 5 PF IELD£; " ; "

210 REM SUBROUTINE TO SCALE AXISES

211 REM XO,X1,YO,Y1 DEFINE STARTING AND ENDING POINTS IN INCHES

212 REM XMIN.XMAX,YMIN,YMAX ARE THE MAX AND MIN VALUE ON AXISES

213 REM SCALEX,SCALEY=SCALED DATA FOR TIC MARKS

214 REM NDIVX,NDIVY=NUMBER OF DIVISIONS ON AXISES

215 DELTAX=(x'l-XO) /NDIVX

216 DELTAY=<Y1-YO)/NDIVY

217 SCALEX .< 1)=XO:SCALEY (1) =YO

218 FOR ISUB=1 TO NDIVY:SCALEY(ISUB+1)=SCALEY(ISUB)+DELTAY: NEXT

219 FOR ISUB=1 TO NDIVX:SCALEX<ISUB+1)=SCALEX(ISUB)+DELTAX:NEXT

220 SC^=CONV^(XO)+" , "+CONV* <X 1) +" , "+CONV* (YO) +" , "4-CONV* (Yl)

221 PRINT#9;"SC";SC^;";":RETURN

225 REM SUBROUTINE TO SET SYMBOL MODE

226 SYMlcr=CONV*(W)+" , "+CONV*(H>

227 PRINTS9;"SI";SYM1^;"SM";SYM$;";"

228 RETURN

230 REM THIS SUBROUTINE PLOTS SYMBOL SYM* AT LOCATION X,Y

231 REM PD=0 FOR PEN UP; PD=1 FOR PEN DOWN; LINET=LINE TYPE(0-4)

232 REM LINEL= LENGTH (PERCENT OF DIST. BETWEEN PI AND P2)

233 IF PD=0 THEN PRINT#9;"PU;";:ELSE PRINT#9;"PD;";

234 IF PD=0 GOTO 239

235 IF LINEL=0 THEN LINEL=4

236 LT*=CONV*(LINET)+","+CONV*(LINEL)

237 FRINTtt9; "LT";LT.f; "; "

239 SYM2*=CONV*(X)+","+CONV*(Y):SYMB*=SYM$

240 PRINT#9;"PA";SYM2*;";"

241 RETURN

245 REM PLOT AXIS

246 PRINTW9;"PU;"

247 XO$=CQNV*<XO):YO*=CONV*(YO):X1*=CONV$(X1):Y1*=CONV*(Yl)

248 PRINT#9;"PA";XO£;",";YO*;";";"PD;PA";X1*;",";YO*;";";"FU;"

249 PRINT#9;"PA";XO*;",";YO^;";";"PD;PA";XO*;",";Y1$;";";"PU;"

250 PRINTtt9; "TL1. 0 , 0. 0; PA" ; XO-T; " ,"YO^; "; "

251 FOR ISUB=1 TO NDIVX+1:SCALE^=CONV*(SCALEX(ISUB))

252 PRINTtt9;"PA";SCALE*;",";YO*;";XT;":FOR 1=1 TO 100:NEXT I:NEXT ISUB

253 FRINTtt9;"TL1.0,0.0;PA" ; XO*;","YO^;";"

254 FOR ISUB=1 TO NDIVY+1:SCALE*=CONvi<SCALEY<ISUB))

255 PRINTtt9;"PA";XO*;",";SCALE*;";YT;":FOR 1=1 TO 100:NEXT I:NEXT ISUB

?56 RETURN
,261 , REM LOCATION IS THE LOWER LEFT HAND CORNER

262 REN DIRUN,DIRISE; SET DIRECTION . 1,0 FOR HORIZONTAL A-25

263 REM SAW,SAH SET WIDTH AND HEIBHT IN CM.

264 IF SAW=0 THEN SAW=O.1:SAH=0.15

266 AXXf=CQNV*(AXX) :AYY*=CQNV*tAYY) : AXNUM*=CONV* (AXNUM)

267 PRINT***?; "SI " ; CONV*(SAW) ; " , " ;CONV* (SAH) ; " ; "

268 PRINT89; "PA";AXX*; " , ";AYY*; ";LB";AXNUM*;CHR*(3)

269 RETURN

270 REM SUBROUTINE TO PLOT TEXT TXT* AT LOCATION TXX,TYY

271 REM LOCATION IS THE LOWER LEFT HAND CORNER

272 REM DIRUN,DIRISE; SET DIRECTION . 1,O FOR HORIZONTAL

273 REM SAW,SAH SET WIDTH AND HEIGHT IN CM.

274 IF SAW=0 THEN SAW=O.1:SAH=0.15

276 TXX*=CONV*(TXX):TYY*=CQNV*(TYY>

277 PRINT#9;"SI";CONV* < SAW);",";CONV*(SAH);";"

278 PRINT#9;"DI";CONV*(DIRUN);",";CQNV*(DIRISE);"5":FOR M=l TO 999:NEXT M

279 PRINT+F9; "PA";TXX*; " , ";TVY*; ";LB";TXT*;CHR*(3)

280 RETURN

281 REM SUBROUTINE TO CENTER DIGITS ON X AXIS

282 NUMDIGIT=LEN(CONV*<AXNUM))

283 AXX=AXX-(NUMDIGIT*5AW)/2/2.54

234 RETURN

285 REM SUBROUTINE TO CENTER DIGITS ON Y AXIS

286 AYY=AVY-SAH/2/2.54:RETURN

287 REM PLOT A CURVE OF NP POINTS IN XG,YG

288 XF=<XG(1)-XNUM<5) ) *DX : YP= < YG (1) -YNUM (1) ) *DY

239 SYM2*=CONV* <XP> +","+CONV*(YP)

290 PR I NT#9; " PU; PA " ; S YM2*; " ; F'D; "

291 FOR IPLOT=2 TO NP

292 XP=(XG(IPLQT)-XNUM(5))*DX:FOR D=l TO 20O:NEXT D

293 YP=(YG(IPLOT)-YNUM(1))*DY

294 SYM2*=CONV*(XP)+","+CONV*(YP>

295 PRINT&9;"PA";SYM2*;";":NEXT IPLOT

296 PRINT#9;"PU;"

297 RETURN

299 RETURN

300 REM SUBROUTINE TO GET ERRORS ON HP

301 PRINT#9;CHR*< 27) ; ".E;"

302 PRINT*t9; "OE; " : INPUT89; ERROR*: PRINT ERROR*

303 RETURN

50O GOSUB 200

510 GOSUB 245

520 FOR 1=1 TO 11

525 XNUM(I)=(I-1)*0.10

530 NEXT I

535 FOR 1=2 TO 10

540 XNUM(I+10)=1.1-1*.1

545 NEXT I

550 FOR 1=1 TO 6

560 YNUM(I) = <I-1)*.50

570 NEXT I

575 SAW=.10*2.54:SAH=.10*2.54

580 AXX=SCALEX(2)

590 AYY=-.15*2.54

600 FOR 1=1 TO NDIVX-1

610 AXNUM=XNUM(I+5)

620 GOSUB 281

625 FOR J=l TO 1OO:NEXT J

630 GOSUB 260

640 AXX=SCALEX(1+2)

65O NEXT I

660 DX=(X1-XO)/(XNUM(NDIVX+1)-XNUM(1))

680 TXT*="COSINE OF THE OBSERVATION ZENITH"

690 NUMLET=LEN(TXT*)

7OO TXX=Xl/2.-NUMLET*SAW/2/2.54-0.30
.720 , G05US 2TO

725 D V = ( Y 1 -YO) / < YIMUM (NDIVY+1) -YNUM < 1 ) )

726 AX*=-.2*2.54:AYY=O

730 FOR 1=1 TO NDIVY+1

740 AXNUM=YNUM(I)

75O GOSUB 285

760 FOR J=l TO 200:NEXT J

77O GOSUB 260

775 FOR J=l TO 200:NEXT J

780 AYY=SCALEY(1 + 1)

790 NEXT I

SOO TXTJ-=" NORMAL I ZED RADIANCE"

810 JXX=-0.35*2.54

82O DIRUN=0.

830 DIRISE=1

840 NUMLET=LEN(TXTS)

85O TYY=Yl/2.-NUMLET*SAW/2/2.54

855 FOR J=l TO 800:NEXT J

860 GOSUB 270

870 FOR 1=1 TO NDIVX+1

880 XIMUM(I)=(I-1)*0.1

890 NEXT I

9OO FOR K=l TO NP

910 PRINT K

920 REM INPUT BD(K>

930 NEXT K

9-40 FOR K=l TO NP

950 XG(K)=1.+COS<<-57.5+5*K)*DTRD)

960 YG(K)=BD(K)

970 PRINT XG(K) ,YG <K)

980 NEXT K

985 DX=DX*NDIVX/NP

990 GOSUB 287

1000 SYM4r="X"

1005 W=.2:H=.2

1O10 FOR K=l TO NP

1020 X=(XG<h)-XNUM<5))*DX

1030 Y=(YG(K)-YNUM(1))*DY

1040 FOR J=l TO 400:NEXT J

1O45 GOSUB 225

1O50 GOSUB 230

1O60 NEXT K

1O70 END

1100 TXT£="CFOS BDR IN THE PRINCIPAL PLANE"

1105 DIRUN=1.0:DIRISE=0:SYM$="":GOSUB 225

1120 TXX=1.25

113O TYY=5

1140 GOSUB 270

1145 END

1150 TXX=1.5

1160 . TYY=4.5

1170 SAW=.075*2.54:SAH=0.O75*2.54

1180 TXT£=" COSINE OF SOLAR ZEN = 1.0"

1190 GOSUB 270

1195 END

1200 TYY=4.25

1210 TXT£="X - CLEAR SURFACE"

1220 GOSUB 270

1230 TYY=4.0

1240 TXT£="0 - 0.2 CLOUD COVER"

1250 END

A-26
A-27

10

20

45

50

60

70

75

80

85

90

95

100

110

120

150

160

165

167

170

190

2OO

216

217

220

230

24O

250

260

270

280

29O

300

40O

500

510

520

530

540

55O

560

570

58O

590

600

70O

710

720

730

740

750

76O

770

800

810

820

830

840

850

860

870

PRO

,52.5,

INTERPOLTION POINTS"

Y INTERPOLATION POINTS"

RAD<X,Y)"

REM PROGRAM CFOS

PRINT" CFOS BI-DIRECTIONAL REFLECTANCE PLOT PROGRAM"

DIM RAD ( 1 0 , 1 O ) , RON ( 3O , 30 )

DIM NXPdO, 10) .NYPC10, 10) ,NXD(3O) ,NYD<3O)

DATA 2.5,7.5, 12.5, 17.5,22.5,27.5,32.5,37.5,42.5,47.5

DATA 15,45,75,105,135,165,195,225,255,285,315,345

PI =3. 14159:POVR2=PI/2

PR I NT "ENTER THE NUMBER OF X DATA POINTS AVAILABLE"

INPUT NPX

PRINT"ENTER THE NUMBER OF Y DATA POINTS AVAILABLE"

INPUT NPY

FOR J=l TO 30

FOR h=l TO 30

RDN(J,K)=0.

NEXT K

NEXT J

PR I NT "ENTER THE NUMBER OF

INPUT NX

FOR J=l TO NX-1

NXD<J)=60/NX*J

NEXT J

PRINT"ENTER THE NUMBER OF

INPUT NY

FOR J=l TO NY-1

NYD ( J ) =60/NY*J

NEXT J

PR I NT "ENTER THE RADIANCE DATA AS X POS Y POS

FOR J=l TO NPX

FOR K=l TO NPY

INPUT NXP(J,K) ,NYP(J,K) ,RAD(J,R)

NEXT K

NEXT J

GOSUB 1OOO

REM SUBROUTINE TO CALCULATE WEIGHT

DELTA=60/12

IF THETA 'DELTA GOTO 570

WGHT=1.0E+06

IF THETA'.' 0.001 THEN RETURN

WGHT=DELTA/THETA

RETURN

WGHT=0.

IF<THETA-DELTA) ";=DELTA THEN RETURN

WGHT=2.0-THETA/DELTA

-RETURN

REM SUBROUTINE TO INTERPOLATE

SUMF=0.

SUMW=0.

FOR M=l TO NPX

FOR N=l TO NPY

XI=NXP(M,N)

YI=NYP(M,N)

THETA=SOR< (X I

' GOSUB 500

W=WGHT"

SUMW=SUMW+W

SUMF=SUMF+W*RAD<M,N>

NEXT N

NEXT M

INTERP=0.

IF SUMW =0. THEN RETURN

P^SI IMF/SUMW

7.

IN BDR ARRAY

XPRM) •-•2+ < YI-YPRM) '"2>
tOOO . REM CALCULATE RAD VALUES AT REGULAR ARRAY POINTS

101O FOR J=l TO NX-1

102O FOR r=l TO NY-1

103O XPRM=NXD(J >

 A

~

28

104O YPRM=NYD(K )

1320 GOSUB 700

1330 RDN(J,K)=INTERP

1340 PRINT RDN(J,K)

1350 NEXT K

1360 NEXT J

1400 OPENS4 AS OUTPUT,"/AREA1/CFOS.PLOT/"+"STYRO"

1410 MIN=99999

1420 MAX=O

1430 FOR J=l TO NX-1

1440 FOR K=l TO NY-1

1450 IF RDN(J,K)<MIN THEN MIN=RDN(J,K)

1460 IF RDN(J,K)>NAX THEN MAX=RDN(J,K)

1470 NEXT K

1480 NEXT J

1485 PRINT"MIN AND MAX OF INTERPOLATED FIELD ",MIN,MAX

149O WRITE#4,1;NX-1,NY-1,MIN,MAX

1495 1=1

1500 FOR J=l TO NX-1

1510 FOR K=l TO NY-1

1520 1=1+1

1530 WRITE#4, I; NXD (J)', NYD (K) ,RDN(J,K)

1535 PRINT NXD(J),NYD(K),RDN(J,K)

1540 NEXT K

1550 NEXT J

1560 CLOSE

1570 END
A-29

20 DIM X(30^ ,Y (30) ,XG(360) ,YG(360) ,RDN(3O,3O) ,ZLEV(20)

40 DIM R(6),XNUM(12),YNUM(12),NXD(30),NYD(30)

50 DTRD=3.14159/180.

60 DIM YM(30),Z(30,30)

70 DATA 0,30,60,90,120,ISO,180,210,240,270,300,330

80 FOR 1=1 TO 12

100 NEXT I

110 NLEV=10

115 NINCR=.O5

120 GOSUB 1000

13O GOSUB 16OO

200 REM INITIALIZE PLOTER

201 OPENtt9,".RS232"

202 PRINT#9;CHR*(27);".132;;17:":PRINT#9;CHR*(27);".N;19;";"IN;"

203 P1X*=CONV*(P1X):P2X*=CONV*(P2X) :P1Y*=CONV*(PIY):P2Y*=CONV*(P2Y)

204 P2X=PlX+(Xl-XO)*1010:P2Y=PlY-t-(Yl-YO)*1010

205 IF XO=X1 THEN PIX=50O:P2X=1000O:PIY=600:P2Y=75OO

206 P1X*=CONV*(P1X):P2X*=CONV*<P2X):P1Y*=CQNV*(PIY):P2Y*=CONV*(P2Y)

207 PFIELD-£=P1X*+" , "+P1Y*+" , "+P2X*+" , "+P2Y*

208 PRINT#9;"IP";PFIELD*; "; "

209 GOSUB 220:RETURN

210 REM SUBROUTINE TO SCALE AXISES

211 REM XO,X1,YO,Y1 DEFINE STARTING AND ENDING POINTS IN INCHES

212 REM XMIN,XMAX,YMIN,YMAX ARE THE MAX AND MIN VALUE ON AXISES

213 REM SCALEX,SCALEY=SCALED DATA FOR TIC MARKS

214 REM NDIVX,NDIVY=NUMBER OF DIVISIONS ON AXISES

215 DELTAX=(X1-XO)/NDIVX

216 DELTAY=(Y1-YO)/NDIVY

217 SCALEX(1)=XO:SCALEY(1)=YO

218 FOR ISUB=1 TO NDIVY:SCALEY(ISUB+1)=SCALEY<ISUB)+DELTAY:NEXT

219 FOR ISUB=1 TO NDIVX:SCALEX<ISUB+1)=SCALEX(ISUB)+DELTAX:NEXT

220 SC*=CONV*(XO)+","+CONV*(X1)+","+CONV*(YO)+","+CONV*(Yl)

221 PRINT#9;"SC";SC*;";":RETURN

225 REM SUBROUTINE TO SET SYMBOL MODE

226 SYM1*=CONV*(W)+","+CONV*(H)

227 PRINTS9;"SI";SYM1*;"SM";SYM*;";"

223 RETURN

230 REM THIS SUBROUTINE PLOTS SYMBOL SYM* AT LOCATION X,Y

231 REM PD=0 FOR PEN UP; PD=1 FOR PEN DOWN; LINET=LINE TYPE(0-4)

232 REM LINEL= LENGTH (PERCENT OF DIST. BETWEEN PI AND P2)

233 IF PD=0 THEN PRINT#9;"PU;";:ELSE PRINTS9;"PD;";

234 IF PD=0 GOTO 239

235 IF LINEL=0 THEN LINEL=4

236 LT*=CONV*(LINET)+","+CONV*(LINED

237 PRINT#9;"LT";LT*;" ; "

239 SYM2*=CONV*(X)+", "+CONV*(Y>:SYMB*=SYM*

240 PRINT#9;"PA";SYM2*; " ; "

241 RETURN

245 REM PLOT AXIS

246 FRINT#9;"PU;"

247 XO*=CONV*(XO):YO*=CONV*(YO):X1*=CONV*(X1):Y1*=CONV*(Yl)

248 PRINT-&9; "PA"; XO*; " ,";YO*; "; "; "PD; PA" ,-X 1*; " , "; YO*; "; "; "PU; "

249 PRINTtt9;"PA";XO*;",";YO*;";";"PD;PA";XO*;",";Yl*;";";"PU;"

250 PRINT#9;"TL1.0,0.0;PA";XO*; ","YO*; " ; "

251 FOR ISUB=1 TO NDIVX+1:SCALE*=CONV*(SCALEX(ISUB))

252 PRINT#9;"PA";SCALE*;",";YO*;";XT;":NEXT

253 PRINTS?;"TL1.0,0.0;PA";XO*;","YO*;"; "

254 FOR ISUB=1 TO NDIVY+1:SCALE*=CONV*(SCALEY(ISUB))

255 PRINT4+9; "PA";XO*; ", "; SCALE*; "; YT; ":NEXT

256 RETURN

260 REM SUBROUTINE TO PLOT NUMBER AXNUM AT LOCATION AXX,AYY
1 , 0 FOR HORIZONTAL

IN CM.

2o2. , REf-1 DIRUN,DIRISE: SET DIRECTION

263 REM SAW,SAH SET WIDTH AND HEIGHT

264 IF SAW=0 THEN SAW=O. 1 : SAH=O. 15

266 AXX*=CONV* (AXX) : AYY*=CONV* ( AYY) : AXNUM*=CONV£ < AXNUM)

267 PRINT#9; "SI" ; CONV* (SAW) ; " , ";CONV*<SAH> ; "; "

268 PRINTtt9; "PA"; AXX*; " , ";AYY£; " ; LB" ; AXNUM*; CHR* <3)

269 RETURN

270 REM SUBROUTINE TO PLOT TEXT TXT* AT LOCATION TXX,TYY

271 REM LOCATION IS THE LOWER LEFT HAND CORNER

272 REM DIRUN,DIRISE; SET DIRECTION . 1,0 FOR HORIZONTAL

273 REM SAW,SAH SET WIDTH AND HEIGHT IN CM.

274 IF SAW=0 THEN SAW=O. 1 : SAH=0. 15

275 PRINTtt9; "PU; "

276 TXX*=CONV*(TXX> : TYY*=CONV* (TYY)

277 PR I NT#9 ; " S I " ; CONV* ( SAW );","; CONV* ( SAH ) ; " ; "

273 PR I NT#9 ; " D I" ; CONV* ( D I RUN );","; CONV* < D I R I SE > ; " ; "

279 PRINT#9; "PA";TXX*; ", ";TYY*; " ; LB" ; TXT*; CHR* <3>

280 RETURN

281 REM SUBROUTINE TO CENTER DIGITS ON X AXIS

282 NUMDIGIT=LEN<CONV*<AXNUM) )

283 AXX=AXX-<NUMDIGIT*SAW> X2/2.54

284 RETURN

285 REM SUBROUTINE TO CENTER DIGITS ON Y AXIS

286 AYY=AYY-SAH/2/2. 54: RETURN

287 REM PLOT A CURVE OF NP POINTS IN XG,YG

288 X P= X G ( O ) : YP= YG ( 0 )

289 SYM2*=CONV$<XP)+", "+CONV*<YP>

290 PR I NT#9 ; " PU ; PA " ; SYM2* ; " ; PD ; "

2^1 FOR IPLOT=1 TO NP

292 XP=XG(IPLOT)

293 YP=YGi'IPLOT)

294 SYM2*=CONV$(XP)-(-" ,"+CONV*<YP)

295 PRINT#9; "PA" ; SYM2f; ";PD; ".-NEXT I PLOT

296 PRINT#9; "PU; "

297 RETURN

299 RETURN

300 REM SUBROUTINE TO GET ERRORS ON HP

301 PRINT#9;CHR£<27) ; ".E; "

302 . PRINT#9; "OE; ": INPUT#9; ERROR*: PRINT ERROR*

303 RETURN

400 REM SUBROUTINE TO PUT AZIMUTH TIC MARKS

410 TXT*="_"

420 SAW=0. 1:SAH=0. 1

430 DIRUN=CSIN

435 IF ABS(DIRUN)<'0.01 THEN DIRUN=0.

440 DIRISE=SINE

445 IF ABS(DIRISE)-O.O1 THEN DIRISE=0

450 TXX=XG(K) :TYY=YG(K )

460 GOSUB 270

470 RETURN

1000 REM INITIALIZE PLOTTER

1010 P1X=1500

1020 P1Y=1250

1030 X0=0

104O Y0=0

1050 XI =6

106O Yl=6

1070 SAW=O. 1*2.54

1080 SAH=0. 13*2. 54

1090 CX=3.0

1100 CY=3.0

111O XMIN=O.O

1120 XMAX=6.O

1130 YMIN=0.00

1140 YMA>' = 6.

A-30
,1 IftO

1 1 70

1180

1200

1205

1206

1210

1220

1230

1240

1250

1255

1260

1270

1280

1290

1295

1390

1400

141O

1415

1420

1425

1430

144O

15] 0

1530

1600

1610

1620

1630

1640

1650

1655

1660

1670

1680

1690

1700

1710

1720

1730

1800

1810

1820

1830

1840

1850

1360

1870

1880

1910

1920

1925

1930

49OO

4910

4920

5000

5001

5O02

5003

5004

50O5

UJ=1

H=l

GOSUB 225

REM PLOT BOUNDARY

XNLIM < 1 ) =0 : YNUM ( 1 ) =O

DX=1 : DY=1 :NP=5

XG ( n =-2+CX : YB ( 1 ) =-2+CY

XG<2)=-i-2+CX

XG(3)=XG(2 )

XG(4)=XG(1 )

A-31

YG(2)=YG(1)

YG(3)=+2+CY

YG(4)=YG(3)

XG(5)=XG(1) YG(5)=YG(1)

PRINT#9; "PU"

FOR K=l TO NP

XP=XG<h) : YP=YG(K)

PRINT#9; "PA";SYM2*; "; PD;PA; "

NEXT K

SAW=.25:SAH=.25

TXT£=" TAU = 60.0"

TXX=2. 25: TYY=CY-2. 25

D I RUN= 1 . 0 : D I R I SE=0 . 0

GOSUB 270

TXT*=" TAU = O.O"

TXX=2.25:TYY=CY+2.25

GOSUB 270

FOR P=l TO 100: NEXT P

RETURN

REH INPUT INTERPOLATED BDN FIELD

PRINT" INPUT FILE NAME OF INTERPOLATED DATA"

INPUT D*

OPEN#2, "/ AREA 1/CFOS. PLOT/ "+D$

1 = 1

READtt2, 1 ; NX, NY, M IN, MAX

PRINT NX, NY, M IN, MAX

FOR J=l TO NX

FOR K=l TO NY

1 = 1 + 1

READ4t2, I;NXD(J ) ,NYD(K ) ,RDN(J,K )

PRINT J,K,NXD(J ) ,NYD(K ) ,RDN(J,K )

NEXT K

NEXT J

REM SET UP CONTOUR ARRAYS

ZMIN^MIN

ZMAX=MAX

FOR J=l TO NX

FOR !•- = ! TO NY

Z<J,f.)=RDN(J,K)

NEXT K

NEXT J

NXP=NX:NXP1=NX-1

IMYP=NY:NYP1=NY-1

FOR N=l TO NLEV

ZLEV(N)=INT(ZMIN*10O)/100+N*NINCR

NEXT N

GOSUB 4900

IDUB=0

DELTAT=4/NYP1

DELTAR=4/NXP1

FOR 1=1 TO NYP1

TO=(I-1)*DELTAT

T1=TO+DELTAT

FOR J=l TO NXP1

RO=(J-1)*DELTAR

R1=RO+DELTAR

M 1 = 7 ( .1 . T 1
5 OS 3

5009

5010

5011

5012

5013

5014

5015

5016

5017

5018

5019

5020

5021

5022

5023

5O24

5O25

5026

5027

5028

5029

5030

5031

5032

5033

5034

5035

5036

5037

5080

5032

5033

5035

5036

5090

5100

5200

5250

5300

5310

5320

5330

5340

5350

5360

5365

5370

5380

5390

5400

5410

5420

5430

5440

5450

5460

5470

H5=2 (J+l , 1+1)

H4=2 (J, 1 + 1)

REM IF I = NYP1

REM IF I = NYP1

FDR h- = l TO NLEV

ZLEV=ZLEV(I- )

IF H1J=ZLEV GOTO

IF H2 = ZLEV BOTO

IF H3..=ZLEV GOTO

THEN H3=Z(J+1,1)

THEN H4 = 2(J,1)

5023

SOI1?

5020

A-32

IF H4'- ZLEV

GOTO 5100

GOTO 5030

IF

IF

IF

IF

IF

IF

IF

IF

IF

IF

IF

H3 '

H4-"

H4-.

H4 •

ZLEV

ZLEV

ZLEV

ZLEV

GOTO

GOTO

GOTO

GOTO

H2r=ZLEV GOTO

H3 =•

H4<

H3<

H4<

H4<"

H4:-

= ZLEV

ZLEV

ZLEV

ZLEV

ZLEV

= ZLEV

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

5021

503 1

5O33

5035

502

*

;

j

:

6

ELSE

ELSE

ELSE

ELSE

GOTO

GOTO

GOTO

GOTO

5022

5032

503

503

4

6

5027

5036

5O28

5O37

5032

•

m

•

•

•

ELSE

ELSE

ELSE

ELSE

GOTO

GOTO

GOTO

GOTO

5035

502

503

503

9

~^

1

5090

X A=RA+ 1

TA=TO+(Hl-ZLEV)/(H1-H4)*DELTAT:TB=T1:RA=RO:RB=RO+ <H4-ZLEV)/<H4-H3

)*DELTAR:GOTO 508O

TA=TO+(H2-ZLEV)/(H2-H3)*DELTAT:TB=T1:RA=R1:RB=RO+(H4-ZLEV)/ (H4-H3

)*DELTAR:GOTO 5080

TA=TO+<H1-ZLEV)/<H1-H4)*DELTAT:TB=TO+(H2-ZLEV>/(H2-H3)*DELTAT:RA=

RO:RB=R1:GOTO 5080

TA=TO:TB=TO+(H2-ZLEV)/(H2-H3)*DELTAT:RA=RO+(Hl-ZLEV)/(H1-H2)*DELT

AR:RB=R1:IDUB=0:GOTO 5030

IDUB=1:GOTO 5030

TA=TO:TB=T1:RA=RO+(Hl-ZLEV)/(H1-H2)*DELTAR:RB=RO+(H4-ZLEV)/(H4-H3

)*DELTAR:GOTO 5080

TA=TO:TB=TO+(Hl-ZLEV)/(H1-H4)*DELTAT:RA=RO+(Hl-ZLEV)/(H1-H2)*DELT

AR:RB=RO:IDUB=O:GOTO 5O80

IDLIB=-1:GOTO 5031

'XB=RB+1:YA=TA+1:YB=TB+1

XA):XB*=CONV*(XB):YA*=CONV£<YA):YB^=CONV$(YB)

PRINT«9;"PU";XA^;","YA$;";PD";XB*;","YB*;";PU;"

IF IDUB=-1 THEN 5036

IF IDUB=1 THEN 5033

NEXT K

NEXT J

NEXT I

END

FOR J=l TO NXP1

FOR k=l TO NYP1

IF Z(J,K)=ZMIN

IF Z(J,K)=ZMAX

NEXT K

NEXT J

PRINT JMIN,KMIN,JMAX,KMAX

DIRUN=1:DIRISE=0

RMIN=(JMIN-1)*DELTAR

RMAX=(JMAX-1)*DELTAR

TMIN=(KMIN-1)*DELTAT

TMAX= (H'MAX-1) *DELTAT

XMIN=RMIN+1

XMAX=RMAX+1

YMIN=TMIN+1

YMAX=TMAX+1

TXX=XMIN:TYY=YMIN:TXT^="L"

GOSUB 270

TXX=XMAX:TYY=YMAX:TXTf="H"

THEN

THEN

JMIN=J:KMIN=K

JMAX=J:KMAX=K
.5500, T X X =0. 3O A-33

'S510 TYY=-.5O

5520 TXT*="L = "+CONV*(2MIN)+" H = "+CONV*<ZMAX)+" INTERVAL = "+CONV£(ZL

EV(2)-ZLEV(1))

5530 GOSUB 270 '

5540 END
A-34

20 DIM NA(30),A2<30),XG<360),YG(360),BDN(30,3O),ZLEV<20)

4O DIM R(6),XNUM(12),YNUM(12)

50 DTRD=3.14159/1SO.

60 DIM AZM(30),Z(30,30)

70 DATA 0,30,60,90,120,150,180,210,240,270,30O,330

80 FOR 1=1 TO 12

9O READ AZM(I)

100 NEXT I

110 NLEV=10

115 NINCR=.50

12O GOSUB 1000

130 GOSUB 160O

200 REM INITIALIZE PLOTER

201 OPENttP,".RS232"

202 PRINT#9;CHR*<27);".132;;17:":PRINT#9;CHR*(27); ".N;19;";"IN;"

203 P1X*=CONV*(P1X):P2X*=CQNV*(P2X):PIY*=CQNV*(P1Y):P2Y*=CONV*(P2Y)

204 P2X=P1X+(X1-XO)*1010:P2Y=P1Y+(Y1-YO)*101O

205 IF XO=X1 THEN PIX=500:P2X=1OOOO:PIY=60O:P2Y=7500

206 P1X*=CQNV*(P1X) :P2X-*=CONV*(P2X) : PI Y*=CONV* (PI Y) :P2Y*=CONV*(P2Y)

207 FFIELD*=P1X*+" , "+P1Y*+" , "+P2X*+" , "+P2Y*

203 PR I NT-&9; " IP"; PFI ELD*; " ; "

209 GOSUB 220:RETURN

210 REM SUBROUTINE TO SCALE AXISES

211 REM XO,X1,YO,Y1 DEFINE STARTING AND ENDING POINTS IN INCHES

212 REM XMIN,XMAX,YMIN,YMAX ARE THE MAX AND MIN VALUE ON AXISES

213 REM SCALEX,SCALEY=SCALED DATA FOR TIC MARkS

214 REM NDIVX,NDIVY=NUMBER OF DIVISIONS ON AXISES

215 DELTAX=(X1-XO)/NDIVX

216 DELTAY=(Y1-YO)/NDIVY

217 SCALEX(1)=XO:SCALEY<1)=YO

218 FOR ISUB=1 TO NDIVY:SCALEY(ISUB+1)=SCALEY(ISUB)+DELTAY:NEXT

219 FOR ISUB=1 TO NDIVX:SCALEX(ISUB+1 )=SCALEX(ISUB)+DELTAX:NEXT

220 SC*=CONV* <XO)+" , "+CQNV* ( X 1) + " , "+CONV*(YO) +" , "+CQNV*(Y1)

221 PRINT#9;"SC";SC*;";":RETURN

225 REM SUBROUTINE TO SET SYMBOL MODE

226 SYM1*=CQNV* (W) +" , " <-CQNV* (H)

227 FRINT#9; "SI";SYM1*; "SM";SYM*; " ; "

228 RETURN

230 REM THIS SUBROUTINE PLOTS SYMBOL SYM* AT LOCATION X,Y

231 REM PD=0 FOR PEN UP; PD=1 FOR PEN DOWN; LINET=LINE TYPE(0-4)

232 REM LINEL= LENGTH (PERCENT OF DIST. BETWEEN PI AND P2)

233 IF PD=0 THEN PRINT#9; "PU; " ; : ELSE PRINT4+9; "PD; " ;

234 IF PD=0 GOTO 239

235 IF LINEL=0 THEN LINEL=4

236 LT*=CONV$(LINET)+","+CONV£(LINEL)

237 PRINT#9;"LT";LT^;";"

239 SYM24=CONV*(X)+","+CONV^(Y):SYMBf=SYM*

240 PRINT#9;"PA";SYM2£;";"

241 RETURN

245 REM PLOT AXIS

246 PRINT#9;"PU;"

247 XO*=CONV^(XO):YO*=CONVS(YO):X1^=CONV*(X1):Y1*=CONV*(Yl)

248 PRINT#9; "PA"; XO-f; " , "; YOf; "; "; "PD;PA"; XI*; ", ";YO*; "; "; "PU; "

249 PRINT4*9; "PA"; XO*; " ,";YO*; "; "; "PD;PA";XO*; ", ";Y1*; "; "; "PU; "

250 PRINT#9;"TL1.0,O.0;PA";XO*;","YO*;";"

251 FOR ISUB=1 TO NDIVX+1:SCALE*=CONV*(SCALEX(ISUB))

252 PRINf#9;"PA";SCALE*;",";YO*;";XT;":NEXT

253 PRINT4t9; "TL1. 0 , 0. 0; PA" ; XO*; ", "YO*; "; "

254 FOR ISUB^l TO NDIVY-+-1: SCALE*=CONV* (SCALEY (ISUB) )

255 PRINTtt9;"PA";XO*;",";SCALE*;";YT;":NEXT

256 RETURN
26 i .

2t>2

263

264

266

267

263

269

270

271

*-»"7'~t

il / -_

273

274

275

276

277

278 •

279

280

281

282

283

234

285

286

287

288

289

290

291

292

293

294

295

296

297

299

300

301

3O2

303

4OO

410

420

430

435

44O

445

450

460

470

1000

1010

1020

1030

I 040

1050

1060

1O70

1080

1O90

1100

1110

1120

1 1 —Vi

REM LOCATION IS THE LOWER LEFT HAND CORNER

REM DIRUN.DIRISE; SET DIRECTION . 1,O FOR HORIZONTAL

REM SAW,SAH SET WIDTH AND HEIGHT IN CM.

jp SAW=0 THEN SAW=0.1:SAH=O.15

AXX*=CONV*(AXX> :AYY*=CONV*(AYY) :AXNUM*=CONV* <AXNUM)

F'RlNTtt9; "SI"; CONV* (SAW) ; ","; CONV* (SAH) ; "; "

PRINTS9;"PA";AXX*;",";AYY*;";LB";AXNUM*;CHR*(3)

RETURN

REM SUBROUTINE TO PLOT TEXT TXT* AT LOCATION TXX,TYY

REM LOCATION IS THE LOWER LEFT HAND CORNER

REM DI RUN,DIRISE; SET DIRECTION . 1,O FOR HORIZONTAL

REM SAW,SAH SET WIDTH AND HEIGHT IN CM.

IF SAW=0 THEN SAW=O.1:SAH=0.15

PRlNTtt9;"PU;"

TXX*=CONV*(TXX):TYY*=CONV*(TYY)

PRINT#9;"SI";CONV*(SAW);",";CONV*(SAH);";"

PRINT#9;"DI";CONV*(DIRUN); ",";CONV*(DIRISE); "; "

PRINT#9; "PA";TXX*; ", ";TYY*; ";LB";TXT*;CHR*(3)

RETURN

REM SUBROUTINE TO CENTER DIGITS ON X AXIS

NUMDIGIT=LEN(CONV*(AXNUM))

AXX=AXX-(NUMDIGIT*SAW)/2/2.54

RETURN

REM SUBROUTINE TO CENTER DIGITS ON Y AXIS

AYY=AYY-SAH/2/2.54:RETURN

REM PLOT A CURVE OF NP POINTS IN XG,YG

XP=XG(0>:YP=YG(O)

A-35

SYM2J-=CONVS (XP) + " , " +CONV* (YP)

PRINT#9:"PU;PA";SYM2*; ";PD; "

FOR IPLOT=1 TO NP

XP=XG(IPLOTJ

YP=YGnPLOT)

SYM2*=CONV* < XP)+","+CONV*(YP)

PRINT#9;"PA";SYM2$;";PD;":NEXT IPLOT

PRlNTtt9;"PU; "

RETURN

RETURN

REM SUBROUTINE TO GET ERRORS ON HP

PRINTtt9;CHR$<27>;".E;"

PR I NTtt9; " OE; " : I NPUT#9; ERROR*". PR I NT ERROR*

RETURN

REM SUBROUTINE TO PUT AZIMUTH TIC MARKS

TXT-T="_"

SAW=0.1:SAH=0.1

DIRUN=CSIN

IF ABS(DIRUN)-O.O1 THEN DIRUN=0.

DIRISE=SINE

IF ABS(DIRISE)<0.01 THEN DIRISE=O

TXX=XG(K):TYY=YG(K)

GOSUB 270

RETURN

REM INITIALIZE PLOTTER

P1X=1500

P1Y=1250

X0=0

Y0=0

Xl=6

Yl=6

SAW=0.1*2.54

SAH=0.13*2.54

CX=3.O

CY=3.O

XMIN=0.0

XMAX=6.O

V/ M T K » /~^ ,~\ /"»
1 15,O ,

1160

1170

1180

1200

1205

12O6

1210

1220

1230

1235

1240

1250

1265

1270

123O

1290

1300

131O

1315

1330

1340

1350

1360

1390

1400

1410

1415

1420

1425

1430

1440

1450

1455

1460

1470

1480

1490

1500

1510

1520

1530

1600

1610

1620

1630

1640

1650

1655

1660

1670

1680

1690

1700

1710

1720

1730

1800

1810

1820

1830

1840

1850

1860

1870

GO3UB 200

W=l

H=l

GOSUB 225

REM PLOT BOUNDARY

XNUM(1)-0:YNUM(1)=0

DX=1:DY=1:NP=360

FOR 1=1 TO 6

R(I)=1*0.45

FOR h=0 TO 360 STEP 5

CSIN=COS(h *DTRD) :SINE=SIN(K*DTRD)

XG< h )=R(I)*CSIN+CX

YG(h >=R(I)*SINE+CY

SYM24r=CQNy£<XP)+" , "+CONV£(YP)

XP=XG(k):YP=YG(K)

SYM24r=CONV£(XP)+ ", "+CQNV$<YP>

PRINTS9;"PU;PA";SYM2*;";PD;"

FOR P=l TO 12

IF k=AZM(P) THEN GOSUB 4OO

NEXT P

NEXT K

NEXT I

1=6

FOR K=0 TO 330 STEP 30

SAW=.25:SAH=.25

TXT£=" "+CQNV*<K>

DIRUN=COS<k*DTRD)

IF ABS(DIRUN)<0.01 THEN DIRUN=0.

DIRISE=SIN(k*DTRD>

IF ABS(DIRISE)-:0.01 THEN DIRISE=0.

TXX=R (6) *COS U>DTRD> +CX

TYY=R(6)*SIN(K*DTRD)+CY

IF f'.^.=90 THEN 1500

IF K'-=270 THEN 1500

DIRISE=-DIRISE

DIRUN=-DIRUN

TXX=TXX+3*SAW*COS(K*DTRD)

TYY=TYY+3>SAH*SIN(K*DTRD)

PRINT I-:,TXX,TYY,DIRUN,DIRISE: GOSUB 270

FOR P=l TO 100:NEXT P

NEXT K

RETURN

REM INPUT INTERPOLATED BDN FIELD

PRINT"INPUT FILE NAME OF INTERPOLATED DATA"

INPUT D£

OPEN#2, "/AREAl/CFOS.F'LOT/"+Dl:

1 = 1

READ#2,1;NNAD,NAZM,FLUXUP,MIN,MAX

PR INT NNAD,NAZM,FLUXUP,MIN,MAX

FOR J=l TO NNAD

FOR K=l TO NAZM

1 = 1 + 1

READ#2,I;NA(J),AZ(K),BDN(J,K)

PRINT J,K,NA<J),AZ(K),BDN(J,K)

NEXT K

NEXT J

REM SET UP CONTOUR ARRAYS

ZMIN=MIN

ZMAX=MAX

FOR J=l TO NNAD

FOR \ =1 TO NAZM

Z(J,K)=BDN(J,K)

NEXT K

NEXT J

NRAD=NNAD:NRM1=NRAD-1

A-36
1920

1925

197-0

4900

4910

4

C?2O

500O

5001

5002

5003

5O04

5005

5006

5007

5008

5009

50 1 0

5011

50 1 2

5013

5014

50 1 5

5016

50 1 7

5018

5019

5020

5021

5022

5023

5024

5O25

5026

5027

502S

5029

5030

5031

5032

5033

5034

5036

5037

5O80

50S2

5083

5085

5086

5090

5 1 00

520O

5250

5300

53 1 0

5320

5330

N=1 TO NLEV

ZLEV (N> =INT ( ZM INx-lO) / 1O+IM*N I NCRNEXT N

GOSUB 490O

IDUB=0

DELTAT=3.14159/(NTM1)*2

DELTAR=R(6)/(NRM1)

FOR 1=1 TO NTM1

TO=(I-1)*DELTAT

T1=TO+DELTAT

FOR J = l TO NRM1

RO=(J-1)*DELTAR

R1=RO+DELTAR

H1 = Z (J,I)

H2=Z(J+l,I)

H3=Z(J+1,1+1)

H4=Z(J,1+1)

A-37

IF I=NTM1 THEN H3=

IF I=NTM1 THEN H4=

FOR (-'=! TO NLEV

ZLEV=ZLEV(K)

IF Hl;=ZLEV GOTO

IF H2.=ZLEV GOTO

IF H3" =ZLEV GOTO

IF H4'> ZLEV GOTO

GOTO 5

IF

IF

IF

IF

IF

IF

IF

IF

IF

IF

IF

H3-.

H4~'

H4=:

H4

H2;

H3^

H4-r

H3-'

H4<

H4<'

H4-

100

ZLEV

ZLEV

ZLEV

ZLEV

= ZLEV

= ZLEV

ZLEV

ZLEV

ZLEV

ZLEV

= ZLEV

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

Z (J+l

Z (J, 1

5023

5019

5020

503O

5021

5031

5033

5035

5O2

5O2

5O36

5028

5037

5032

•

•

•

•

6

7

•

•

•

•

,D

)

ELSE

ELSE

ELSE

ELSE

ELSE

ELSE

ELSE

ELSE

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

GOTO

5022

5032

5O34

5036

5035

5029

5033

5031

5090

TA=TO+(H1-ZLEV)/(H1-H4)*DELTAT:TB=T1:RA=RO:RB=RO+(H4-ZLEV)/(H4-H3

)*DELTAR:GOTO 5080

TA=TO+(H2-ZLEV)/(H2-H3)*DELTAT:TB=T1:RA=R1:RB=RO+(H4-ZLEV)/(H4-H3

)*DELTAR:GOTO 508O

TA=TO+(Hl-ZLEV)/(H1-H4)*DELTAT:TB=TO+(H2-ZLEV)/(H2-H3)*DELTAT:RA=

RO:RB=R1:GOTO 508O

TA=TO:TB=TO+(H2-ZLEV)/(H2-H3)*DELTAT:RA=RO+(Hl-ZLEV)/(H1-H2)*DELT

AR:RB=R1:IDUB=0:GOTO 5OSO

IDUB=1:GOTO 5O30

TA=TO:TB=T1:RA=RO+(Hl-ZLEV)/(H1-H2)*DELTAR:RB=RO+(H4-ZLEV)/(H4-H3

)*DELTAR:GOTO 5080

TA=TO:TB=TO+(Hl-ZLEV)/(H1-H4)*DELTAT:RA=RO+(Hl-ZLEV)/(H1-H2)*DELT

AR:RB=RO:IDUB=0:GOTO 508O

IDUB=-1:GOTO 5031

XA=RA*COS(TA)+CX:XB=RB*COS(TB)+CX:YA=RA*SIN <TA)+CY:YB=RB*SIN(TB) +

CY

XAf=CONVf (XA) : XB-£=CONV£ (XB) : YA$=CONV* (YA) : YB*=CONV$ (YB)

PRINT«9;"PU";XA*;","YA?;";PD";XB$;","YBf;";PU;"

IF IDUB=-1 THEN 5036

IF IDUB=1 THEN 5033

NEXT INEXT J

NEXT I

END

FOR J=l TO NNAD

FOR K=l TO NAZM

IF Z(J,K)=ZMIN THEN JMIN=J:KMIN=K

IF Z<J,h"'=ZI"1AX THEN JMAX=J: KT1AX=H'
5360

5365

5370

5380

5390

5400

5410

5420

5430

544O

5450

5460

5470

5480

5490

5520

5530

554O

NE*T J

PRINT JMIN,K'MIN, JMAX ,t MAX

DIRUN=1 : DIRISE=O

RMIN=(JMIN-1)*DELTAR

RMAX=(JMAX-1) *DELTAR

TMIN=(M-1IN-1)*DELTAT

TMAX=(HVIAX-1)*DELTAT

XMIN=RMIN*CQS<TMIN)+CX

XMAX=RMAX*COS(TMAX)+CX

YM I N=RM I N*S I N ( TM I N ) +CY

YMAX=RMAX*SIN(TMAX)+CY

TXX = XMI!M:TYY=YMIN:TXTJ:="L"

GOSUB 270

TXX=XMAX : TYY=YMAX : TXT*="H"

GOSUB 270

END

TXX=O.30

TYY=-.50

TXT^="L = "+CDNV^ (ZMIN) +"

EV(2)-ZLEV(1) )

GOSUB 270

END

A-38

H = "+CQNV*(ZIVIAX>+" INTERVAL = "+CONV$(ZL
A-39

10 REM PROGRAM CFOS

20 PRINT" CFOS BI-DIRECTIONAL REFLECTANCE INTERP. PROGRAM'

45 DIM BDR(13,15),BDN(30,30),NAN(3O),AZIN(30)

50 DIM NAD(13,15),AZI(13,15)

60 DATA 2.5,7.5,12.5,17.5,22.5,27.5,32.5,37.5,42.5,47.5,52.5,57.J

70 DATA 15,45,75,105,135,165,195,225,255,285,315,345

75 PI=3.1415c?:POVR2=PI/2

100 FOR J=l TO 30

110 FOR I- =1 TO 30

120 BDN(J,K>=0.

ISO NEXT K

160 NEXT J

165 PRINT"ENTER THE NUMBER OF NAD INTERPOLTION POINTS"

167 INPUT NNAD

170 FOR J=l TO NNAD

190 NAN(J)=PI/3/NNAD*(J-l)

200 NEXT J

205 DTRD=3.14159/180.

210 DEF FN ACOS(X)=ATN(SQR(1-X*X)/X)

215 DEF FN ACOS<X)=ATN<SQR(1-X*X>/X)

216 PRINT"ENTER THE NUMBER OF AZIMUTHAL INTERPOLATION POINTS"

217 INPUT NAZM

220 FOR J=l TO NAZM

230 AZIN(J)=2*PI/NAZM*<J-1>

240 NEXT J

250 PRINT" INPUT DATA FILE NAME "

260 INPUT DJr

270 OPEN#3 AS INPUT,"/AREA1/CFOS.BDR/"+D$

280 READ#3,1;NS,FLUXUP,MIN,MAX

290 1=1

300 FOR J=l TO NS

310 FOR \ =1 TO 15

320 1=1+1

330 READ#3,I;J,K,NAD(J,K),AZI(J,K),BDR(J,K)

340 PRINT J,K,NAD(J,K>,AZI<J,K),BDR<J,K>

35O NEXT K

360 NEXT J

370 PRINT" UPWARD FLUX DENSITY EQUALS ",FLUXUP

380 PRINT" MIN AND MAX VALUES OF BDR FUNCTION ",MIN,MAX

400 GOBUB 1000

500 RED SUBROUTINE TO CALCULATE WEIGHT

510 DELTA=PI/6.

520 IF THETAxDELTA GOTO 57O

530 WGHT=1.0E+06

540 IF THETA<0.001 THEN RETURN

550 WGHT=DELTA/THETA

560 RETURN

570 WGHT=0.

580 IF(THETA-DELTA)';=DELTA THEN RETURN

590 WGHT=2.0-THETA/DELTA

60O RETURN

700 REM SUBROUTINE TO INTERPOLATE IN BDR ARRAY

710 SUMF=0.

720 SUMW=O.

730 FOR M=JMIN TO JMAX

74O FOR N=KMIN TO KMAX

750 ZI=NAD<M,N)

760 AI=AZI(M,N)

77O THETA=COS(ZI)*COS(ZPRM)+SIN <ZI>*SIN(ZPRM)*COS <AI-APRM)

78O IF THETA<0. GOTO 84O

790 JHETA= FN ACOS<THETA>
'8 16 '

820

830

840

850

860

870

880

900

1000

1O10

1020

1030

1 040

1050

1060

1070

1O75

1080

1085

1090

1100

1120

1130

1150

1160

1170

1180

1190

1200

1210

1230

1240

1250

1260

1270

1280

1290

1300

1310

1320

1330

1340

1350

1360

1400

1410

1420

1430

1440

1450

1460

1470

1480

1485

1490

1495

1500

1510

1520

1530

1535

1540

1550

A-40

W=WGHT

SUMW=SUMW+W

SUMF=SUNF+W*BDR(M,N)

NEXT N

NEXT M

INTERP=0.

IF SUMW^ =0. THEN RETURN

INTERP=SLJMF/SUMW

RETURN

REN CALCULATE BDR VALUES AT REGULAR ARRAY POINTS

FOR J=l TO NNAD

FOR h'=l TO NAZM

ZPRM=NAN<J>

APRM=AZ I N ( K )

REM FIND JMIN JMAX , KMIN ,KMAX TO LIMIT

SIND=SIN<ZPRM)*SIN(PI-APRM)

CQSD=SOR(1-SIND*SIND)*SGN(COS(APRM) )

COSA=COS<2PRM)/COSD

IF CGSA-=1.O THEN COSA=1.0

IF COSA<=-1.0 THEN COSA=-1.0

A= FN ACOS(COSA)

D=ATN<SIND/COSD*SGN<COS<APRM> ) ) +POVR2

AINC=INT(A/PI*18>+7

DINC=INT(D/PI*1B>-1

JMIN=AINC-1

JMAX=AINC+1

t MIN=DINC-1

kMAX=DINC+l

IF JMIN;=1 THEN 1230

JMTN=JMIN+1

GOTO 1190

IF JMAX<=13 THEN 1260

JMAX=JMAX-1

GOTO 1230

IF KMIN-=1 THEN 1290

KMIN=H'MIN+1

GOTO 1260

IF KMAX-:=15 THEN 1320

KMAX=KMAX-1

GOTO 1290

GOSUB 700

BDN(J,K)=INTERP

PRINT BDN<J,K) , JMIN, JMAX, KMIN,KMAX

NEXT K

NEXT J

OPEN#4 AS OUTPUT, "/AREA1 /CFOS. PLOT/ "+D*

MIN=99999

MAX=0

FOR J=l TO NNAD

FOR K=l TO NAZM

IF BDN(J,KXMIN THEN MIN=BDN<J,K)

IF BDN(J,K> >MAX THEN MAX=BDN(J,K)

NEXT K

NEXT J

PRINT"MIN AND MAX OF INTERPOLATED FIELD ",MIN,MAX

WRITEtt4, 1 -, NNAD , NAZM, FLUXUP ,M IN, MAX

1=1

FOR J=l TO NNAD

FOR f =1 TO NAZM

1=1+1

WRITE#4,I; NAN<J> ,AZIN(K) ,BDN(J,K)

PRINT NAN(J) ,AZIN(K) ,BDN(J,K)

NEXT h

NEXT J

REGION OF INTERPOLATION
V15^0f END

A-41

10 REM CFOS BI-DIRECTIONAL REFLECTANCE STANDARD ERROR PROGRAM

20 DIM N(30,12,12),NAN(12),A2IM(12)

30 DIM NBAR(12,12),NSTD(12,12),SSN(12,12),SNS<12,12)

40 DIM D-£<30>

100 PRINT"INPUT THE NUMBER OF INTERPOLATED DATA FILES TO USE"

110 INPUT NUM

130 FOR 1=1 TO NUM

140 PRINT"INPUT THE DATASET NAME FOR FILE NUMBER",!

150 INPUT-D-Sd)

155 D* d)="/AREA1/CFOS.PLOT/"+D$ <I)

16O NEXT I

200 FOR 1=1 TO NUM

210 OPEN82 AS INPUT,D$d)

220 hQUNT=l

23O FOR 0=1 TO 12

240 FOR H=l TO 12

250 KOUNT=KOUNT+1

255 READ#2,1;NNAD,NAZM,FLUXUP,MIN,MAX

260 READ#2,KOUNT;NAN<0) ,AZIM(K) ,Nd ,J,K)

270 NEXT K

280 NEXT J

290 CLQSE#2

300 NEXT I

310 FOR 0 = 1 TO 12

320 FOR h'=l TO 12

330 SSN(J,K)=0

340 SNS(J,K)=0

350 NBAR<0,K)=0

360 NSTD(0,K)=0

370 NEXT K

3SO NEXT J

400 FOR 0=1 TO 12

410 FOR K=l TO 12

420 FOR 1=1 TO NUM

430 SSN(0,K)=SSN<0,K)+Nd ,0 , K) *N (I ,0 ,K)

440 SNS(0,K)=SNS(J,K> +N (I ,0 , K)

450 NBAR(0,K)=NBAR<J,K)+Nd,0,K) /NUM

460 NEXT I

470 SNS < 0,K)=SNS <0,K)*SNS(0,K)

480 NSTD(0,K)=SQR((SSN(J,K)-SNS(0,K)/NUM)/<NUM-1))

490 N3TD<J,K)=NSTD(J,K)/NBAR(0,K)

500 PRINT J,K,NSTD(J,K)*100

510 NEXT K

520 NEXT 0

530 AVGERR=0

540 FOR 0=1 TO 12

550 FOR ^ =1 TO 12

56O AVGERR=AVGERR+NSTD(J,K)*1OO/144

570 NEXT K

580 NEXT 0

590 PRI NT"OVERALL STANDARD ERROR FOR BDR",AVGERR

600 END