Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/ops/isql_examples
Дата изменения: Tue Mar 6 00:10:22 2001
Дата индексирования: Fri Feb 28 16:32:28 2014
Кодировка:

Поисковые слова: http www.stsci.edu science goods
EXAMPLE 1: SETTING SI STATES AND SPECIAL COMMANDING
===================================================

Phase 2
-------
Visit 1 Exposure 1 Comments:
WFPC2 Start State = HOLD, End State = PROTECT. CCDHEAT on. Special
Instruction = E8491PROT.

Visit 2 Exposure 1 Comments:
WFPC2 Start State = DECON, End State = CCDHEAT. AFMs on, Heatpipe Htrs
off, CCD Htrs off, Mech on, F785LP still in. Special Instruction =
E8491DWN.

Visit 3 Exposure 1 Comments:
WFPC2 Start State = CCDHEAT, End State = STANDBY. TECs on. Special
Instruction = RUCHTSB.


PMDB Before ISQL
----------------
1> select proposal_id, obset_id, alignment_id, si_id, detector,
start_state, end_state from qasi_states where proposal_id = "08491"
and obset_id in ("01", "02", "03", "52")
2> go
proposal_id obset_id alignment_id si_id detector start_state end_state
----------- -------- ------------ ----- -------- ----------- ---------
08491 52 01 WFII OPER OPER
08491 52 02 WFII OPER OPER

(5 rows affected)

1> select proposal_id, obset_id, alignment_id, exposure_id, instr_name
from qgactinst where proposal_id = "08491" and obset_id in ("01",
"02", "03")
2> go
proposal_id obset_id alignment_id exposure_id instr_name
----------- -------- ------------ ----------- ------------
08491 01 01 01 CMAIN
08491 02 01 01 CMAIN
08491 03 01 01 CMAIN

(3 rows affected)


ISQL File
---------
/* This ISQL file will:
- Set SI states as they need to be for program 8491.

- Attach special commanding for program 8491.


Date Who What
---- --- ----
6-22-99 Roman File written.

6-23-99 Roman DARKOPER qasi_states added.

7-30-99 Roman Updated for renumbered visits/obsets.

8-3-99 Roman Added more detail to where clauses for DARKOPER
states.

*/

/* Start transaction.
*/
begin transaction
go

/* Add SI state records to alignments that need them, but don't
already have them.
*/
insert into qasi_states (proposal_id, obset_id, alignment_id, version_num, si_id, start_state, end_state)
values ("08491", "01", "01", "01", "WFII", "HOLD", "PROTECT")
go
insert into qasi_states (proposal_id, obset_id, alignment_id, version_num, si_id, start_state, end_state)
values ("08491", "02", "01", "01", "WFII", "DECON", "CCDHEAT")
go
insert into qasi_states (proposal_id, obset_id, alignment_id, version_num, si_id, start_state, end_state)
values ("08491", "03", "01", "01", "WFII", "CCDHEAT", "STANDBY")
go

/* Change the SI states of alignments where necessary.
*/
update qasi_states
set start_state = "DARKOPER",
end_state = "DARKOPER"
where proposal_id = "08491"
and obset_id = "52"
and alignment_id = "02"
and version_num = "01"
and si_id = "WFII"
and detector = ""
and start_state = "OPER"
and end_state = "OPER"
go

/* Attach special commanding.
*/
update qgactinst
set instr_name = "E8491PROT"
where proposal_id = "08491"
and obset_id = "01"
and alignment_id = "01"
and exposure_id = "01"
and version_num = "01"
go
update qgactinst
set instr_name = "E8491DWN"
where proposal_id = "08491"
and obset_id = "02"
and alignment_id = "01"
and exposure_id = "01"
and version_num = "01"
go
update qgactinst
set instr_name = "RUCHTSB"
where proposal_id = "08491"
and obset_id = "03"
and alignment_id = "01"
and exposure_id = "01"
and version_num = "01"
go

/* End transaction.
*/
commit transaction
go


Results
-------
1> select proposal_id, obset_id, alignment_id, si_id, detector,
start_state, end_state from qasi_states where proposal_id = "08491"
and obset_id in ("01", "02", "03", "52")
2> go
proposal_id obset_id alignment_id si_id detector start_state end_state
----------- -------- ------------ ----- -------- ----------- ---------
08491 01 01 WFII HOLD PROTECT
08491 02 01 WFII DECON CCDHEAT
08491 03 01 WFII CCDHEAT STANDBY
08491 52 01 WFII OPER OPER
08491 52 02 WFII DARKOPER DARKOPER

(5 rows affected)

1> select proposal_id, obset_id, alignment_id, exposure_id, instr_name
from qgactinst where proposal_id = "08491" and obset_id in ("01",
"02", "03")
2> go
proposal_id obset_id alignment_id exposure_id instr_name
----------- -------- ------------ ----------- ------------
08491 01 01 01 E8491PROT
08491 02 01 01 E8491DWN
08491 03 01 01 RUCHTSB

(3 rows affected)



EXAMPLE 2: FHST UPDATES
=======================

Phase 2
-------
Program 8518 Visit 2 Comments:
Disable full FHST updates for this visit. Schedule after either visit
01 or visit 04 by 0H to 12H.


PMDB Before ISQL
----------------
1> select proposal_id, obset_id, fhstfull, acq_co_ovr from qbs_obset
where proposal_id = "08518" and obset_id = "02"
2> go
proposal_id obset_id fhstfull acq_co_ovr
----------- -------- -------- ----------
08518 02 D N


