py/prospect/scripts/prospect_pages.py
def page_subset(spectra, nspecperfile, titlepage_prefix, viewer_params, log,
                zcat=None, redrock_cat=None, sort_by_targetid=False):
    """ Make a set of prospect html pages from (spectra, zcat, redrock_cat)
        zcat and redrock_cat must be entry-matched to spectra
    """
    nspec_tot = spectra.num_spectra()
    log.info(" * Total nb spectra for this set of VI pages: "+str(nspec_tot))
    if sort_by_targetid:
        sort_indices = np.argsort(spectra.fibermap["TARGETID"])
    else:
        sort_indices = np.arange(nspec_tot)
    nbpages = int(np.ceil((nspec_tot/nspecperfile)))
    for i_page in range(1,1+nbpages) :
        log.info(" * Page "+str(i_page)+" / "+str(nbpages))
        the_indices = sort_indices[(i_page-1)*nspecperfile:i_page*nspecperfile]
        thespec = spectra[the_indices]
        if zcat is not None:
            the_zcat = zcat[the_indices]
        else:
            the_zcat = None
        if redrock_cat is not None :
            the_rrtable = redrock_cat[the_indices]
        else :
            the_rrtable = None
        titlepage = titlepage_prefix
        if nbpages>1: titlepage += ("_"+str(i_page))
        plotspectra(thespec, zcatalog=the_zcat, redrock_cat=the_rrtable,
                    title=titlepage, html_dir=viewer_params['html_dir'],
                    mask_type=viewer_params['mask_type'], top_metadata=viewer_params['top_metadata'],
                    template_dir=viewer_params['template_dir'], num_approx_fits=viewer_params['num_approx_fits'],
                    with_full_2ndfit=viewer_params['with_full_2ndfit'], vi_countdown=viewer_params['vi_countdown'],
                    with_thumb_only_page=viewer_params['with_thumb_only_page'])

    return nspec_tot
 Make a set of prospect html pages from (spectra, zcat, redrock_cat)
        zcat and redrock_cat must be entry-matched to spectra
    
Make a set of prospect html pages from (spectra, zcat, redrock_cat)
zcat and redrock_cat must be entry-matched to spectra
Make a set of prospect html pages from ( spectra zcat redrock_cat ) zcat and redrock_cat must be entry - matched to spectra
def page_subset(spectra, nspecperfile, titlepage_prefix, viewer_params, log,
                zcat=None, redrock_cat=None, sort_by_targetid=False):
    nspec_tot = spectra.num_spectra()
    log.info(" * Total nb spectra for this set of VI pages: "+str(nspec_tot))
    if sort_by_targetid:
        sort_indices = np.argsort(spectra.fibermap["TARGETID"])
    else:
        sort_indices = np.arange(nspec_tot)
    nbpages = int(np.ceil((nspec_tot/nspecperfile)))
    for i_page in range(1,1+nbpages) :
        log.info(" * Page "+str(i_page)+" / "+str(nbpages))
        the_indices = sort_indices[(i_page-1)*nspecperfile:i_page*nspecperfile]
        thespec = spectra[the_indices]
        if zcat is not None:
            the_zcat = zcat[the_indices]
        else:
            the_zcat = None
        if redrock_cat is not None :
            the_rrtable = redrock_cat[the_indices]
        else :
            the_rrtable = None
        titlepage = titlepage_prefix
        if nbpages>1: titlepage += ("_"+str(i_page))
        plotspectra(thespec, zcatalog=the_zcat, redrock_cat=the_rrtable,
                    title=titlepage, html_dir=viewer_params['html_dir'],
                    mask_type=viewer_params['mask_type'], top_metadata=viewer_params['top_metadata'],
                    template_dir=viewer_params['template_dir'], num_approx_fits=viewer_params['num_approx_fits'],
                    with_full_2ndfit=viewer_params['with_full_2ndfit'], vi_countdown=viewer_params['vi_countdown'],
                    with_thumb_only_page=viewer_params['with_thumb_only_page'])
    return nspec_tot
def page_subset ( spectra , nspecperfile , titlepage_prefix , viewer_params , log , zcat = None , redrock_cat = None , sort_by_targetid = False ) : nspec_tot = spectra . num_spectra ( ) log . info ( " * Total nb spectra for this set of VI pages: " + str ( nspec_tot ) ) if sort_by_targetid : sort_indices = np . argsort ( spectra . fibermap [ "TARGETID" ] ) else : sort_indices = np . arange ( nspec_tot ) nbpages = int ( np . ceil ( ( nspec_tot / nspecperfile ) ) ) for i_page in range ( 1 , 1 + nbpages ) : log . info ( " * Page " + str ( i_page ) + " / " + str ( nbpages ) ) the_indices = sort_indices [ ( i_page - 1 ) * nspecperfile : i_page * nspecperfile ] thespec = spectra [ the_indices ] if zcat is not None : the_zcat = zcat [ the_indices ] else : the_zcat = None if redrock_cat is not None : the_rrtable = redrock_cat [ the_indices ] else : the_rrtable = None titlepage = titlepage_prefix if nbpages > 1 : titlepage += ( "_" + str ( i_page ) ) plotspectra ( thespec , zcatalog = the_zcat , redrock_cat = the_rrtable , title = titlepage , html_dir = viewer_params [ 'html_dir' ] , mask_type = viewer_params [ 'mask_type' ] , top_metadata = viewer_params [ 'top_metadata' ] , template_dir = viewer_params [ 'template_dir' ] , num_approx_fits = viewer_params [ 'num_approx_fits' ] , with_full_2ndfit = viewer_params [ 'with_full_2ndfit' ] , vi_countdown = viewer_params [ 'vi_countdown' ] , with_thumb_only_page = viewer_params [ 'with_thumb_only_page' ] ) return nspec_tot
Make a set of prospect html pages from (spectra, zcat, redrock_cat)
zcat and redrock_cat must be entry-matched to spectra
Make a set of prospect html pages from ( spectra zcat redrock_cat ) zcat and redrock_cat must be entry - matched to spectra
""" Make a set of prospect html pages from (spectra, zcat, redrock_cat)
        zcat and redrock_cat must be entry-matched to spectra
    """
spectra
nspecperfile
titlepage_prefix
viewer_params
log
zcat
redrock_cat
sort_by_targetid