Simple Scripts with SpecDB (v1.3)


In [1]:
# imports

Downloading a DataBase

After installing specdb, you can grab the latest (or any previous) version of a given DB with its get_xxxx script. Here is the call for IgmSpec:

usage: specdb_get_igmspec [-h] [-v VERSION]

Grab the IGMspec DB

optional arguments:
  -h, --help            show this help message and exit
  -v VERSION, --version VERSION
                        DB version to generate

IGMSpec :: specdb_get_igmspec

v02

specdb_get_igmspec -v v02

Checking a DB file :: specdb_chk

Script to check the version and date of a given DB file

Usage

wolverine-4.local> specdb_chk -h
usage: specdb_chk [-h] db_file

Check a specdb DB file

positional arguments:
  db_file     Database file

optional arguments:
  -h, --help  show this help message and exit

Example

profx.ucolick.org> specdb_chk ~/local/Python/igmspec/DB/IGMspec_DB_v02.hdf5
specdb DB file is from the igmspec database
specdb DB file version=v02 was created on 2016-Oct-25
Latest version for specdb DB type=igmspec is version=v02
Latest creation date for this DB version was 2016-10-25
Oldest valid DB file for this DB version was 2016-10-10
Dataset: 2QZ
Dataset: BOSS_DR12
Dataset: COS-Dwarfs
Dataset: COS-Halos
Dataset: ESI_DLA
Dataset: GGG
Dataset: HD-LLS_DR1
Dataset: HDLA100
Dataset: HSTQSO
Dataset: HST_z2
Dataset: KODIAQ_DR1
Dataset: MUSoDLA
Dataset: SDSS_DR7
Dataset: XQ-100
Dataset: catalog
Dataset: quasars

Plot :: specdb_plot

usage: specdb_plot [-h] [--tol TOL] [-g GROUP] [-s SELECT] [--mplot MPLOT]
                   [--db_file DB_FILE]
                   coord dbase


specdb_plot script v0.3

positional arguments:
  coord                 Coordinates, e.g. J081240.7+320809 or 122.223,-23.2322
                        or 07:45:00.47,34:17:31.1
  dbase                 Database [igmspec,all,priv]

optional arguments:
  -h, --help            show this help message and exit
  --tol TOL             Maximum offset in arcsec [default=5.]
  --meta                Show meta data? [default: True]
  -g GROUP, --group GROUP
                        Name of Group to use
  --select SELECT       Index of spectrum to plot (when multiple exist)
  --mplot MPLOT         Use simple matplotlib plot [default: False]
  --db_file DB_FILE     Full path of db_file

Examples

FJ0812+32

specdb_plot J081240.7+320808 igmspec --group KODIAQ_DR1

J001115.23+144601.8

specdb_plot J001115.23+144601.8 igmspec

Meta Data :: specdb_meta

specdb_meta -h
usage: specdb_meta [-h] [--tol TOL] [-g GROUP] [--db_file DB_FILE] coord dbase

specdb_meta script v0.1

positional arguments:
  coord                 Coordinates, e.g. J081240.7+320809 or 122.223,-23.2322
                        or 07:45:00.47,34:17:31.1
  dbase                 Database [igmspec,uvqs,all,priv]

optional arguments:
  -h, --help            show this help message and exit
  --tol TOL             Maximum offset in arcsec [default=5.]
  -g GROUP, --group GROUP
                        Restrict on Group (e.g. BOSS_DR12)
  --db_file DB_FILE     Full path of db_file

Example

profx>  specdb_meta J081240.7+320809 igmspec
Database is igmspec
Created on 2017-Jan-31
Your search yielded 1 match[es] within radius=5 arcsec
IGM_ID   GROUP    RA_GROUP DEC_GROUP zem_GROUP          SPEC_FILE          
------ ---------- -------- --------- --------- ----------------------------
 50676  BOSS_DR12 123.1695   32.1357     2.698 spec-3758-55506-0325.fits.gz
 50676   SDSS_DR7 123.1695   32.1357     2.703 spSpec-52318-0861-333.fit.gz
 50676 KODIAQ_DR1 123.1695   32.1357     2.712        J081240+320808_f.fits
 50676    HDLA100 123.1695   32.1358     2.670            FJ0812+32B_f.fits

Interface with SDSS/BOSS Database :: specdb_sdss

usage: specdb_sdss [-h] [-s SURVEY] [--select SELECT] [-p] plate fiberid dbase

specdb_sdss script v0.1

positional arguments:
  plate                 Plate
  fiberid               FiberID
  dbase                 Database [igmspec,all]

optional arguments:
  -h, --help            show this help message and exit
  -s SURVEY, --survey SURVEY
                        Name of Survey to use (BOSS_DR12 or SDSS_DR7)
  --select SELECT       Index of spectrum to plot (when multiple exist)
  -p, --plot            Plot with lt_xspec

Example

UNIX> specdb_sdss 434 555 igmspec -p

In [ ]: