def get_AV_infinity(ra,dec,frame='<STR_LIT>'):
coords = SkyCoord(ra,dec,unit='<STR_LIT>',frame=frame).transform_to('<STR_LIT>')<EOL>rah,ram,ras = coords.ra.hms<EOL>decd,decm,decs = coords.dec.dms<EOL>if decd > <NUM_LIT:0>:<EOL><INDENT>decsign = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>decsign = '<STR_LIT>'<EOL><DEDENT>url = '<STR_LIT>'+'<STR_LIT>' % rah +'<STR_LIT>'+'<STR_LIT>' % ram + '<STR_LIT>' + '<STR_LIT>' % ras + '<STR_LIT>' % decsign + '<STR_LIT>' % abs(decd) + '<STR_LIT>' + '<STR_LIT>' % abs(decm) + '<STR_LIT>' + '<STR_LIT>' % abs(decs) +'<STR_LIT>'<EOL>AV = None<EOL>for line in urllib.request.urlopen(url).readlines():<EOL><INDENT>m = re.search(b'<STR_LIT>', line)<EOL>if m:<EOL><INDENT>AV = (float(m.group(<NUM_LIT:1>)))<EOL>break<EOL><DEDENT><DEDENT>if AV is None:<EOL><INDENT>raise RuntimeError('<STR_LIT>'.format(url))<EOL><DEDENT>return AV<EOL>
Gets the A_V exctinction at infinity for a given line of sight.

Queries the NED database.

:param ra,dec:
    Desired coordinates, in degrees.
:param frame: (optional)
    Frame of input coordinates (e.g., ``'icrs', 'galactic'``)