/KNTraP

Primary LanguageShellMIT LicenseMIT

KNTrap


Create JSON

Create JSON files for DECam given an observing sequence table

positional arguments:
  filename              Sequence file name (CSV)

optional arguments:
  -h, --help            show this help message and exit
  -oh OVERHEAD, --overhead OVERHEAD
                        Overhead between exposures (s)
  -max MAX_TIME, --max-time MAX_TIME
                        Maximim time per sequence (hr)
  -pi PI, --principal-investigator PI
                        Program Principal Investigator
  -prog PROGRAM, --program PROGRAM
                        Program name
  -id PROPID, --proposal-id PROPID
                        Proposal ID
  -c COUNT, --count COUNT
                        Number of identical repeats per exposure
  -d OUTDIR, --directory OUTDIR
                        Path to the directory where the JSON files will be
                        written

The input CSV file must have these columns:

fieldname, ra, dec, filter, exptime
CDFS, 52.5, -28.1, g, 140
CDFS, 52.5,-28.1, i, 170
...

Example:

python create_json.py observing_sequence.csv -max 2 -pi "Albert Einstein" -prog "Fun With Relativity" -id NOAO-1908A --directory JSON_files

Example output:

Observing sequence found with 148 exposures
Assuming 30s overhead between exposures
(this can be changed by passing the --overhead argument)
Sequence 1 has 43 exposures, total time 1.96hr
Sequence 2 has 39 exposures, total time 2.00hr
Sequence 3 has 39 exposures, total time 2.00hr
Sequence 4 has 27 exposures, total time 1.34hr
Expected total run time for the night: 7.36hr

Query photometry catalog

Query photometry catalogs and store them in a format that can be used by Photpipe.

Available catalogs: SkyMapper Southern Sky Survey (called as SM, SkyMapper, skymapper), Pan-STARRS1 (called as PS1, ps1, PanSTARRS, panstarrs), and the AAVSO Photometric All-Sky Survey (called as APASS). Gaia is also available, but the focus is on astrometry. The usage for photometric calibration should be made more robust.

usage: query_catalog_pipe.py [-h] [-f FILENAME] [-c CATNAME] [-o PATHDIR]
                             [-s FIELD_SIZE] [-b BRIGHT_THRESH] [-nc] [-v]

Query photometric catalogs

optional arguments:
  -h, --help            show this help message and exit
  -f FILENAME, --filename FILENAME
                        File with field centers per ccd
  -c CATNAME, --catalog CATNAME
                        Catalog to be queried (SM, PS1, APASS, Gaia)
  -o PATHDIR, --out-path PATHDIR
                        Path to the directory where the files will be saved
  -s FIELD_SIZE, --field-size FIELD_SIZE
                        Side of the catalog search box (arcmin)
  -b BRIGHT_THRESH, --bright BRIGHT_THRESH
                        Brightness (mag) threshold for stars to be flagged
  -v, --verbose         Prints out how many sources were found per field
  --clobber             Clobber (default False)

The input file should be a txt with columns in the following format (additional columns may be present):

 #field  ampl    RAdeg     DECdeg
     14hr     1  217.119992 -77.196263
     14hr     2  218.519882 -77.200877
     14hr     3  219.922000 -77.197600
     ...

Example:

query_catalog_pipe.py -f KNTraP.fieldcenters -c SM

Example output: file catalogs_photometry/14hr_g_1_SM_phot.cat

#         ra         dec       g      dg
217.681329012 -77.325544953 18.229999542236328 0.02500000037252903
217.692063093 -77.339087963 18.125999450683594 0.05400000140070915
217.266801119 -77.34544003 17.944000244140625 0.13199999928474426
...

Copying the output catalogs in photpipe directories: In order to copy the files generated by query_catalog_pipe.py into the right folders, so that they can be used by photpipe, you can use the copy_catalogs_photom.py code. Note that part of the paths are hardcoded, this is a really basic script.