Hi, I&#39;m working on a routine for reading in the Schlegel dustmaps.  I have an ascii table with values, Ra-Dec and I&#39;m trying to convert 2 columns to l,b and get the dust values out, this is a 2 part problem as I need to first convert to l,b, keep those values for other uses (calculating VLSR), and get extinctions for each l,b value, I have:<br>
<br>import astropysics<br>from astropysics.coords import ICRSCoordinates,GalacticCoordinates<br>import asciitable<br><br>x=&#39;Core_rod_name.list&#39;<br>dat=asciitable.read(x,Reader=asciitable.CommentedHeader, fill_values=[&#39;&#39;,&#39;-999.99&#39;])<br>
Radeg=dat[&#39;ra-drad&#39;]*180./math.pi<br>Decdeg=dat[&#39;dec-drad&#39;]*180./math.pi<br><br>plot(Radeg,Decdeg,&#39;o&#39;)<br>xlabel(&#39;Radeg&#39;)<br>ylabel(&#39;Decdeg&#39;)<br><br>gcoords=ICRSCoordinates(dat[&#39;ra-drad&#39;],dat[&#39;dec-drad&#39;],radians=True).convert(GalacticCoordinates)<br>
l=gcoords.l.degrees<br>b=gcoords.b.degrees<br><br>VLSR=dat[&#39;Vhel_f&#39;] + 9*np.cos(l)*np.cos(b) + 12*np.sin(l)*np.cos(b) + 7*np.sin(b)<br>VGSR=VLSR + 220*np.sin(l)*np.cos(b)<br><br>dustmap=&#39;SFD_dust_4096_ngp.fits&#39;<br>
EB_V=astropysics.obstools.get_SFD_dust(l,b,dustmap,interpolate=True)<br>-------<br>this gives the error &#39;Only length-1 arrays can be converted to Python scalars&#39; ... however, I cannot do:<br><br>for row in dat:<br>
     gcoords=ICRSCoordinates(dat[&#39;ra-drad&#39;],dat[&#39;dec-drad&#39;],radians=True).convert(GalacticCoordinates)<br><br>without the same error.  Any ideas would be apreciated, thanks!<br clear="all"><br>~Elaina<br>-- <br>
PhD Candidate<br>Department of Physics and Astronomy<br>Faculty of Science<br>Macquarie University<br>North Ryde, NSW 2109, Australia<br>