Changeset 71


Ignore:
Timestamp:
Sep 25, 2014 12:53:16 PM (10 years ago)
Author:
JohnLightfoot
Message:

parallelize and fix normalisation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dirtyimage.py

    r68 r71  
    1919
    2020        # must be a better way of doing this
    21         argx = b_x * (wn * 100.0) * spatial_axis / 206265.0
    22         argy = b_y * (wn * 100.0) * spatial_axis / 206265.0
    23         valx = numpy.exp(2j * math.pi * argx)
    24         valy = numpy.exp(2j * math.pi * argy)
     21        argx = numpy.radians(b_x * (wn * 100.0) * spatial_axis / 3600.0)
     22        argy = numpy.radians(b_y * (wn * 100.0) * spatial_axis / 3600.0)
     23        valx = numpy.exp(2.0j * math.pi * argx)
     24        valy = numpy.exp(2.0j * math.pi * argy)
    2525
    2626        vis = spectrum[wn_spectrum==wn]
     
    3636   
    3737    # normalise
    38     image /= numpy.sum(beam)
    39     beam /= numpy.sum(beam)
     38    # The sum of the dirty beam should equal the 0 baseline vis measurement: 0
     39    # Normalising the volume would preserve flux under convolution but
     40    # is problematic as the volume is 0, so normalise the peak to 1.
     41    beam /= 2.0 * len(b_x_list)
     42
     43    # likewise for dirty map
     44    image /= 2.0 * len(b_x_list)
    4045
    4146    return image, beam
     
    8893        for iwn,wn in enumerate(wavenumber):
    8994            # submit jobs
    90             print 'starting dirty for', wn
    9195            indata = (b_x_list, b_y_list, spectra, wn_spectra, iwn, wn,
    9296              spatial_axis, npix,)
Note: See TracChangeset for help on using the changeset viewer.