Getting Started¶
There are several ways to use the twodfdr module:
Use the Tdfio class to read and write 2dF formatted FITS files.
- Use the aaorun reduction commands via PyCPL recipes.
More robust: The PyCPL aaorun recipes try each aaorun command several times until successful.
Flexible execution: Call via the command-line (pyesorex) or from Python (Pyesorex API).
Expert user support: Additional arguments can be passed using extra_args parameter.
- Use the 2dFdr reduction commands via PyCPL recipes (work in progress).
These PyCPL recipes call the 2dFdr reduction routines directly instead of aaorun commands.
More robust: The PyCPL recipes try each reduction routine several times until successful.
Flexible execution: Call via the command-line (pyesorex) or from Python (Pyesorex API).
Uses PyCPL ParameterList to manage all parameters to the reduction routines, replacing the traditional .idx files.
- Use the 2dFdr reduction commands directly via the Tdfdr class (work in progress).
An alternative to using the PyCPL recipes.
Less robust than PyCPL recipes: Up to the user to check that the commands complete successfully.
Uses PyCPL ParameterList to manage all parameters to the reduction routines, replacing the traditional .idx files.
The twodfdr project is currently under active development.
The Tdfio class is robust and fully tested. More advanced users may be interested in using it to develop their own Python reduction routines for 2dF data independent of the algorithms used in 2dFdr. We recommend that any work along these lines be delayed until we incorporate more of the 2dFdr algorithms into twodfdr.
At this stage we encourage users to use the aaorun PyCPL recipes as an interim solution for their data reduction needs until we can finalise the PyCPL recipes that call the 2dFdr reduction routines directly. The latter will have more advanced handling of all relevant parameters and will eventually serve as a platform to develop 100 per cent Python replacements for 2dFdr reduction routines.
Trying out twodfdr¶
Some sample code (sample*.py and sample*.sh) and tests (test_*.py) are available in the tests folder. You will need to retrieve several tests datasets to run the tests (see tests/README.md for instructions on how to retrieve the test data).
The sample code may be run in the usual fashion, however the tests are intended to run using pytest. We emphasise that the tests are also a valuable source of sample code for those becoming familiar with twodfdr.
Some things to try:
Load up some AAOmega configs: python sample_config.py (code is in src/twodfdr/config.py). You could also try from inside the Python source: print (c.params) to see the long list.
Load up some fibre table info: python sample_tdfio.py.
More extensive tests are in test_tdfio.py, to run: pytest test_tdfio.py.
Test some sample reductions using Python bindings to two drexec functions (called as static methods of a Tdfdr class), make_tlm and reduce_arc: python sample_tdfdr.py.
Run some PyCPL recipe wrappers to aaorun using pyesorex: sh sample_pyesorex_aaorun.sh.
Run some PyCPL recipes using pyesorex that call drexec functions directly, make_tlm and reduce_arc: sh sample_pyesorex_tdfdr.sh.
The recipes can also (preferably?) be run using the Pyesorex API, see e.g. test_recipes.py (run using pytest test_recipes.py).
Finally, if you want to run all the tests: pytest .