Exemplo n.º 1
0
def mapSFR(galaxy, mom0cut, regridDir, outDir):
    '''
    import sfr map from W4+FUV

     Date        Programmer      Description of Changes
    ----------------------------------------------------------------------
    10/29/2020  Yiqing Song     Original Code
    12/3/2020  A.A. Kepley     Added comments and clarified inputs
    '''

    sfrhdu = fits.open(
        os.path.join(regridDir,
                     galaxy['NAME'] + '_sfr_fuvw4_gauss15_regrid.fits'))[0]
    sfr = sfrhdu.data
    sfr[np.isnan(mom0cut)] = np.nan
    w = WCS(sfrhdu.header)

    ## TODO CHECK UNITS HERE
    sfrhdu.header[
        'BUNIT'] = 'MSUN/YR/KPC^2'  #might change when getting new files from Sarah
    sfrmap = Projection(sfr, header=sfrhdu.header, wcs=w)
    sfrmap.quicklook()

    # save plot of map
    plt.savefig(os.path.join(outDir, galaxy['NAME'] + '_sfr.png'))
    plt.clf()
    plt.close()

    return sfrmap
Exemplo n.º 2
0
def mapLTIR(galaxy, mom0cut, regridDir, outDir):
    '''
    make LTIR map

    
    galaxy: line from degas_base.fits table with galaxy information

    mom0cut: S/N cut on mom0

    regridDir: input data directory with all regridded data

    outDir: output data directory

     Date        Programmer      Description of Changes
    ----------------------------------------------------------------------
    12/10/2020  A.A. Kepley      Original code based on mapStellar

    '''

    hdu = fits.open(
        os.path.join(regridDir,
                     galaxy['NAME'] + '_LTIR_gauss15_regrid.fits'))[0]

    data = hdu.data

    data[np.isnan(mom0cut)] = np.nan  #apply SN mask (SN >3)

    LTIRmap = Projection(data, header=hdu.header, wcs=WCS(hdu.header))
    LTIRmap.quicklook()

    plt.savefig(os.path.join(outDir, galaxy['NAME'] + '_LTIR.png'))
    plt.clf()
    plt.close()

    return LTIRmap
Exemplo n.º 3
0
def mapStellar(galaxy,mom0cut,plotdir='./',stellardatadir='./'):
    stellarhdu=fits.open(stellardatadir+galaxy+'_w1_stellarmass_regrid.fits')[0]
    starmask=fits.getdata(stellardatadir+galaxy+'_w1_gauss15_stars_regrid.fits')
    stellar=stellarhdu.data
    stellar[starmask==1.0]=np.nan
    stellar[np.isnan(mom0cut)]=np.nan
    w=WCS(stellarhdu.header)
    stellarhdu.header['BUNIT']='Msun/pc^2' #not the correct unit!!
    stellarmap=Projection(stellar,header=stellarhdu.header,wcs=w) 
    stellarmap.quicklook()
    plt.savefig(plotdir+galaxy+'_stellarmass.png')
    plt.clf()
    plt.close()
    return stellarmap
Exemplo n.º 4
0
def mapSFR(galaxy,mom0cut,plotdir='./',sfrdatadir='./'):
    sfrhdu=fits.open(sfrdatadir+galaxy+'_w4fuv_sfr_regrid.fits')[0]
    starmask_fuv=fits.getdata(sfrdatadir+galaxy+'_fuv_gauss15_stars_regrid.fits')
    starmask_nuv=fits.getdata(sfrdatadir+galaxy+'_nuv_gauss15_stars_regrid.fits')
    sfr=sfrhdu.data
    sfr[starmask_fuv==1.0]=np.nan #mask out stars from fuv and nuv
    sfr[starmask_nuv==1.0]=np.nan
    sfr[np.isnan(mom0cut)]=np.nan
    w=WCS(sfrhdu.header)
    sfrhdu.header['BUNIT']='MSUN/YR/KPC^2'  
    sfrmap=Projection(sfr,header=sfrhdu.header,wcs=w) 
    sfrmap.quicklook()
    plt.savefig(plotdir+galaxy+'_sfr.png')
    plt.clf()
    plt.close()
    return sfrmap
Exemplo n.º 5
0
def mapStellar(galaxy, mom0cut, regridDir, outDir):
    '''
    make stellarmass map

    
    galaxy: line from degas_base.fits table with galaxy information

    mom0cut: S/N cut on mom0

    regridDir: input data directory with all regridded data

    outDir: output data directory

     Date        Programmer      Description of Changes
    ----------------------------------------------------------------------
    10/29/2020  Yiqing Song     Original Code
    12/3/2020   A.A. Kepley     Added comments and clarified inputs

    '''

    # open the stellar mass

    ## TODO : NEED TO UPDATE WITH NEW ANCILLAR DATA FROM SARAH
    stellarhdu = fits.open(
        os.path.join(regridDir,
                     galaxy['NAME'] + '_mstar_gauss15_regrid.fits'))[0]

    stellar = stellarhdu.data
    #stellar[starmask==1.0]=np.nan #apply star mask ## AAK: I think I can skip this.
    stellar[np.isnan(mom0cut)] = np.nan  #apply SN mask (SN >3)
    w = WCS(stellarhdu.header)
    # stellarhdu.header['BUNIT']='Msun/pc^2' #not the correct unit!!  ## AAK: I think units are okay for the newdata

    stellarmap = Projection(stellar, header=stellarhdu.header, wcs=w)
    stellarmap.quicklook()

    plt.savefig(os.path.join(outDir, galaxy['NAME'] + '_stellarmass.png'))
    plt.clf()
    plt.close()

    return stellarmap