-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
400 additions
and
358 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#! /usr/bin/env python | ||
|
||
""" Convinience Function to Concatenate Results """ | ||
|
||
# Packages | ||
import argparse | ||
import numpy as np | ||
from astropy.table import Table | ||
|
||
# GELATO | ||
import gelato.Utility as U | ||
import gelato.Concatenate as C | ||
import gelato.ConstructParams as CP | ||
|
||
# Main Function | ||
if __name__ == "__main__": | ||
|
||
# Parse Arguement | ||
args = U.parseArgs() | ||
|
||
# Parameters | ||
p = CP.construct(args.Parameters) | ||
|
||
# Assemble Objects | ||
if args.single: # Single Mode | ||
objects = Table([[args.Spectrum],[args.Redshift]],names=('Path','z')) | ||
else: # Multi Mode | ||
objects = U.loadObjects(args.ObjectList) | ||
|
||
##Concatenate Results | ||
C.concatfromresults(p,objects) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/env python | ||
|
||
""" Convinience Function to Generate Rest Equivalent Widths """ | ||
|
||
# Packages | ||
import copy | ||
|
||
# GELATO | ||
import gelato.Utility as U | ||
import gelato.ConstructParams as CP | ||
import gelato.EquivalentWidth as EW | ||
|
||
# Main Function | ||
if __name__ == "__main__": | ||
|
||
# Parse Arguement | ||
args = U.parseArgs() | ||
|
||
# Parameters | ||
p = CP.construct(args.Parameters) | ||
|
||
# Single Mode | ||
if args.single: | ||
|
||
EW.EWfromresults(p, args.Spectrum, args.Redshift) | ||
|
||
# Multi Mode | ||
else: | ||
|
||
## Assemble Objects | ||
objects = U.loadObjects(args.ObjectList) | ||
|
||
# EWs | ||
if p['NProcess'] > 1: # Mutlithread | ||
import multiprocessing as mp | ||
pool = mp.Pool(processes=p['NProcess']) | ||
inputs = [(copy.deepcopy(p),o['Path'],o['z']) for o in objects] | ||
pool.starmap(EW.EWfromresults, inputs) | ||
pool.close() | ||
pool.join() | ||
else: # Single Thread | ||
for o in objects: EW.EWfromresults(copy.deepcopy(p),o['Path'],o['z']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/env python | ||
|
||
""" Convinience Function for Plotting """ | ||
|
||
# Packages | ||
import copy | ||
|
||
# GELATO | ||
import gelato.Utility as U | ||
import gelato.Plotting as P | ||
import gelato.ConstructParams as CP | ||
|
||
# Main Function | ||
if __name__ == "__main__": | ||
|
||
# Parse Arguement | ||
args = U.parseArgs() | ||
|
||
# Parameters | ||
p = CP.construct(args.Parameters) | ||
|
||
# Single Mode | ||
if args.single: | ||
|
||
P.plotfromresults(p, args.Spectrum, args.Redshift) | ||
|
||
# Multi Mode | ||
else: | ||
|
||
# Assemble Objects | ||
objects = U.loadObjects(args.ObjectList) | ||
|
||
# Plot | ||
if p['NProcess'] > 1: # Mutlithread | ||
import multiprocessing as mp | ||
pool = mp.Pool(processes=p['NProcess']) | ||
inputs = [(copy.deepcopy(p),o['Path'],o['z']) for o in objects] | ||
pool.starmap(P.plotfromresults, inputs) | ||
pool.close() | ||
pool.join() | ||
else: # Single Thread | ||
for o in objects: P.plotfromresults(copy.deepcopy(p),o['Path'],o['z']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#! /usr/bin/env python | ||
|
||
""" Wrapper for mulitple gelato runs """ | ||
|
||
# Packages | ||
import os | ||
import copy | ||
from pathlib import Path | ||
|
||
# GELATO | ||
import gelato | ||
import gelato.Utility as U | ||
import gelato.ConstructParams as CP | ||
|
||
# Main Function | ||
if __name__ == "__main__": | ||
|
||
# Parse Arguement | ||
args = U.parseArgs() | ||
|
||
# Parameters | ||
p = CP.construct(args.Parameters) | ||
|
||
## Create Directory for Output | ||
if not os.path.exists(p["OutFolder"]): | ||
Path(p["OutFolder"]).mkdir(parents=True) | ||
|
||
if p['Verbose']: | ||
now = U.header() | ||
|
||
# Single Mode | ||
if args.single: | ||
|
||
gelato.gelato(args.Parameters, args.Spectrum, args.Redshift) | ||
|
||
# Multi Mode | ||
else: | ||
|
||
# Assemble Objects | ||
objects = U.loadObjects(args.ObjectList) | ||
|
||
## Run gelato ## | ||
if p['NProcess'] > 1: # Mutlithread | ||
import multiprocessing as mp | ||
pool = mp.Pool(processes=p['NProcess']) | ||
inputs = [(copy.deepcopy(args.Parameters),o['Path'],o['z']) for o in objects] | ||
pool.starmap(gelato.gelato, inputs) | ||
pool.close() | ||
pool.join() | ||
else: # Single Thread | ||
for o in objects: | ||
gelato.gelato(copy.deepcopy(args.Parameters),o['Path'],o['z']) | ||
## Run gelato ## | ||
|
||
# Concatenate Results | ||
if p['Concatenate']: | ||
import gelato.Concatenate as C | ||
C.concatfromresults(p,objects) | ||
|
||
if p['Verbose']: | ||
U.footer(now) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.