read.in.data: Read in and index IRAC data from individual files and image...

Description Usage Arguments Details Value Author(s) Examples

Description

Constructs a list containing all the data included in the list of files and images specified.

Usage

1
2
read.in.data(data.ch1 = NA, data.ch2 = NA, ch1.imag = NA, 
ch2.imag = NA, star_id, cores = 4)

Arguments

data.ch1

Vector containing pathways to all files of data from [3.6]

data.ch2

Vector containing pathways to all files of data from [4.5]

ch1.imag

Vector containing pathways to all fits images from [3.6]

ch2.imag

Vector containing pathways to all fits images from [4.5]

star_id

Vector of ID numbers for each star. See description.

cores

Number of cores to run this function for multicore processing. Defaults to 4.

Details

Input data for the first two inputs should be tables with the following formats: #'RA', 'DEC', 'id', 'RA2', 'DEC2', 'x', 'y', 'flux', 'snr', 'sep' This format comes naturally from using the program Topcat to match a table of all the stars in the field of interest (RA,DEC,id, where id is the star id number) and the output from the APEX single frame module in MOPEX (an IRAC source extractor written by the SPITZER Science Center). These columns are RA, DEC, the x and y pixel coordinates (range 1:256) and the stellar flux and SNR. The 'sep' is generated by Topcat. ID numbers for all stars of interest should be placed in numerical order and inputted into this function as star_id. The program uses this list to index where each star appears in the data. It automatically applies a flux cut for detections greater than 72800 microJansky * s for ch1 and 821600 microJansky *s for ch2. Sources with flux greater than this are slightly saturated and do not provide accurate centroids. The program also applies a mask of flagged bad pixels to the data replacing the detection with NA.

The structure of the object returns is a list of two dataframes, one list, star_id, and the number of detections for each star.

The first dataframe has columns: image_id, star_id, x, y, FLUX, and SNR, where the image_id is the image number (negative indicates data from [4.5]) and star_id is the id column from the input data. The dataframe will be as long as the the total number of detections from every image combined.

The second dataframe is as long as the length of ch1.imag and ch2.imag combined and has columns 'image_id', 'CRVAL1', 'CRVAL2', 'CD1_1', 'CD1_2', 'CD2_1', 'CD2_2', 'AORKEY', 'HMJD', 'EXPTIME', which are taken from the headers of fits image.

The list is an index of where each object in star_id is within the first dataframe. Each element in the list is a vector containing the indices for the corresponding object. This index is used internally for many functions.

The n_detections is a vector of length length(star_id) containing the total number of detections for each object.

It is not necessary to have both ch1 and ch2 data.

Value

Returns a list of dataframes with the following components:

data

See Details

image_key

See Details

index

See Details

n_detections

See Details

star_id

A copy of the original star_id given the program

Author(s)

Taran Esplin

Examples

1
2
3
4
5
6
7
8
## Not run: 
#This function cannot be easily turned into an example
#since it is primarily designed to read data and images.
#An example output is found in data1 
data(data1)
str(data1)

## End(Not run)

esplint/IRACpm documentation built on May 16, 2019, 8:52 a.m.