IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 5, 2013, 2:24:05 PM (13 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20130207
Files:
20 edited
9 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130207

  • branches/eam_branches/ipp-20130207/ippTools/share

  • branches/eam_branches/ipp-20130207/ippTools/share/Makefile.am

    r34933 r35236  
    155155        difftool_completed_runs.sql \
    156156        difftool_coalesce_run.sql \
     157        difftool_definewarpstack.sql \
    157158        difftool_definewarpstack_part1.sql \
    158159        difftool_definewarpstack_part2.sql \
     
    463464        sctool_list.sql \
    464465        releasetool_listsurvey.sql \
     466        releasetool_tocalibexp.sql \
    465467        releasetool_listrelease.sql \
    466468        releasetool_listrelexp.sql \
    467         releasetool_definerelexp.sql
     469        releasetool_definerelexp.sql \
     470        releasetool_definerelstack.sql \
     471        releasetool_definerelstack_with_skycal.sql \
     472        releasetool_definerelgroup_select_lap.sql \
     473        releasetool_definerelgroup_select_data_group.sql \
     474        releasetool_definerelgroup_select_exp_data_group.sql \
     475        releasetool_definerelgroup_select_exp_lap.sql \
     476        releasetool_pendingrelgroup.sql
    468477
  • branches/eam_branches/ipp-20130207/ippTools/share/bgtool_chip.sql

    r35100 r35236  
    55    chipBackgroundRun.label,
    66    chipBackgroundRun.data_group,
     7    chipBackgroundRun.chip_id,
     8    chipBackgroundRun.cam_id,
    79    rawExp.exp_id,
    810    rawExp.exp_name,
     
    1214    rawExp.ra,
    1315    rawExp.decl,
    14     rawExp.exp_time,
    15     chipRun.chip_id
     16    rawExp.exp_time
    1617FROM chipBackgroundRun
    1718JOIN chipBackgroundImfile USING(chip_bg_id)
  • branches/eam_branches/ipp-20130207/ippTools/share/bgtool_chipinputs.sql

    r28486 r35236  
    11SELECT
    2     chipProcessedImfile.*
     2    chipProcessedImfile.*,
     3    camProcessedExp.path_base AS cam_path_base
    34FROM chipBackgroundRun
    45JOIN chipRun USING(chip_id)
    56JOIN chipProcessedImfile USING(chip_id)
     7LEFT JOIN camProcessedExp ON chipBackgroundRun.cam_id = camProcessedExp.cam_id
    68WHERE chipRun.state = 'full'
    79    AND chipProcessedImfile.fault = 0
  • branches/eam_branches/ipp-20130207/ippTools/share/bgtool_definechip.sql

    r35119 r35236  
    11SELECT
    2     chipRun.*
     2    chipRun.*,
     3    camRun.cam_id,
     4    chip_bg_id,
     5    CURRENT_TIMESTAMP AS registered
    36FROM chipRun
    47JOIN rawExp USING(exp_id)
    5 LEFT JOIN chipBackgroundRun USING(chip_id)
    6 WHERE chipRun.state = 'full'
     8JOIN chipRun as altChipRun USING(exp_id)
     9JOIN camRun ON altChipRun.chip_id = camRun.chip_id
     10JOIN camProcessedExp USING(cam_id)
     11LEFT JOIN chipBackgroundRun ON chipBackgroundRun.chip_id = chipRun.chip_id -- labelHook %s
     12WHERE chipRun.state = 'full' AND camRun.state ='full' AND camProcessedExp.quality = 0
  • branches/eam_branches/ipp-20130207/ippTools/share/bgtool_definewarp.sql

    r28551 r35236  
    11SELECT
    2     warpRun.*,
    3     chipBackgroundRun.chip_bg_id
     2    warpRun.warp_id,
     3    chipBackgroundRun.*
     4    -- the following items are selected for aid in debugging
     5    ,
     6    warpsChipRun.chip_id as warpschip_id,
     7    chipRun.chip_id AS thischip_id,
     8    warpBackgroundRun.warp_bg_id
    49FROM warpRun
    510JOIN fakeRun USING(fake_id)
    611JOIN camRun USING(cam_id)
    7 JOIN chipRun USING(chip_id)
    8 JOIN chipBackgroundRun USING(chip_id)
     12JOIN chipRun as warpsChipRun ON camRun.chip_id = warpsChipRun.chip_id
    913JOIN rawExp USING(exp_id)
    10 LEFT JOIN warpBackgroundRun USING(chip_bg_id)
     14JOIN chipRun USING(exp_id)
     15JOIN chipBackgroundRun ON chipRun.chip_id = chipBackgroundRun.chip_id
     16    AND (chipBackgroundRun.cam_id = camRun.cam_id OR chipBackgroundRun.cam_id = 0)
     17LEFT JOIN warpBackgroundRun ON chipBackgroundRun.chip_bg_id = warpBackgroundRun.warp_bg_id -- label hook %s
    1118WHERE chipBackgroundRun.state = 'full'
    12     AND warpRun.state IN ('full', 'cleaned', 'goto_cleaned') -- only need it to have been completed
     19    AND warpRun.state IN ('full', 'cleaned', 'goto_cleaned') -- need warp to have completed so warpSkyCellMap is populated
  • branches/eam_branches/ipp-20130207/ippTools/share/bgtool_tochip.sql

    r28486 r35236  
    1616    AND (Label.active OR Label.active IS NULL)
    1717-- WHERE hook %s
    18 ORDER BY priority DESC, chip_bg_id
     18ORDER BY priority DESC, chip_bg_id, class_id
  • branches/eam_branches/ipp-20130207/ippTools/share/bgtool_towarp.sql

    r34589 r35236  
    2424    AND (Label.active OR Label.active IS NULL)
    2525-- WHERE hook %s
    26 ORDER BY priority DESC, chip_bg_id
     26ORDER BY priority DESC, warp_bg_id, skycell_id
  • branches/eam_branches/ipp-20130207/ippTools/share/bgtool_warp.sql

    r28743 r35236  
    22    warpBackgroundSkyfile.*,
    33    warpBackgroundRun.state,
     4    warpBackgroundRun.warp_id,
     5    camRun.cam_id,
     6    warpBackgroundRun.chip_bg_id,
    47    warpBackgroundRun.workdir,
    58    warpBackgroundRun.label,
     9    warpRun.label as warp_label,
    610    rawExp.exp_id,
    711    rawExp.exp_name,
  • branches/eam_branches/ipp-20130207/ippTools/share/bgtool_warpinputs.sql

    r28747 r35236  
    1111JOIN chipBackgroundImfile USING(chip_bg_id, class_id)
    1212JOIN fakeRun USING(fake_id)
    13 JOIN camProcessedExp USING(cam_id)
     13JOIN camProcessedExp ON camProcessedExp.cam_id = fakeRun.cam_id
    1414WHERE warpRun.state IN ('full', 'cleaned', 'goto_cleaned') -- only need it to have been completed
    1515    AND warpSkyfile.fault = 0
  • branches/eam_branches/ipp-20130207/ippTools/share/camtool_find_pendingimfile.sql

  • branches/eam_branches/ipp-20130207/ippTools/share/chiptool_setimfiletoupdate.sql

  • branches/eam_branches/ipp-20130207/ippTools/share/difftool_definewarpstack.sql

    r24572 r35236  
    1 -- Get list of warps that can be diffed, with any associated diff,
    2 -- and the best stack to use as a template
    3 -- Warps without an existing diff can be identified by a NULL diff_id
     1-- Get list of warp-stack pairs that can be diffed
     2-- and check results against existing diffs
    43SELECT
    5     warpsToDiff.warp_id,
    6     warpsToDiff.skycell_id,
    7     warpsToDiff.tess_id,
    8     warpsToDiff.filter,
    9     warpsToDiff.good_frac,
    10     warpsToDiff.diff_id,
    11     current_stack_id,
    12     best_stack_id,
    13     exp_id
    14 FROM (
    15     -- Get list of warps that can be diffed, with any associated diff
    16     SELECT
    17         warpSkyfile.warp_id,
    18         warpSkyfile.skycell_id,
    19         warpSkyfile.tess_id,
    20         warpSkyfile.good_frac,
    21         warpRun.label,
    22         filter,
    23         warpRun.label as warp_label,
    24         diffInputs.diff_id,
    25         diffInputs.stack2 AS current_stack_id,
    26         rawExp.exp_id
    27     FROM warpSkyfile
    28     JOIN warpRun USING(warp_id)
    29     JOIN fakeRun USING(fake_id)
    30     JOIN camRun USING(cam_id)
    31     JOIN chipRun USING(chip_id)
    32     JOIN rawExp USING(exp_id)
    33     -- Check if it has an associated diff
    34     LEFT JOIN diffInputSkyfile AS diffInputs
    35         ON diffInputs.warp1 = warpSkyfile.warp_id
    36         AND diffInputs.skycell_id = warpSkyfile.skycell_id
    37         AND diffInputs.stack2 IS NOT NULL
    38     WHERE
    39         warpSkyfile.fault = 0
    40         AND warpSkyfile.quality = 0
    41     -- warpsToDiff WHERE hook %s
    42     ) AS warpsToDiff
    43 -- Get best stack as a function of skycell_id, filter
    44 JOIN (
    45     SELECT
    46         MAX(stack_id) AS best_stack_id, -- most recent stack, by virtue of auto-increment
    47         skycell_id,
    48         filter
    49     FROM stackRun
    50     JOIN stackSumSkyfile USING(stack_id)
    51     WHERE stackRun.state = 'full'
    52         AND stackSumSkyfile.fault = 0
    53         AND stackSumSkyfile.quality = 0
    54     -- stacksForDiff WHERE hook %s
    55     GROUP BY
    56         skycell_id,
    57         filter
    58     ) AS stacksForDiff USING(skycell_id, filter)
     4   exp_id,
     5   warp_id,
     6   rawExp.filter,
     7   warpRun.label AS warpLabel,
     8   warpRun.data_group AS warpDataGroup,
     9   warpRun.tess_id,
     10   warpSkyfile.skycell_id,
     11   MAX(stack_id) AS stack_id,
     12   stackRun.label AS stackLabel,
     13   stackRun.data_group AS stackDataGroup,
     14   diff_id,
     15   diffRun.label AS diffLabel
     16FROM warpRun
     17     JOIN fakeRun USING(fake_id)
     18     JOIN camRun USING(cam_id)
     19     JOIN chipRun USING(chip_id)
     20     JOIN rawExp USING(exp_id)
     21     JOIN warpSkyfile USING(warp_id)
     22     JOIN stackRun ON
     23       (stackRun.skycell_id = warpSkyfile.skycell_id AND
     24        stackRun.filter     = rawExp.filter AND
     25        stackRun.tess_id    = warpRun.tess_id)
     26     JOIN stackSumSkyfile USING(stack_id)
     27     LEFT JOIN diffInputSkyfile ON
     28       (warp_id = diffInputSkyfile.warp1 AND
     29        stack_id = diffInputSkyfile.stack2 AND
     30        diffInputSkyfile.skycell_id = stackRun.skycell_id AND
     31        diffInputSkyfile.tess_id = stackRun.tess_id)
     32     LEFT JOIN diffRun USING(diff_id)
     33WHERE
     34     warpRun.state = 'full'
     35     AND stackRun.state = 'full'
     36     AND warpSkyfile.fault = 0
     37     AND warpSkyfile.quality = 0
     38     AND stackSumSkyfile.fault = 0
     39     AND stackSumSkyfile.quality = 0
     40     AND exp_id IS NOT NULL
     41-- %s
     42GROUP BY exp_id,warp_id,skycell_id
  • branches/eam_branches/ipp-20130207/ippTools/share/pxadmin_create_tables.sql

    r35110 r35236  
    521521    deteff_uq FLOAT,
    522522    quality SMALLINT NOT NULL DEFAULT 0,
     523    background_model SMALLINT,
    523524    PRIMARY KEY(cam_id),
    524525    KEY(fault),
     
    17911792    chip_bg_id BIGINT AUTO_INCREMENT, -- unique identifier
    17921793    chip_id BIGINT NOT NULL,          -- link to chipRun
     1794    cam_id BIGINT DEFAULT 0,          -- optional link to camRun
    17931795    state VARCHAR(64) NOT NULL,       -- state of run (new, full, etc.)
    17941796    workdir VARCHAR(255) NOT NULL,    -- working directory
     
    18431845    data_group VARCHAR(64),           -- group for data
    18441846    dist_group VARCHAR(64),           -- group for distribution
    1845     reduction VARCHAR(64),    -- reduction class (for altering recipe)
     1847    reduction VARCHAR(64),            -- reduction class (for altering recipe)
    18461848    note VARCHAR(255),        -- note
    18471849    registered TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- time run was registered
     
    21222124      zpt_obs FLOAT,
    21232125      zpt_stdev FLOAT,
     2126      fwhm_major  FLOAT,
     2127      fwhm_minor  FLOAT,
    21242128      quality SMALLINT NOT NULL,
    21252129      hostname VARCHAR(64) NOT NULL,
     
    21492153
    21502154CREATE TABLE survey (
    2151     surveyID    INT(8),
     2155    surveyID    INT,
    21522156    surveyName  VARCHAR(16) NOT NULL,
    21532157    description VARCHAR(255),
    21542158    PRIMARY KEY(surveyID),
    2155     UNIQUE  KEY(name)
     2159    UNIQUE  KEY(surveyName)
    21562160) ENGINE=InnoDB CHARSET=latin1;
    21572161
    2158 
    21592162CREATE TABLE ippRelease (
    2160     rel_id      INT(8) AUTO_INCREMENT,
    2161     surveyID    INT(8),
    2162     releaseName VARCHAR(64),
    2163     relase_state VARCHAR(16),   -- active, pending, archive, drop
    2164     dataRelease INT(8),         -- PSPS dataRelease
    2165     priority    INT(8),
     2163    rel_id      INT AUTO_INCREMENT,
     2164    surveyID    INT,
     2165    release_name VARCHAR(64),
     2166    release_state VARCHAR(16),   -- active, pending, archive, drop
     2167    dataRelease INT,         -- PSPS dataRelease
     2168    priority    INT,
    21662169    PRIMARY KEY(rel_id),
    2167     KEY(releaseName),
    2168     KEY(state),
     2170    KEY(release_name),
     2171    KEY(release_state),
    21692172    KEY(priority),
    21702173    FOREIGN KEY(surveyID) REFERENCES survey(surveyID)
     
    21732176CREATE TABLE relExp (
    21742177    relexp_id   BIGINT AUTO_INCREMENT,
    2175     rel_id      INT(8),
     2178    rel_id      INT,
    21762179    exp_id      BIGINT,
    21772180    chip_id     BIGINT,         -- links to the runs that supplied the data
    21782181    cam_id      BIGINT,         -- for this release
     2182    group_id    INT,         -- id of relGroup that this exposure is contained in
    21792183    state       VARCHAR(16),    -- released, pending, archive, drop 
    2180     flags       INT UNSIGNED,   -- flags for relphot, relastro, ??
     2184    flags       INT UNSIGNED,  -- flags for relphot, relastro, ??
    21812185    zpt_obs     FLOAT,          -- calibrated zero point for this release of
    21822186    zpt_stdev   FLOAT,          -- this exposure
    21832187    path_base   VARCHAR(255),   -- path_base of any supporting files for this
    21842188                                -- release of this exposure.
     2189    fault SMALLINT NOT NULL,
    21852190    registered  DATETIME,       -- insertion time for this row
    21862191    time_stamp  DATETIME,       -- time of last update for this row
     
    21882193    FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id),
    21892194    KEY (state),
     2195    KEY (fault),
    21902196    FOREIGN KEY(exp_id) REFERENCES rawExp(exp_id),
    21912197    FOREIGN KEY(chip_id) REFERENCES chipRun(chip_id),
     
    21952201CREATE TABLE relStack (
    21962202    relstack_id BIGINT AUTO_INCREMENT,
    2197     rel_id      INT(8),
     2203    rel_id      INT,
     2204    stack_id    BIGINT,         -- id of the stackRun
    21982205    skycal_id   BIGINT,         -- id of the sky calibration run that supplied the calibration
    2199                                 -- for this release. We get back to stack from here
    2200     skycell_id  varchar(64),
    2201     tess_id     varchar(64),
     2206                                -- for this release of this skycell.
     2207    skycell_id  VARCHAR(64),
     2208    tess_id     VARCHAR(64),
     2209    filter      VARCHAR(16),
    22022210    state       VARCHAR(16),    -- released, pending, archive, drop 
    22032211    flags       INT UNSIGNED,
     
    22052213    zpt_obs     FLOAT,          -- calibrated zero point for this release of this skycell
    22062214    zpt_stdev   FLOAT,
    2207     fwhm_major  FLOAT,          -- seeing as measured by staticsky
     2215    mjd_obs     INT UNSIGNED,   -- for nightly stacks the mjd_obs, zero for deep and reference
    22082216    path_base   VARCHAR(255),   -- path_base of any supporting files,
     2217    fault SMALLINT NOT NULL,
    22092218    registered  DATETIME,
    22102219    time_stamp  DATETIME,
    22112220    PRIMARY KEY (relstack_id),
    22122221    KEY (tess_id, skycell_id),
    2213     KEY (rel_id, tess_id, skycell_id),
     2222    KEY (rel_id, tess_id, skycell_id, filter, mjd_obs),
     2223    KEY (stack_type),
     2224    KEY (mjd_obs),
     2225    KEY (state),
     2226    KEY (fault),
    22142227    FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id),
    2215     FOREIGN KEY(skycal_id) REFERENCES skycalRun(skycal_id)
     2228    FOREIGN KEY(stack_id) REFERENCES stackRun(stack_id)
     2229) ENGINE=innodb DEFAULT CHARSET=latin1;
     2230
     2231CREATE TABLE relGroup (
     2232    group_id    INT AUTO_INCREMENT,
     2233    rel_id      INT,
     2234    group_type  VARCHAR(16),
     2235    lap_id      BIGINT,
     2236    group_name  VARCHAR(16),
     2237    state       VARCHAR(16),    -- new full
     2238    label       VARCHAR(64),
     2239    exp_list_path   VARCHAR(255),
     2240    fault SMALLINT NOT NULL,
     2241    registered  DATETIME,
     2242    PRIMARY KEY (group_id),
     2243    KEY (rel_id, group_name),
     2244    KEY (group_type),
     2245    KEY (lap_id),
     2246    KEY (group_name),
     2247    KEY (state),
     2248    KEY (label),
     2249    KEY (fault),
     2250    FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id)
     2251) ENGINE=innodb DEFAULT CHARSET=latin1;
     2252
     2253CREATE TABLE lapGroup  (
     2254    seq_id  BIGINT,
     2255    projection_cell VARCHAR(64),
     2256    state   VARCHAR(16),
     2257    fault   SMALLINT,
     2258    PRIMARY KEY(seq_id, projection_cell),
     2259    KEY(state),
     2260    KEY(fault),
     2261    FOREIGN KEY(seq_id) REFERENCES lapSequence(seq_id)
    22162262) ENGINE=innodb DEFAULT CHARSET=latin1;
    22172263
  • branches/eam_branches/ipp-20130207/ippTools/share/pxadmin_drop_tables.sql

    r34913 r35236  
    109109DROP TABLE IF EXISTS skycalResult;
    110110DROP TABLE IF EXISTS skycell;
     111DROP TABLE IF EXISTS relStack;
    111112DROP TABLE IF EXISTS relExp;
     113DROP TABLE IF EXISTS relGroup;
    112114DROP TABLE IF EXISTS ippRelease;
    113115DROP TABLE IF EXISTS survey;
     116DROP TABLE IF EXISTS lapGroup;
    114117
    115118SET FOREIGN_KEY_CHECKS=1
  • branches/eam_branches/ipp-20130207/ippTools/share/releasetool_definerelexp.sql

    r34933 r35236  
    11SELECT
    22    ippRelease.rel_id,
    3     ippRelease.releaseName,
     3    ippRelease.release_name,
    44    rawExp.exp_name,
    55    rawExp.filter,
  • branches/eam_branches/ipp-20130207/ippTools/share/releasetool_listrelexp.sql

    r35048 r35236  
    22    relexp_id,
    33    relExp.state,
    4     ippRelease.releaseName,
     4    relExp.fault,
     5    ippRelease.release_name,
    56    ippRelease.release_state,
    67    ippRelease.rel_id,
     
    2122    camProcessedExp.path_base as cam_path_base,
    2223    camProcessedExp.fwhm_major,
     24    camProcessedExp.fwhm_minor,
    2325    warpRun.warp_id,
    2426    warpRun.state as warp_state,
  • branches/eam_branches/ipp-20130207/ippTools/share/warptool_scmap.sql

    r32570 r35236  
    55    camProcessedExp.path_base as cam_path_base,
    66    camProcessedExp.fault as cam_fault,
     7    camProcessedExp.background_model AS cam_background_model,
    78    chipProcessedImfile.chip_id,
    89    chipRun.state,
  • branches/eam_branches/ipp-20130207/ippTools/share/warptool_towarped.sql

Note: See TracChangeset for help on using the changeset viewer.