Date, Time, and Angle Functions CalcHJD

CalcAirmass


The CalcAirmass function calculates the airmass, or relative optical path length through the Earth's atmosphere, for an observation. The calculation is based on the object coordinates, observing site coordinates, and the UT date and time of the observation.

Syntax

nAirmass = CalcAirmass( sRa, sDec, sLong, sLat, sDate, sTime )

bullet.gif    sRa, sDec are strings giving the right ascension and declination coordinates of the observation.

bullet.gif    sLong, sLat are strings giving the longitude and latitude of the observing site. Longitude is measured positive west from the Greenwich meridian.

bullet.gif    sDate, sTime are strings giving the date and UT time of the observation.

bullet.gif    nAirmass is the calculated airmass.

Remarks

Airmass is returned as 0.0 when the object is below the horizon.

All 6 input parameters are string values. The right ascension, sRa, is specified in HMS format. sDec, sLong, and sLat are angles specified in DMS format. Date and Time are specified as YMD and HMS format strings. The string format can use a variety of delimiters, including spaces, commas, colons, and other relevant characters.

Be sure that the time of the observation includes the time reference (i.e., beginning, middle, or end of the observation). For example, if the UT is "05:15:34" at the start of a 60 second exposure and you want the airmass to be effective at the middle of the exposure, then specify the time string as being 30 seconds later, or "05:16:04".

Example

The following script computes the airmass:

sRa = "23 20 26"

-- HMS string

sDec = "09 43 17"

-- DMS string

sLong = "88 33 24"

-- DMS string

sLat = "42 34 12"

-- DMS string

sDate = "2005 09 28"

 

sTime = "05 15 34"

 

dA = CalcAirmass( sRa, sDec, sLong, sLat, sDate, sTime )

-- compute the airmass

Printf("Airmass = %lf", dA )

-- Result: Airmass = 1.197916

Related Topics

CalcLST

CalcSphAngle

CApphot class

 


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.