ISQL File
---------
/* This ISQL file will:
- Disable full FHST updates for visit 2 of program 8518.


Date Who What
---- --- ----
8-11-99 Roman File written.
1-Sep-1999 Reinhart Added acq_co_ovr field.

*/

/* Start transaction.
*/
begin transaction
go

update qbs_obset
set fhstfull = "N",
acq_co_ovr = "Y"
where proposal_id = "08518"
and obset_id = "02"
and version_num = "01"
go


/* End transaction.
*/
commit transaction
go


Results
-------
1> select proposal_id, obset_id, fhstfull, acq_co_ovr from qbs_obset
where proposal_id = "08518" and obset_id = "02"
2> go
proposal_id obset_id fhstfull acq_co_ovr
----------- -------- -------- ----------
08518 02 N Y



EXAMPLE 3: GUIDE STAR SELECTION AND ACQUISITION OVERRIDE RECORDS
================================================================

Phase 2
-------
Program 8525 Visit 1 Exposure 1 Comments:
Use Guide stars 0187701306F30187701116F2; lock for 5m BACKUP GSs
0187700898F30187700494F2

Program 8525 Visit 2 Exposure 1 Comments:
Use Guide stars 0187700570F20186400809F3; lock for 5m BACKUP GSs
0187701526F20187700010F3


PMDB Before ISQL
----------------
1> select proposal_id, obset_id, use_fgs_1, use_fgs_2, f2_min_gs_mag,
comment from qbacqs where proposal_id = "08525" and obset_id in ("01",
"02")
2> go
proposal_id obset_id use_fgs_1 use_fgs_2 f2_min_gs_mag comment
----------- -------- --------- --------- ------------- -------

(0 rows affected)

1> select proposal_id, obset_id, override_rec_id from qbs_obset where
proposal_id = "08525" and obset_id in ("01", "02")
2> go
proposal_id obset_id override_rec_id
----------- -------- ---------------
08525 01 0
08525 02 0


ISQL File
---------
/* This ISQL file will:
- Create qbacqs override records for the guide star requests
in program 8525.

- Update qbs_obset.override_rec_id so that the override
records will be used by guide star request.


Date Who What
---- --- ----
8-4-99 Roman File written.

8-11-99 Roman Updated for splitting of two visits into four
visits.

*/

/* Start transaction.
*/
begin transaction
go

/* Create qbacqs override records.
*/
insert into qbacqs (proposal_id, obset_id, version_num, scenario_acq, rec_id)
values ("08525", "01", "01", "BASE1", 1)
go
insert into qbacqs (proposal_id, obset_id, version_num, scenario_acq, rec_id)
values ("08525", "02", "01", "BASE1", 1)
go


/* Update values in the newly created qbacqs override records.
*/
update qbacqs
set acq_mode = d_acq_mode,
use_fgs_1 = "N",
use_fgs_2 = "Y",
use_fgs_3 = d_use_fgs_3,
num_fgs = d_num_fgs,
select_flag = d_sel_flag,
pre_use_flag = d_pre_use,
min_gs_pair = d_min_gs_pr,
max_gs_pair = d_max_gs_pr,
max_spoiler = d_max_spoil,
min_s_spl_pr = d_mn_s_spl_p,
min_d_spl_pr = d_mn_d_spl_p,
min_s_spl_sc = d_mn_s_spl_s,
f1_min_gs_mag = d_f1_min_gs_mag,
f2_min_gs_mag = 14.000000,
f3_min_gs_mag = d_f3_min_gs_mag,
min_gs_sep = d_min_gs_sep,
min_roll_rng = d_min_roll,
min_usbl_wnd = d_min_usbl,
p_sea_rad = d_p_sea_rad,
s_sea_rad = d_s_sea_rad,
st_att_unc = d_st_att_unc,
rr_opt = d_rr_opt,
rr_lvl = d_rr_lvl,
rr_ff = d_rr_ff,
over_nr_off = d_over_nr_off,
over_nr_limit = d_over_nr_limit,
max_time_pts = d_max_time_pts,
comment = "Turn FGS2 on at 14.0 minimum magnitude. Turn FGS1 off."
from qbacqs, qbacqd_def
where proposal_id = "08525"
and obset_id in ("01", "02")
and version_num = "01"
and scenario_acq = "BASE1"
and d_scenar_acq = "BASE1"
and rec_id = 1


/* Update qbs_obset.override_rec_id so that the override records will
be used by guide star request.
*/
update qbs_obset
set override_rec_id = 1
where proposal_id = "08525"
and obset_id in ("01", "02")
and version_num = "01"
go

/* End transaction.
*/
commit transaction
go


Results
-------
1> select proposal_id, obset_id, use_fgs_1, use_fgs_2, f2_min_gs_mag,
comment from qbacqs where proposal_id = "08525" and obset_id in ("01",
"02")
2> go
proposal_id obset_id use_fgs_1 use_fgs_2 f2_min_gs_mag comment
----------- -------- --------- --------- ------------- -------
08525 01 N Y 14.000000 Turn FGS2 on at 14.0 minimum magnitude. Turn FGS1
off.
08525 02 N Y 14.000000 Turn FGS2 on at 14.0 minimum magnitude. Turn FGS1
off.

(2 rows affected)

1> select proposal_id, obset_id, override_rec_id from qbs_obset where
proposal_id = "08525" and obset_id in ("01", "02")
2> go
proposal_id obset_id override_rec_id
----------- -------- ---------------
08525 01 1
08525 02 1

(2 rows affected)