コード例 #1
0
# Driver for nsc_instcal_measure_update.py to update OBJECTIDs in exposure measurement catalogs
if __name__ == "__main__":
    parser = ArgumentParser(description='Update objectIDs in exposure measurement catalogs')
    parser.add_argument('version', type=str, nargs=1, help='Version number')
    parser.add_argument('--hosts', type=str, nargs=1, help='Delimited list of hosts')
    parser.add_argument('-l','--list', type=str, nargs=1, default='', help='List of exposures to run')
    parser.add_argument('-nm','--nmulti', type=int, nargs=1, default=12, help='Number of jobs')
    #parser.add_argument('-r','--redo', action='store_true', help='Redo this HEALPIX')
    args = parser.parse_args()

    t0 = time.time()
    hostname = socket.gethostname()
    host = hostname.split('.')[0]

    # Inputs
    version = dln.first_el(args.version)
    #redo = args.redo
    redo = False
    nmulti = dln.first_el(args.nmulti)
    if args.hosts is not None:
        hosts = args.hosts[0].split(',')
    else:
        hosts = [host]
    inplistfile = dln.first_el(args.list)
    if inplistfile == '': inplistfile = None
    nside = 128

    # on thing/hulk use
    if (host == "thing") or (host == "hulk"):
        basedir = "/net/dl2/dnidever/nsc/instcal/"+version+"/"
        mssdir = "/mss1/"
コード例 #2
0
    #     parallax.plotfit(meas,pars, cov)
    #except:
    #    print("This field threw an error ", idv)


# Main command-line program
if __name__ == "__main__":
    parser = ArgumentParser(description='Make diagnostic HPM plots')
    parser.add_argument('catfile', type=str, nargs=1, help='Catalog file')
    parser.add_argument('--outdir',
                        type=str,
                        nargs=1,
                        default='',
                        help='Output directory')
    args = parser.parse_args()
    catfile = args.catfile[0]
    outdir = dln.first_el(args.outdir)
    if outdir == '':
        outdir = '/net/dl2/dnidever/nsc/instcal/v3/hpm2/4panel/'

    cat = fits.getdata(catfile, 1)
    ncat = len(cat)

    for i in range(ncat):
        print(str(i + 1) + ' ' + cat['id'][i])
        try:
            make_4panelplot(cat[i], outdir)
        except Exception as e:
            print('Failed on ' + cat['id'][i] + ' ' + str(e))
            traceback.print_exc()
コード例 #3
0
                        type=str,
                        nargs=1,
                        help='M2FS ID lines translate filename')
    parser.add_argument('--outfile',
                        type=str,
                        nargs=1,
                        default='',
                        help='Output file')
    parser.add_argument('--directory',
                        type=str,
                        nargs=1,
                        default='./',
                        help='Main directory with the data')
    args = parser.parse_args()
    idlinefile = args.idlinefile[0]
    outfile = dln.first_el(args.outfile)
    directory = dln.first_el(args.directory)

    npix = 2048
    x = np.arange(npix)

    print('Fixing wavelength solution for ' + idlinefile)

    # Get template name
    with open(directory + 'arc_templates') as f:
        data = f.readlines()
    arcfilename = []
    arcfiltername = []
    for line in data:
        p = line.split()
        arcfilename.append(p[0])
コード例 #4
0
                        type=str,
                        nargs=1,
                        default=40,
                        help='Field of View (arcsec)')
    parser.add_argument('--outdir',
                        type=str,
                        nargs=1,
                        default='',
                        help='Output directory')
    parser.add_argument('--clobber',
                        action='store_true',
                        help='Overwrite existing files')
    args = parser.parse_args()
    objid = args.objid
    nobj = len(args.objid)
    fov = float(dln.first_el(args.fov))
    outdir = dln.first_el(args.outdir)
    clobber = args.clobber
    if outdir == '':
        outdir = '/net/dl2/dnidever/nsc/instcal/v3/hpm2/cutouts2/'

    if len(args.objid) == 1:
        if os.path.exists(objid[0]):
            objid = dln.readlines(objid)
            nobj = dln.size(objid)
    else:
        nobj = len(args.objid)

    if type(objid) is not list: objid = [objid]

    for i in range(nobj):
コード例 #5
0
        nargs=1,
        default=70000,
        help='The maximum number of exposures to attempt to process per host')
    parser.add_argument('--list',
                        type=str,
                        nargs=1,
                        default=None,
                        help='Input list of exposures to use')
    args = parser.parse_args()

    t0 = time.time()
    hostname = socket.gethostname()
    host = hostname.split('.')[0]

    # Inputs
    version = dln.first_el(args.version)
    redo = args.redo
    nmulti = dln.first_el(args.nmulti)
    if args.hosts is not None:
        hosts = args.hosts[0].split(',')
    else:
        hosts = host
    maxjobs = args.maxjobs
    inputlist = args.list
    if inputlist is not None:
        inputlist = inputlist[0]
    nside = 128
    radeg = 180 / np.pi
    t0 = time.time()

    # on thing/hulk use
コード例 #6
0
            outsky.append(sky1)
            outskysub.append(ext1)
            
    return outscale,outsky,outskysub


if __name__ == "__main__":
    parser = ArgumentParser(description='Run Doppler fitting on spectra')
    parser.add_argument('extfile', type=str, nargs=1, help='Extract1D filename')
    parser.add_argument('--skyfile', type=str, nargs=1, default='', help='Skyfile')
    parser.add_argument('--plugfile', type=str, nargs=1, default='', help='Plugmap file')
    parser.add_argument('--outfile', type=str, nargs=1, default='', help='Output filename')
    parser.add_argument('-d','--diag', action='store_true', help='Show diagnostic information')
    args = parser.parse_args()
    extfile = args.extfile[0]
    skyfile = dln.first_el(args.skyfile)
    plugfile = dln.first_el(args.plugfile)    
    outfile = dln.first_el(args.outfile)
    diag = args.diag

    datadir = os.path.dirname(extfile)
    base = os.path.basename(extfile)
    base = base.split('_')[0]
    if skyfile=='':
        skyfile = datadir+'/'+base+'_sky_array.pickle'
    if plugfile=='':
        plugfile = datadir+'/'+base+'_plugmap.pickle'
    if outfile=='':
        outfile = datadir+'/'+base+'_skytweak.pickle'