Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set 'lineOutfile' to write calculated spectral indices? #28

Closed
JosephKarpinski opened this issue Oct 9, 2018 · 2 comments
Closed

Comments

@JosephKarpinski
Copy link

JosephKarpinski commented Oct 9, 2018

PyHammer Help does not list an option for 'lineOutfile':

#if the user wants the calculated spectral indices, write them to a file
            if options['lineOutfile'] is not None:
                if i == 0: 
                    lineOutfile = open('spectralIndices.csv', 'w')
                    lineOutfile.write('#Filename, CaK, CaK_var, Cadel, Cadel_var, CaI4217, CaI4217_var, Gband, Gband_var, Hgam, Hgam_var, FeI4383, FeI4383_var, FeI4404, FeI4404_var, Hbeta, Hbeta_var, MgI, MgI_var, NaD, NaD_var, CaI6162, CaI6162_var, Halpha, Halpha_var, CaH2, CaH2_var, CaH3, CaH3_var, TiO5, TiO5_var, VO7434, VO7434_var, VO7445, VO7445_var, VO-B, VO-B_var, VO7912, VO7912_var, Rb-B, Rb-B_var, NaI, NaI_var, TiO8, TiO8_var, TiO8440, TiO8440_var, Cs-A, Cs-A_var, CaII8498, CaII8498_var, CrH-A, CrH-A_var, CaII8662, CaII8662_var, FeI8689, FeI8689_var, FeH, FeH_var\n')
Welcome to the PyHammer, a tool for spectral classification.

Options:
-c, --cmd           Flag to choose to run on the command line.
-e, --eyecheck      Flag indicating pyhammer should skip classifying
                    and go straight to checking the spectra by eye.
-f, --full          Flag indicating the full path to the spectra is
                    provided in the input file list.
-g, --gui           Flag to choose to run using the gui.
-i, --infile        The full path to the input file or the name, if it
                    is in the pyhammer folder. If nothing is
                    provided, it will be asked for later.
-o, --outfile       The full path to the output file or a filename
                    which outputs to the pyhammer folder. If nothing is
                    provided, the default pyhammerResults.csv will be
                    created in the pyhammer folder.
-p, --path          The full path to the spectra. This is only necessary
                    if the input file list does not prepend the path to
                    the spectra filenames.
-r, --rejectfile    The full path to the file where reject spectra will
                    be listed or a filename which outputs to the
                    pyhammer folder . If nothing is provided, the
                    default rejectSpectra.csv will be created in the
                    pyhammer folder.
-s, --sncut         The S/N necessary before a spectra will be classified.
                    A signal to noise of ~3-5 per pixel is recommended.

Example:
python pyhammer.py -g -f -s 3 -i C:/Path/To/File/inputFile.txt -o C:/Path/To/File/outputFile.csv -r C:/Path/To/File/rejectFile.csv
@JosephKarpinski
Copy link
Author

Temporary workaround is to modify code in the PyHammer Entry Point main
and change the default 'lineOutfile' value from 'None' to 'True'.

See attachment:
lineoutfile_workaround

@zephyr5050
Copy link
Collaborator

zephyr5050 commented Oct 12, 2018

Added options to command line inputs, command line processing, and GUI to effect this option. Additions are on developer branch in commit 813bcff.

Try it out and let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants