add_with_kernel=True, kernel_fwhm=20./3600., nhits=cubename+'_nhits.fits', velocityrange=velocityrange, excludefitrange=[vmin,vmax], linefreq=linefreq, progressbar=True, chmod=True) # security risk, but too many files! else: raise IOError("Did not find file {0}".format(fn)) flat_vrange = [20,100] if os.path.exists(cubename+".fits"): makecube.runscript(cubename) makecube.make_flats(cubename,vrange=flat_vrange,noisevrange=[-50,-1]) #makecube.make_flats(cubename,vrange=flat_vrange,noisevrange=[-50,-1],suffix='.fits') else: print "Failure at ",line # 6/18/2014: add "superresolution" maps of HELIUM helium_freq = {112: 4.62067, 111: 4.74612, 110: 4.87614, 109: 5.01096, 108: 5.1508, 107: 5.29589, 106: 5.44648,}
"W51_h213coW_spectra_0910.fits", "W51_h213coW_spectra_0911.fits", "W51_h213coW_spectra_0912.fits", "W51_h213coW_spectra_0915.fits", ] for fn in files: fullfn = fix_TDIM_in_header(prefix + fn) makecube.add_file_to_cube( fullfn, cubename_supersampled + ".fits", add_with_kernel=True, kernel_fwhm=20.0 / 3600.0, nhits=cubename_supersampled + "_nhits.fits", diagnostic_plot_name=fullfn.replace(".fits", "_data_scrubbed.png"), velocityrange=velocityrange, excludefitrange=[vmin, vmax], linefreq=linefreq, ) flat_vrange = [45, 75] makecube.runscript(cubename_supersampled) makecube.make_flats(cubename_supersampled, vrange=flat_vrange, noisevrange=[-50, -1]) makecube.make_taucube( cubename_supersampled, continuum=cubename_supersampled + "_continuum.fits", linefreq=linefreq ) # etamb accounted for already , etamb=0.51) makecube.make_flats( cubename_supersampled.replace("cube", "taucube"), vrange=flat_vrange, noisevrange=[-50, -1], suffix=".fits" )
#cd3 = 1.0 # Arecibo is limited to 0.64 because one of the receivers went bad at hi-res mode once #naxis3 = int(np.ceil((velocityrange[1]-velocityrange[0])/cd3))+4 # +4 is BAD! don't do that. naxis3 = int((velocityrange[1]-velocityrange[0]) / cd3) + 1 # +1 is good: include -50 crval3 = 50.0 # dumb debug stuff vels = crval3+cd3*(np.arange(naxis3)+1-naxis3/2-1) # this will probably cause an error but I must insist.. #if velocityrange[0]<=vels.min() or velocityrange[1]>=vels.max(): # raise ValueError("Add more points. Something's going to be out of range for stupid star stupid link") makecube.generate_header(49.209553, -0.277137, naxis1=192, naxis2=128, pixsize=24, naxis3=naxis3, cd3=cd3, crval3=crval3, clobber=True, restfreq=14.488479e9) makecube.make_blank_images(cubename_lores,clobber=True) for fn in [filename]: print "Adding file %s" % fn fullfn = fn makecube.add_file_to_cube(fullfn, cubename_lores+".fits", add_with_kernel=True, kernel_fwhm=50./3600., nhits=cubename_lores+"_nhits.fits", diagnostic_plot_name=fullfn.replace('.fits','_data_scrubbed.png'), velocityrange=velocityrange,excludefitrange=[40,75],noisecut=1.0) # more aggressive noisecut makecube.runscript(cubename_lores) makecube.make_flats(cubename_lores,vrange=[45,75],noisevrange=[-15,30]) makecube.make_taucube(cubename_lores,cubename_lores+"_continuum.fits",etamb=0.886)
naxis1=192, naxis2=128, pixsize=24, naxis3=naxis3, cd3=cd3, crval3=crval3, clobber=True, restfreq=14.488479e9) makecube.make_blank_images(cubename_lores, clobber=True) for fn in [filename]: print "Adding file %s" % fn fullfn = fn makecube.add_file_to_cube(fullfn, cubename_lores + ".fits", add_with_kernel=True, kernel_fwhm=50. / 3600., nhits=cubename_lores + "_nhits.fits", diagnostic_plot_name=fullfn.replace( '.fits', '_data_scrubbed.png'), velocityrange=velocityrange, excludefitrange=[40, 75], noisecut=1.0) # more aggressive noisecut makecube.runscript(cubename_lores) makecube.make_flats(cubename_lores, vrange=[45, 75], noisevrange=[-15, 30]) makecube.make_taucube(cubename_lores, cubename_lores + "_continuum.fits", etamb=0.886)