mhardcastle / radioflux

Measuring radio flux density with ds9
GNU General Public License v3.0
12 stars 3 forks source link

printing more digits #5

Closed rvweeren closed 8 years ago

rvweeren commented 8 years ago

Another very minor issue I is that radioflux has trouble with very small fluxes, when printing the results.

(I guess it does not expect these very low values from high-freq JVLA data)

Cband_spix_taper1.2arcsec.image.tt0.conv.pbcor.fits 22 5.497e+09 0.000102 0.000009 Cband_spix_taper1.2arcsec.image.tt0.conv.pbcor.fits 23 5.497e+09 0.000024 0.000009 Cband_spix_taper1.2arcsec.image.tt0.conv.pbcor.fits 24 5.497e+09 0.000058 0.000020 Cband_spix_taper1.2arcsec.image.tt0.conv.pbcor.fits 25 5.497e+09 0.000054 0.000020 Cband_spix_taper1.2arcsec.image.tt0.conv.pbcor.fits 26 5.497e+09 0.000030 0.000020 Cband_spix_taper1.2arcsec.image.tt0.conv.pbcor.fits 27 5.497e+09 0.000020 0.000020 Cband_spix_taper1.2arcsec.image.tt0.conv.pbcor.fits 28 5.497e+09 0.000027 0.000020

I fixed this by replacing 10.6f with 10.6g:

for i in range(rm.nchans):
    freq=rm.frq[i]
    if noise:
        print filename,label,'%8.4g %10.6g %10.6g' % (freq,fg.flux[i],fg.error[i])
    else:
        print filename,label,'%8.4g %10.6g' % (freq,fg.flux[i])
mhardcastle commented 8 years ago

Seems sensible. Of course it could be clever and work out the precision required from the noise level, where present. For the moment, I've adopted %g as you suggest.