star_extraction
- Stellar Extraction routines¶
Star Extraction routine. Equivalent of rsp1 script.
Extract star at a given RA/DEC using all shots overlapping with these coordinates.
Contains python translation of Karl Gebhardt
-
vdrp.star_extraction.
apply_factor_spline
(factor, wdir)[source]¶ Equivalent of the rawksp[12] scripts
Apply the factor to the splines.out file. The factor is the number of individual shots the star was observed in.
Parameters: - factor : int
The factor to apply.
- wdir : str
Name of the work directory
-
vdrp.star_extraction.
average_spectra
(specfiles, starobs, wl, wlrange, wdir)[source]¶ Average all observed spectra and fill in the corresponding entries in the StarObservation class.
This corresponds to the ravgsp0 script
Parameters: - specfiles : list
List of spectrum filenames.
- starobs : list
List with StarObservation objects.
- wl : float
Central wavelength for the averaging.
- wlrange : float
Half width of the wavelength range for averaging.
-
vdrp.star_extraction.
average_spectrum
(spec, wlmin, wlmax)[source]¶ Corresponds to ravgsp0 script. Calculate the average of the spectrum in the range [wlmin, wlmax]
Parameters: - spec : Spectrum
Spectrum class object
- wlmin : float
Minimum wavelength of range to average.
- wlmax : float
Maximum wavelength of range to average.
Returns: - average, normaliztaion and uncertainty, equivalent to the spavg*.dat files.
-
vdrp.star_extraction.
copy_stardata
(starname, starid, wdir)[source]¶ Copies the result files from workdir results_dir as done by rspstar.
Parameters: - starname : str
Star name to copy over.
- starid : int
Star ID to use for the final filename.
- results_dir : str
Final directory for results.
-
vdrp.star_extraction.
extract_star
(args)[source]¶ Equivalent of the rsp1a2b script.
Run the stellar extraction code for a given ra / dec position.
Parameters: - args : struct
The arguments structure
-
vdrp.star_extraction.
get_arguments
(parser)[source]¶ Add command line arguments for the photometry routines, this function can be called from another tool.
Parameters: - parser : argparse.ArgumentParser
-
vdrp.star_extraction.
parseArgs
(argv)[source]¶ Parses configuration file and command line arguments. Command line arguments overwrite configuration file settiongs which in turn overwrite default values.
- Args:
- args (argparse.Namespace): Return the populated namespace.
-
vdrp.star_extraction.
run_fit2d
(ra, dec, starobs, seeing, outname, wdir)[source]¶ Prepare input files for running fit2d, and run it.
Parameters: - ra : float
Right Ascension of the star.
- dec : float
Declination of the star.
- starobs : list
List with StarObservation objects.
- seeing : float
Assumed seeing for the observation.
- outname : str
Output filename.
-
vdrp.star_extraction.
run_fitem
(wl, outname, wdir)[source]¶ Prepare input file for fitem, and run it.
Parameters: - wl : float
Wavelength
- outname : str
Base output filename.