Example #1
0
	forceImages = False
	if args.force: forceImages = True
	
	searchForHeaders = False
	skipthumbnails = False
	skipimages = False
	processAllImages = True
	if args.number>0: 	processAllImages=False
	if args.skipallimages:
		skipthumbnails = True
		skipimages = True
	if args.skipimages == True: skipimages = True
	# if args.skipthumbnails == True: skipthumbnails = True
		
	
	config = configHelper.configClass("fitsBrowser")
	configDefaults  = {
		"FITSPath": ".",
		"SearchString": ".*.(fits|fits.gz|fits.fz|fit)",
		"WebPath": ".",
		"InstallPath": "undefined", 
		"ThumbnailSize": 128, 
		"FITSHeadersList": "/home/rashley/fitHeaders.list"
	}
	config.setDefaults(configDefaults)
	rootPath = config.assertProperty("FITSPath", args.datapath)
	searchString = config.assertProperty("SearchString", None)
	webPath = config.assertProperty("WebPath", args.webpath)
	installPath = config.assertProperty("InstallPath", args.installpath)
	thumbnailSize = config.assertProperty("ThumbnailSize", args.size)
	fitsHeaderListFilename = config.assertProperty("FITSHeadersList", args.headerlist)
Example #2
0
        help='Write the input parameters to the config file as default values.'
    )
    parser.add_argument(
        '--ignorecache',
        action="store_true",
        help=
        'Ignore the cached DR2 catalogue. Will overwrite one if it already exists.'
    )
    parser.add_argument(
        '--smallscreen',
        action="store_true",
        help='Use much smaller PGPLOT image sizes for a small laptop screen.')
    args = parser.parse_args()
    print(args)

    config = configHelper.configClass("inspectIPHASImage")
    if args.save:
        config.save()

    paperSize = 5.5  # Paper size in inches
    if args.smallscreen: paperSize = 3.5
    imageMinMax = (0, 255)
    plotSources = False
    plotHa = False
    plotGrid = False
    plotBrightStars = False
    brightStars = []
    invertedColours = True
    pixelGrid = []
    maskPlot = {}
    mask = []
Example #3
0
    )
    parser.add_argument('--datapath',
                        type=str,
                        help='The root path for the IPHAS images.')
    parser.add_argument(
        '--save',
        action="store_true",
        help='Write the input parameters to the config file as default values.'
    )
    args = parser.parse_args()
    print(args)

    if args.save:
        config.save()

    config = configHelper.configClass("metaData")
    configDefaults = {
        "RootPath": "/Users/rashley/astro/IPHAS",
        "SearchPath": ".*(r[0-9]{3})"
    }
    config.setDefaults(configDefaults)
    rootPath = config.assertProperty("RootPath", args.datapath)
    searchPath = config.assertProperty("SearchPath", None)
    search_re = re.compile(searchPath)

    fitsObjects = []
    # Find all folders in data path
    folders = os.walk(rootPath)
    IPHASFolders = []
    for f in folders:
        m = search_re.match(f[0])
Example #4
0
def joinPaths(path1, path2):
	if path1[-1] == '/': return path1 + path2
	return path1 + '/' + path2

if __name__ == "__main__":
	
	parser = argparse.ArgumentParser(description='Crawls through the directories and gathers file and FITS header meta-data.')
	parser.add_argument('--datapath', type=str, help='The root path for the IPHAS images.')
	parser.add_argument('--save', action="store_true", help='Write the input parameters to the config file as default values.')
	args = parser.parse_args()
	print(args)

	if args.save:
		config.save()
	
	config = configHelper.configClass("metaData")
	configDefaults  = {
		"RootPath": "/Users/rashley/astro/IPHAS",
		"SearchPath": ".*(r[0-9]{3})"
	}
	config.setDefaults(configDefaults)
	rootPath = config.assertProperty("RootPath", args.datapath)
	searchPath = config.assertProperty("SearchPath", None)
	search_re = re.compile(searchPath)
	
	fitsObjects = []
	# Find all folders in data path
	folders = os.walk(rootPath)
	IPHASFolders = []
	for f in folders:
		m = search_re.match(f[0])
