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

Add documentation on how to locally test derived parameters #88

Open
taldcroft opened this issue Mar 18, 2014 · 0 comments
Open

Add documentation on how to locally test derived parameters #88

taldcroft opened this issue Mar 18, 2014 · 0 comments

Comments

@taldcroft
Copy link
Member

There needs to be some documentation available for how to develop and locally test new / updated derived parameter definitions. Here is what was sent by email in 2011. The docs should generalize this specific example:

% cd <my_work_dir>
% tar xf /proj/sot/ska/pkgs/Ska.engarchive-0.14.tar.gz
% cd Ska.engarchive-0.14

(The 0.14 might change. Always look for the latest version).

Now edit Ska/engarchive/derived/init.py and add a line like

from .pcad import *

where "pcad" is the name of the new derived parameter module that you
have placed into the Ska/engarchive/derived/ directory. Now from the
top (Ska.engarchive-0.14/) directory run python:

% ipython -pylab
from Ska.Matplotlib import plot_cxctime
import Ska.engarchive
print Ska.engarchive.__file__
# The above should show "Ska/engarchive/__init__.pyc" which means
# you are using your local dev version of the Ska engarchive package.

import Ska.engarchive.derived
dp = Ska.engarchive.derived.DP_DPA_POWER()  # YOUR CLASS HERE
data = dp.fetch('2011:001', '2011:010')
vals = dp.calc(data)
plot_cxctime(data.times, vals)

# If your derived params class sets bad values you might want to do this:
ok = ~data.bads
plot_cxctime(data.times[ok], vals[ok], '.')

cc: @matthewdahmer @aarvai

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

1 participant