Skip to content
Kyle Barbary edited this page Jun 19, 2014 · 6 revisions

ddtpy Roadmap

  • reading in FITS data
  • reading in PSF models
  • ...
  • profit!

=====================================================================

Description of main steps in DDT Yorick code

Main entry point: run_ddt.i <option_script>

<option_script> is a Yorick file that gets included at some point. It contains all the inputs and output filenames and optional parameters

  • includes ddt_startup.i

    This includes all the necessary modules (Yorick and DDT-specific), like a lot of imports in Python

  • includes run_ddt_galaxy_subtraction_all_regul_variable_all_epoch.i for default (job=0) mode.

The following details the script run_ddt_galaxy_subtraction_all_regul_variable_all_epoch.i

Set-up

ddt = ddt_setup_ddt(option_include_file) (defined in ddt_setup.i)

  • does a few scalar parameter checks

  • calls ddt_data = ddt_read_dataset(in_cube, ... ) (defined in ddt_io.i)

    in_cube is a list of cube filenames

    • calls ddt_read_datacube() repeatedly
      • returns hash table with members x, y, lambda, data, weight (x, y apparently not used)
      • calls ddt_get_axis() - kinda gets WCS for single axis
      • calls ddt_read_array() - simple read with BSCALE/BZERO FITS handling

===========================================================

Yorick peculiarities

  • Following the C influence, there are no multiple return values (tuples). Multiple return values are handled as in C: a function defined with function foo(&bar) can make write to bar and have the changes reflect to the caller. (Apparently, with the &, the variable is evaluated in the caller's scope?

  • You'd think dimsof(<array>) would return then dimensions of the array: [d1, d2, d3, ...]. Instead, the first element is the number of dimensions: [ndim, d1, d2, d3, ...]. Why couldn't you just get this from the length of the return value?

Clone this wiki locally