Example #5
0
		
def withinMargins(table, namedColumns):
	print namedColumns
	return True
	

if __name__ == "__main__":
	
	parser = argparse.ArgumentParser(description='Loads an IFAS mosaic image. Displays it with PGPLOT.')
	parser.add_argument('filename', type=str, help='The FITS image file.')
	parser.add_argument('--save', action="store_true", help='Write the input parameters to the config file as default values.')
	parser.add_argument('--ignorecache', action="store_true", help='Ignore the cached DR2 catalogue. Will overwrite one if it already exists.')
	args = parser.parse_args()
	print args
	
	config = configHelper.configClass("inspectIPHASImage")

	"""exposureTime = config.getProperty("ExposureTime")
	if args.exposureTime!=None:
		exposureTime = args.exposureTime
		config.ExposureTime = exposureTime
	if exposureTime == None:
		print "Please specify an exposure time or save one in the config file."
		sys.exit()
	"""
	
	paperSize = 6  # Paper size in inches
	imageMinMax = (0, 255)
	plotSources = True
	invertedColours = True
	
Example #6
0
from astropy.table import Table, vstack
from astropy.utils import data
import astropy.table	



if __name__ == "__main__":
	
	parser = argparse.ArgumentParser(description='Loads an IFAS DR2 catalogue FITS file and inspects the contents.')
	parser.add_argument('filename', type=str, help='The DR2 FITS file.')
	parser.add_argument('--save', action="store_true", help='Write the input parameters to the config file as default values.')
	parser.add_argument('--ignorecache', action="store_true", help='Ignore the cached DR2 catalogue. Will overwrite one if it already exists.')
	args = parser.parse_args()
	print args
	
	config = configHelper.configClass("browseDRfitsDB")
	
	if args.save:
		config.save()
	
	hdulist = fits.open(args.filename)
	
	print hdulist.info()
	
	metadata = hdulist[0].data
	
	for index, card in enumerate(hdulist):
		print "Card number:%d"%index
		print card.header.keys()
		print repr(card.header)
		
import argparse
import sys, subprocess, os
import json, re
import datetime
import configHelper

if __name__ == "__main__":
	
	parser = argparse.ArgumentParser(description='Looks into the web directory of the SAFT movies and creates an updated JSON file for the web client to read.')
	parser.add_argument('--save', action="store_true", help='Write the input parameters to the config file as default values.')
	parser.add_argument('--archive', action="store_true", help="Archive the used jpg files to a tarball.")
	parser.add_argument('--publish', action="store_true", help="Publish the new videos to the web directory.")
	parser.add_argument('--web', type=str, help="Specify the location of the web publishing directory.")
	args = parser.parse_args()
	
	configObject = configHelper.configClass("saftmovie")
	if args.web!=None:
		configObject.webDirectory = args.web
	webDirectory = configObject.getProperty("webDirectory")
	if webDirectory == None:
		print "ERROR: Please specify the directory of the web pages using the --web parameter"
		sys.exit()
		
	if args.save:
		configObject.save()
	
	today = datetime.date.today()

	todayString = str(today).replace("-","")
	
	try:
Example #8
0
if __name__ == "__main__":

    parser = argparse.ArgumentParser(description="Loads an IFAS DR2 catalogue FITS file and inspects the contents.")
    parser.add_argument("filename", type=str, help="The DR2 FITS file.")
    parser.add_argument(
        "--save", action="store_true", help="Write the input parameters to the config file as default values."
    )
    parser.add_argument(
        "--ignorecache",
        action="store_true",
        help="Ignore the cached DR2 catalogue. Will overwrite one if it already exists.",
    )
    args = parser.parse_args()
    print args

    config = configHelper.configClass("browseDRfitsDB")

    if args.save:
        config.save()

    hdulist = fits.open(args.filename)

    print hdulist.info()

    metadata = hdulist[0].data

    for index, card in enumerate(hdulist):
        print "Card number:%d" % index
        print card.header.keys()
        print repr(card.header)