Jim, Glad you found it useful. Here's some of my VBA coding implementing the same. The function PhotogExposureTimeFilmObj is strickly experimental. The real unknown in the calculator is "what is the equivalent ASA speed of my CCD chip?" That can vary by how you adjust the gain setting. For example, the Meade DSI Envisage software always pegs the gain at maximum when you do an autoexposure. I have no idea how that changes the equivalent ASA. The best suggestion that I have (and I never got around to this myself) is to test the exposure time with your camera at various gain settings and then reverse interpolate the equivalent ASA speed of the chip. For example, Comet Holmes at mag 6 exposed in about 8-10 secs in an f5.6 setup with the gain pegged at maximum. That would imply an equivalent ASA speed of around 3200, not 1100. Daniel wrote:
It's easier than being dragged through the mud with old english exposure units.
Ditto. That's my advice. Although it will be sometime before I ever get back to this, IMHO a new exposure alogrithm, based on the professional spectrographer's exposure estimate methods from the international unit of spectral radiance, is what is needed. That exposure algorithm is based on converting radiance in the actual number of photons hitting a CCD chip cell and where one photon equals one dislodged electron on the chip. But I've never seen an article that really explains the process. Maybe its been written in a publication like _Astrophoto Insight_ or in some of the newer Patrick Moore book series on digital imaging and I've just missed it. Trying to build some kind of a bridge between older wet film exposure estimate methods (like Covington does) and digital chips just didn't cut if for me. Based on what I learned earlier this year, I should be able to crank out a revised version of Clark's catalogue of 620 DSOs with surface brightness expressed in radiance units. Clear Skies, Kurt Public Function PhotogMPAS2B_candelasqft(ByVal B_mpsas_tmp As Double) As Double ' Accepts astronomical brightnesses in units of magnitudes per square arcsec ' Returns object brightness in photographic system of candelas per square foot ' B = 2.512 ^ (9.0-m") ' B_mpsas is also denoted as "Ba". It should be distinguished from "B" ' which is the photograph system brightness in candelas per square foot. ' Source: Covington, M. (1998, 2d). Astrophotography for Amateurs. ' Appendix A, at 259-261 ' Tested against Covington Appendix A Tables given m" and B values ' for various planets. ' Moon (thin crescent) m" = 6.7 B = 8.0 ' ?PhotogMPAS2B_candelasqft(6.7) ' 8.31850267586248 ' Moon (full) m" = 3.4 B = 180 ' ? PhotogMPAS2B_candelasqft(3.4) ' 173.824086762048 ' Mars m" = 4.0 B = 100 ' ? PhotogMPAS2B_candelasqft(4#) ' 100.022608259449 ' Nebulae, faint (California) m" = 21.0 B = 0.000016 (underexpose) ' ? PhotogMPAS2B_candelasqft(21#) ' 1.58403356263317E-05 ' Galaxies, bright cores m" = 18.0 B = 0.00025 ' ? PhotogMPAS2B_candelasqft(18#) ' 2.51086454611934E-04 ' Define variables Dim B_mpsas As Double ' Get input B_mpsas = B_mpsas_tmp PhotogMPAS2B_candelasqft = CDbl(2.512 ^ (9# - B_mpsas)) End Function Public Function PhotogB_candelasqft2MPAS(ByVal B_tmp As Double) As Double ' Accepts astronomical brightnesses in units of photographic system of ' candelas per square foot. Returns object brightness in astronomical ' brightness units of magnitudes per square arcsec. ' B_mpsas is also denoted as "Ba". It should be distinguished from "B" ' which is the photograph system brightness in candelas per square foot. ' Source: Covington, M. (1998, 2d). Astrophotography for Amateurs. ' Appendix A, at 259-261 ' Usage and test ' Moon (thin crescent) m" = 6.7 B = 8.0 ' ?PhotogMPAS2B_candelasqft(6.7) ' 8.31850267586248 ' Mars m" = 4.0 B = 100 ' ? PhotogB_candelasqft2MPAS(100) ' 3.99878517801693 ' Nebulae, faint (California) m" = 21.0 B = 0.000016 (underexpose) ' ? PhotogB_candelasqft2MPAS(0.000016) ' 20.9926131135968 ' Galaxies, bright cores m" = 18.0 B = 0.00025 ' ? PhotogB_candelasqft2MPAS(0.000025) ' 20.5079453201423 ' Define variables Dim B As Double ' Get input B = B_tmp PhotogB_candelasqft2MPAS = CDbl(9# - (1.086 * Log(B))) End Function Public Function PhotogExposureTimeFilmObj(ByVal objVMag_tmp, ByVal objType_tmp As String, ByVal objMajorAxis_arcmin_tmp, ByVal objMinorAxis_arcmin_tmp, ByVal Bsky_mpsas_tmp As Double, _ ByVal dblEFR_tmp As Double, ByVal dblFilterFactor_tmp, ByVal ISOSpeed_tmp As Double, ByVal Recipority_Factor_tmp As Double) As String ' Astrophotography film exposure time for extended and stellar objects ' APPEARS TO IMPLEMENTED PROPERLY, BUT ONLY ROUGHLY AGREES WITH COVINGTON TABLES. ' COVINGTON'S TABLES ARE EXPERIENCE ADJUSTED. NEEDS TESTING AGAINST ONLINE CALCULATORS. ' Valid object types are " Extended | Stellar | Stellar-CI " ' Where object type is stellar, objMajorAxis_arcmin_tmp and objMinorAxis_arcmin_tmp are ignored. ' Departs from Covington extended object model for stellar sources. For a stellar source, the V-mag is the MPSAS without adjustment for area. ' Receives object brightness and size information, sky info, effective focal ratio of telescope, and film recipority error ' Returns a initial suggested exposure time in seconds and ' an estimated sky fog time in seconds ' Source: Covington, M. Astrophotography for Amateurs, Appendix A ' Inputs ' Object magnitude objVMag_tmp ' Major axis size arcmin objMajorAxis_arcmin_tmp ' Minor axis size arcmin objMinorAxis_arcmin_tmp ' Sky brightness in MPSAS Bsky_mpsas_tmp ' Effective focal ratio dblEFR_tmp ' Film speed ' Film's recipority factor - or Schwarzschild exponent ' Recipority factor for typical films are ' 1.0 Digital CCD ' 0.95 Slide film ' 0.9 Newer slow films ' 0.8 older slow films ' 0.8 newer fast films ' 0.7 older fast films ' Test and usage ' Define variables Dim objVMag, objMajorAxis_arcmin, objMinorAxis_arcmin, Bsky_mpsas As Double Dim dblEFR, dblFilterFactor, ISOSpeed, Recipority_Factor As Double Dim A, B, C, D, E As Double ' Working variables Dim strOut As String Dim M, n, P, Q, R, S As String ' Working variables Dim Bobj_mpsas As Double ' Object brightness in MPSAS Dim Bobj_candelaspsqft As Double ' Object brightness in candelas/sqft Dim Bobj_candelas_adjusted As Double ' Object brightness in candelas/sqft ' adjusted for the filter factor Dim Bsky_candelaspsqft ' Sky brightness in candelas/sqft Dim Bsky_candelas_adjusted ' Sky brightness in candelas/sqft Dim Bsky_candelaspsqft_adjusted As Double ' Sky brightness in candelas/sqft ' adjusted for the filter factor Dim objType As String ' Object type - Extended or Stellar ' Get input objVMag = objVMag_tmp objType = Trim(objType_tmp) objMajorAxis_arcmin = objMajorAxis_arcmin_tmp objMinorAxis_arcmin = objMinorAxis_arcmin_tmp Bsky_mpsas = Bsky_mpsas_tmp dblEFR = dblEFR_tmp dblFilterFactor = dblFilterFactor_tmp ISOSpeed = ISOSpeed_tmp Recipority_Factor = Recipority_Factor_tmp ' Find the object exposure time ' 1) Find the object B_candelaspsqft from the object V magnitude and size ' A) Convert objective size and v-mag to B_mpsas ' Departs from Covington extended object model for stellar sources. ' For a stellar source, the V-mag is the MPSAS without adjustment for area. Bobj_mpsas = CDbl(GetCSWord(PhotogObjectArea2MPAS(objVMag, objType, objMajorAxis_arcmin, objMinorAxis_arcmin, Bsky_mpsas), 1)) ' Debug.Print "Bobj_mpsas", Bobj_mpsas ' B) Convert object B_mpsas to candelas per sq/ft Bobj_candelaspsqft = PhotogMPAS2B_candelasqft(Bobj_mpsas) ' Debug.Print "Bobj_candelaspsqft", Bobj_candelaspsqft ' 2) Adjust B_candelaspsqft for the filter factor Bobj_candelas_adjusted = Bobj_candelaspsqft / dblFilterFactor ' 3) Compute the initial exposure time A = (dblEFR ^ 2) / (ISOSpeed * Bobj_candelas_adjusted) ' Debug.Print "Unadjusted object exposure time", A, A / 60#, A / 3600# ' Stop ' 4) Adjust for the initial exposure time for the reciprocity failure B = ((A + 1#) ^ (1# / Recipority_Factor)) - 1# ' Debug.Print "Recipority adjusted exposure time", B, B / 60#, B / 3600# ' Find the sky background brightness ' 1) Find the sky brightness B_candelaspsqft from the sky Ba_mpsas ' B) Convert object B_mpsas to candelas per sq/ft ' Debug.Print "Bsky_mpsas", Bsky_mpsas Bsky_candelaspsqft = PhotogMPAS2B_candelasqft(Bsky_mpsas) ' Debug.Print "Bsky_candelaspsqft ", Bsky_candelaspsqft ' 2) Adjust B_candelaspsqft for the filter factor Bsky_candelas_adjusted = Bsky_candelaspsqft / dblFilterFactor ' 3) Compute the initial exposure time C = (dblEFR ^ 2) / (ISOSpeed * Bsky_candelas_adjusted) ' Debug.Print "Unadjusted sky exposure time", C, C / 60#, C / 3600# ' 4) Adjust for the initial exposure time for the reciprocity failure D = ((C + 1#) ^ (1 / Recipority_Factor)) - 1# ' Debug.Print "Recipority sky adjusted exposure time", D, D / 60#, D / 3600# 'Build the output ' Add the film exposure time to the output string strOut = Trim(CStr(Format(B, "0.0000"))) & " " & Trim(CStr(Format(B / 60#, "0.00000"))) & " " & Trim(CStr(Format(B / 3600#, "0.000000"))) & " " ' Add the sky fog time to the output string strOut = strOut & Trim(CStr(Format(D, "0.0000"))) & " " & Trim(CStr(Format(D / 60#, "0.00000"))) & " " & Trim(CStr(Format(D / 3600#, "0.000000"))) ' Return the result PhotogExposureTimeFilmObj = strOut End Function Public Function PhotogObjectArea2MPAS(ByVal objMagnitude_tmp, ByVal objType_tmp As String, ByVal objMajorAxis_arcmin_tmp, ByVal objMinorAxis_arcmin_tmp, ByVal B_mpas_tmp As Double) As String ' Accepts Magnitude and dimensions and background B_mpas. ' Returns object brightness in MPAS and contrast index. ' Valid object types are " Extended | Stellar | Stellar-CI " ' Where object type is stellar, objMajorAxis_arcmin_tmp and objMinorAxis_arcmin_tmp are ignored. ' Source: Covington, M. Astrophotography for Amateurs, Appendix A ' Clark's Visual Astronomy of the Night Sky, Appendix E ' http://clarkvision.com/visastro/appendix-e.html ' Departs from Covington extended object model for stellar sources. ' For a stellar source, the V-mag is the MPSAS without adjustment for area. ' Tests and usage ' Test against objects in Clark's Appendix E catalogue ' Clark assumes dark sky background of 24.25 MPAS ' NGC7814 ' ? PhotogObjectArea2MPAS(12, 1, 5, 24.25) ' 22.3759059661737 0.749637613530523 ' Checks against Clark's results ' NGC40 ' ? PhotogObjectArea2MPAS(10.5, 1, 0.7, 24.25) ' 18.7412260553693 2.20350957785228 ' Checks against Clark's results ' NGC45 ' ? PhotogObjectArea2MPAS(7.8, 25, 40, 24.25) ' 23.9284809553336 0.128607617866541 ' Checks against Clark's results ' Define variables Dim objMagnitude, objMajorAxis_arcmin, objMinorAxis_arcmin, B_mpas As Double Dim objMajorAxis_arcsec, objMinorAxis_arcsec Dim objB_mpas, ContrastIndex As Double Dim strOut As String Dim objType As String ' Object type - Extended or Stellar Dim ContrastIndexStrOut ' Temporary working variable for output Dim strSpacer ' Temporary working variable for output ' Get input objMagnitude = objMagnitude_tmp objType = Trim(objType_tmp) objMajorAxis_arcmin = objMajorAxis_arcmin_tmp objMinorAxis_arcmin = objMinorAxis_arcmin_tmp B_mpas = B_mpas_tmp ' Convert object dimensions to arcsecs objMajorAxis_arcsec = 60# * objMajorAxis_arcmin objMinorAxis_arcsec = 60# * objMinorAxis_arcmin ' A) Convert objective size and v-mag to B_mpsas ' Departs from Covington extended object model for stellar sources. ' For a stellar source, the V-mag is the MPSAS without adjustment for area. Select Case objType Case "Extended" ' Compute results objB_mpas = objMagnitude + (2.5 * (Log10((PI() / 4) * objMajorAxis_arcsec * objMinorAxis_arcsec))) ' Contrast index formula is from http://clarkvision.com/visastro/appendix-e.html ContrastIndex = -0.4 * (objB_mpas - B_mpas) ContrastIndexStrOut = CStr(ContrastIndex) strSpacer = " " Case "Stellar" objB_mpas = objMagnitude ContrastIndex = -0.4 * (objB_mpas - B_mpas) ContrastIndexStrOut = CStr(ContrastIndex) strSpacer = " " Case "Stellar-CI" objB_mpas = objMagnitude ContrastIndex = -0.4 * (objB_mpas - B_mpas) ContrastIndexStrOut = CStr(ContrastIndex) strSpacer = " " Case "Not applicable" ' Should not be submitted to function, gracefully return zero objB_mpas = "" ContrastIndexStrOut = "" strSpacer = "" Case "Incomplete" ' Should not be submitted to function, gracefully return zero objB_mpas = "" ContrastIndexStrOut = "" strSpacer = "" Case Else ' Handle general error with graceful return of zero objB_mpas = "" ContrastIndexStrOut = "" strSpacer = "" End Select PhotogObjectArea2MPAS = Trim(CStr(objB_mpas)) & strSpacer & Trim(ContrastIndexStrOut) End Function Function GetCSWord(ByVal S, ByVal Indx As Integer) 'Returns the nth word in a specific field separated by spaces. ' Source: Dev Ashish's Access Web 2003 ' http://www.mvps.org/access/strings/str0003.htm Dim WC As Integer, Count As Integer Dim SPos As Integer, EPos As Integer WC = CountCSWords(S) If Indx < 1 Or Indx > WC Then GetCSWord = Null Exit Function End If Count = 1 SPos = 1 For Count = 2 To Indx SPos = InStr(SPos, S, " ") + 1 Next Count EPos = InStr(SPos, S, " ") - 1 If EPos <= 0 Then EPos = Len(S) GetCSWord = Trim(Mid(S, SPos, EPos - SPos + 1)) End Function Function CountCSWords(ByVal S) As Integer 'Counts the words in a string that are separated by spaces. ' Source: Dev Ashish's Access Web 2003 ' http://www.mvps.org/access/strings/str0003.htm Dim WC As Integer, Pos As Integer If VarType(S) <> 8 Or Len(S) = 0 Then CountCSWords = 0 Exit Function End If WC = 1 Pos = InStr(S, " ") Do While Pos > 0 WC = WC + 1 Pos = InStr(Pos + 1, S, " ") Loop CountCSWords = WC End Function Function PI() As Double ' Generic dervied math functions from numerous published sources ' and Microsoft 1997 Neatcode library PI = Atn(1) * 4 End Function Static Function Log10(ByVal x) ' From Visual Basic Help If x >= 0 Then Log10 = Log(x) / Log(10#) End If If x < 0 Then Log10 = -1# * (Log(Abs(x)) / Log(10#)) End If End Function
participants (1)
-
Canopus56