function atomic_weight, n, iso ;+ ; NAME: ; atomic_weight ; PURPOSE: (one line) ; Return the atomic weight ; DESCRIPTION: ; Atomic weights from CRC 63rd edition, pp B-255 ; If only the atomic number is given, then this returns ; the weight assuming natural abundances. ; If both the atomic number and isotope are given, ; then this returns the atomic weight from the ; CRC, if it was tabulated there, otherwise it ; simply returns the inputed ; isotopic number. ; CATEGORY: ; General ; CALLING SEQUENCE: ; w = atomic_weight(n, iso) or w = atomic_weight(n) ; INPUTS: ; n - atomic number (e.g., 1 for H) ; iso - isotope (e.g., 12 for Carbon 12) ; OPTIONAL INPUT PARAMETERS: ; none ; KEYWORD INPUT PARAMETERS: ; none ; KEYWORD OUTPUT PARAMETERS: ; none ; OUTPUTS: ; atomic weight (g/mole, e.g., 12. for atomic_weight(6,12) ) ; COMMON BLOCKS: ; None ; SIDE EFFECTS: ; RESTRICTIONS: ; For n > 18, the only element w/ isotopes is Br. ; PROCEDURE: ; MODIFICATION HISTORY: ; Written 2000 October, by Leslie Young, SwRI ;- ; array of natural atomic weights. Because of IDL limitations, ; make this as the concatination of 2 arrays. atwt = $ ; H He [ 1.008, 4.003, $ ; Li Be B C N O F Ne 6.941, 9.012, 10.81, 12.01, 14.01, 16.00, 19.00, 20.18, $ ; Na Mg Al Si P S Cl Ar 22.99, 24.31, 26.98, 28.09, 30.97, 32.06, 35.45, 39.95, $ ; K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr 39.10, 40.08, 44.96, 47.90, 50.94, 52.00, 54.94, 55.85, 58.93, 58.70, 63.55, 65.38, 69.72, 72.59, 74.92, 78.96, 79.90, 83.80, $ ; Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe 85.47, 87.62, 88.91, 91.22, 92.91, 95.94, 98. , 101.1, 102.9, 106.4, 107.9, 112.4, 114.8, 118.7, 121.8, 127.6, 126.9, 131.3] atwt = [atwt, $ ; Cs Ba La [132.9, 137.3, 138.9, $ ; Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu 140.1, 140.9, 144.2, 145., 150.4, 152.0, 157.3, 158.9, 162.5, 164.9, 167.3, 168.9, 173.0, 175.0, $ ; Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn 178.5, 180.9, 183.9, 186.2, 190.2, 192.2, 195.1, 197.0, 200.6, 204.4, 207.2, 209.0, 209., 210., 222., $ ; Fr Ra Ac 223., 226., 227. , $ ; Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr 232.0, 231., 238.0, 244., 242., 243., 247., 247., 251., 252., 257., 258., 259., 260. ] ] ; User passed just atomic number. if n_params() eq 1 then return, atwt[n-1] ; User passed atomic number and isotope if n_params() ne 2 then return, 0. case n of 1: case iso of ; H 1: return, 1.007825 2: return, 2.0140 3: return, 3.01605 else: return, float(iso) endcase 2: case iso of ; He 3: return, 3.01603 4: return, 4.00260 5: return, 5.0123 6: return, 6.01888 8: return, 8.0375 else: return, float(iso) endcase 3: case iso of ; Li 5: return, 5.0125 6: return, 6.01512 7: return, 7.01600 else: return, float(iso) endcase 4: case iso of ; Be 6: return, 6.0197 7: return, 7.0169 8: return, 8.0053 9: return, 9.01218 10: return, 10.0135 else: return, float(iso) endcase 5: case iso of ; B 8: return, 8.0246 9: return, 9.0133 10: return, 10.0129 11: return, 11.00931 12: return, 12.0143 13: return, 13.0178 else: return, float(iso) endcase 6: case iso of ; C 12: return, 12.0000 ; By definition! 13: return, 13.00335 else: return, float(iso) endcase 7: case iso of ; N 14: return, 14.00307 15: return, 15.00011 else: return, float(iso) endcase 8: case iso of ; O 16: return, 15.99491 else: return, float(iso) endcase 9: case iso of ; F 19: return, 18.99840 else: return, float(iso) endcase 10: case iso of ; Ne 20: return, 19.99244 21: return, 20.99138 22: return, 21.99138 else: return, float(iso) endcase 11: case iso of ; Na 23: return, 22.9898 else: return, float(iso) endcase 12: case iso of ; Mg 24: return, 23.98504 25: return, 24.98584 26: return, 25.98259 else: return, float(iso) endcase 13: case iso of ; Al 27: return, 26.98153 else: return, float(iso) endcase 14: case iso of ; Si 28: return, 27.97693 29: return, 28.97649 30: return, 29.97376 else: return, float(iso) endcase 15: case iso of ; P 31: return, 30.97376 else: return, float(iso) endcase 16: case iso of ; S 32: return, 31.97207 33: return, 32.97146 34: return, 33.96786 36: return, 35.96709 else: return, float(iso) endcase 17: case iso of ; Cl 35: return, 34.96885 37: return, 36.96590 else: return, float(iso) endcase 18: case iso of ; Ar 36: return, 35.96755 38: return, 37.96272 else: return, float(iso) endcase ; Sparce from here on down 35: case iso of ; Br 79: return, 78.9183 81: return, 80.9163 else: return, float(iso) endcase 53: case iso of ; I 127: return, 126.9044 else: return, float(iso) endcase else: return,float(iso) endcase end