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

Majority of requested new outputs #85

Merged
merged 31 commits into from
Nov 2, 2015
Merged

Majority of requested new outputs #85

merged 31 commits into from
Nov 2, 2015

Conversation

dwysocki
Copy link
Member

@dwysocki dwysocki commented Nov 1, 2015

This pull request primarily adds a number of additional output formats, and refactors the existing formats.

The formats are described in #75. The ones implemented are:

  • tabular:
    • light curve
    • residual (partially done)
    • periodogram
    • fourier coeffs
    • fourier ratios
  • plots:
    • light curve (TikZ added)
    • residual (mpl only)
    • periodogram (mpl only)

dwysocki and others added 30 commits August 29, 2015 12:25
There appeared to be a stray comma, turning a return value into a
1-tuple, and then later we took element 0 from the tuple, so it was useless.
This is in preparation for outputting this to a file.
It can still be re-enabled by providing an alternative matplotlibrc file
with the `--matplotlibrc FILE` flag.
Removed native LaTeX rendering option from default matplotlibrc
The columns for `Period`, `R^2`, and `MSE` in the output table were not
being formatted by the CLI-provided format string. This has now been fixed.
Fixing inconsistent number formatting in output table
Renamed plotypus.py -> cli.py
According to PEP-8

Good: `def f(x): return 2*x`

Bad: `f = lambda x: 2*x`

We had a few instances of the latter, because I was unaware that nested
`def`'s do not bleed into the outer scope, and thought the former was a
bad practice.
Replaced named lambdas with nested def's
I have implemented the logic described in #76 for output filenames. I
still need to add things like validating inputs, and documentation.
All of the machinery for the new output logic is in place and appears to
handle all cases correctly. New output types still need to be added, but
they will easily fit into this new architecture.
The help text for `--output-{table,plot}-*` has been updated to describe
their overloaded usage (in conjunction with `--output-*-all` options)
Merging from branch nil, which shouldn't exist
Now the option `--output-table-periodogram` allows you to output the
periodogram to a tabular file, in units of
`--output-periodogram-form={period,frequency}`. The option to output a
plot still needs to be added.

This required a bit of modification to the periodogram functions, so
that they now optionally return the entire periodogram, in addition to the
optimal period. This is not the case by default, as it is extra
computation, and it can be set with the `output_periodogram` keyword argument.
Fourier coefficients (e.g. A_0, A_1) and ratios (e.g. Phi_21) were
previously all printed to stdout, creating a huge messy output table,
which does not scale to multiple periods. I have now given them their
own output table files, and only print A_0 and dA_0 to stdout. I have
also included columns for errors, although we do not yet calculate
them, except for dA_0 (which needs improvement anyway).

To accomodate this new form of output, I have edited `get_lightcurve`,
so that it returns the coefficients in an (n+1) by 2 array. I also added
a similar output for the fourier ratios, as well as the errors on both
of these outputs.

I have also taken the liberty of adding headers to all of the output
tables including existing ones.
These can still use a lot of touching up, but for now they get the job done.
dwysocki added a commit that referenced this pull request Nov 2, 2015
I think everything is in a good shape to merge with develop. Everything could probably use a little polish, but it's in a usable state.
@dwysocki dwysocki merged commit f6e352c into develop Nov 2, 2015
@dwysocki dwysocki deleted the new-outputs branch November 2, 2015 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant