Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/UnixTransition/doc/visit_util.html
Дата изменения: Fri Apr 8 12:46:15 2016
Дата индексирования: Mon Apr 11 00:39:54 2016
Кодировка:
Python: module visit_util
 
 
visit_util (version 16.03.15)
index
visit_util.py

PURPOSE --
A module for dealing with Visits and lists of Visits
 
DEVELOPER --
Bill Workman
 
MODIFICATION HISTORY --
Date        Who            What
====        ===            ====
08-07-02    Workman        Initial implementaion.
06-22-04    Chance         Cleaned up & refactored
01-06-05    Chance         fix get('proposal')
03-08-05    Chance         make suitability string persistant
03-21-05    Chance         correct for Sybase datetime type
04-18-05    Chance         Include get_special_req_map and get_config_map
                           from the available report.
05-04-05    Chance         Improve speed of get_config_map
05-13-05    Bower          include apply_usc, format, populatefromdb,
                           and visit_catalog in visit_util.
                           Replace calls to sudata with get.
05-18-05    Bower          Revise apply_usc to support -exclude_usc
                           option
05-19-05    Chance         Cleaned up
05-20-05    Chance         added get_visits_by_cycle function
05-23-05    Chance         fix bug in get_special_req_map
05-25-05    Bower          add verbose option to parsecommandline
                           and populatefromdb
06-06-05    Chance         added get_failure_cause function
07-07-05    Chance         make get_config_map and other code more
                           robust
07-25-05    Chance         add scenario name as a paramter for constraint scenarios
10-27-05    Chance         enhance get_visits function
10-31-05    Chance         enhance get function to work for ra, dec
11-10-05    Chance         add snap_visit.visit_priority code.
11-14-05    Chance         fix plan orient bug
12-13-05    Chance         add exclude_executed flag in get_visits_by_cycle
03-20-06    Chance         fix get_visits_by_cycle query
06-14-06    Chance         fix get_pw_span
06-30-06    Chance         fix bug in get_suitability_string
07-18-06    Chance         create get_by_cycle function
04-30-07    Chance         put STIS back into config map
02-11-08    Chance         include new SIs and modes from visit_derived_data
02-25-08    Chance         fix log of 0 bug
05-20-08    Chance         add new config_map function
07-27-08    Chance         change config_map default
08-06-08    Bower          Add option to search for parallels only
08-14-08    Chance         Fix get_suitablity_string when scenario is given
09-17-08    Bower          Updates for new SI's after SM4
11-12-08    Chance         enhance get_by_cycle to accept a list of cycles
06-17-09    Chance         Add more special requirement codes
07-13-09    Chance         Change PERIOD AND ZERO PHASE special requirement code
09-15-09    Chance         Change the config_map_key
04-16-12    Chance         Update for dark earth (D) target type
05-02-12    Chance         Add method for getting scheduled end time
05-24-12    Chance         Fix get_special_req_map
08-16-13    Chance         Update for metrics SQR conversion
09-23-13    Chance         Add get_wistat_sunit function
09-26-13    Chance         Use special_req_util.special_req_factory function
04-21-14    Chance         Add parallel marker to primes
07-09-14    Jordan         Add new special req codes for spatial scans
09-24-14    Chance         add function to determine if visit contains COS MIRRORB
11-03-14    Chance         fix bug in get_pw_span
11-17-14    Chance         Move get_wistat_sunit to su_util.su
11-09-15    Chance         Code cleanup.
02-29-16    Chance         updated for new way of storing USC data
03-15-16    Chance         restore parsecommandline

 
Modules
       
constraint_window
copy
exceptions
lrp_util
math
os
par_set_util
plan_window_util
proposal_util
special_req_util
spss_sys_util
stpydb
su_util
target_util
time_util

 
Classes
       
exceptions.Exception(exceptions.BaseException)
ResultsError
su_util.su(__builtin__.dict)
visit
metrics_visit
su_util.su_list(__builtin__.object)
visit_list
instrument_usage

 
class ResultsError(exceptions.Exception)
    
Method resolution order:
ResultsError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class instrument_usage
    A class to hold instrument usage data.
 
  Methods defined here:
__init__(self, iu=None)
Constructor for an instrument_usage.
__repr__(self)
The string representation of an instrument_usage object is the formatted available syntax
get(self, field)
Gets the value of field.
 
Will retrieve it from the PMDB if needed.
rptfmt(self)
textfmt(self)

Data and other attributes defined here:
relation = {'acs_hrc': 'visit_derived_data', 'acs_sbc': 'visit_derived_data', 'acs_wfc': 'visit_derived_data', 'cos_fuv': 'visit_derived_data', 'cos_nuv': 'visit_derived_data', 'fgs': 'visit_derived_data', 'foc': 'visit_derived_data', 'nic1': 'visit_derived_data', 'nic2': 'visit_derived_data', 'nic3': 'visit_derived_data', ...}

 
class metrics_visit(visit)
    For data contained in the hst_metrics database.
 
 
Method resolution order:
metrics_visit
visit
su_util.su
__builtin__.dict
__builtin__.object

Methods defined here:
get(self, field, failobj=None)
Gets the value of field.
Will retrieve it from the PMDB if needed.

Static methods defined here:
__new__(cls, data={})

Data and other attributes defined here:
METRICS_DB = 'hst_metrics'
conversion = {'activation_req_date': <class 'time_util.spss_time'>, 'approval_status': None, 'dd_status_date': <class 'time_util.spss_time'>, 'phaseone_id': None, 'submission_date': <class 'time_util.spss_time'>, 'too_status_date': <class 'time_util.spss_time'>}
conversion_imports = ['time_util']
relation = {'activation_req_date': 'too_track', 'approval_status': 'too_track', 'dd_status_date': 'dd_track', 'phaseone_id': 'dd_track', 'submission_date': 'dd_track', 'too_status_date': 'too_track'}

Methods inherited from visit:
__contains__(self, item)
__init__(self, data={})
Constructor for a visit object.
 
If the input parameter is not a string, dictionary, or list, a
TypeError will be raised.
__repr__(self)
The string representation of a visit object is the sunit_id
delete_constraint_windows(self)
get_all_target_types(self)
Return a concatenation of all the different internal and external target types
for the exposures within this visit.
 
Target types:
(E)arth, (D)ark Earth, (M)oon, (I)nternal, orbit-(P)ole, (A)nti-sun, (B)ackground pointing,
(F)ixed, (G)eneric or (S)olar system.
get_config_map(self, Format='full')
Return a configuration mapping.  See available.py for details.
get_config_map_key(self, Format='full')
Return the header string for a particular config map format.
get_constraint_windows(self, scenario_name=None)
get_exposure_special_requirements(self)
Returns a list of exposure special requirements.
get_failure_cause(self, lrp)
Return failure_cause from lrp_schedulables.
get_instrument_usage(self)
get_lrps(self)
Return a list of the LRP this visit is in.
get_numexp_with_datavolume(self)
Returns the number of exposures in the visit that contribute to the max_data_vol
for the visit.
get_plan_orient(self, lrp)
Return a planOrient object containing the plan orient for the
given LRP.
get_plan_window_history(self)
get_plan_windows(self, lrp)
Return a planWindow object containing all the plan windows for the
given LRP.
get_primary_target_type(self)
Take all the target types returned from get_all_target_types and reduce it to
the single most important target type based on the following ranking (from most
important to least): S, F, G, M, A, P, D, E, I, B.
get_pw_count(self, lrp)
Return the number of plan windows for this SU in a given lrp.
get_pw_span(self, lrp)
Return a window object with the begin time as the earliest plan window begin and
the end time as the latest plan window end.
get_pw_status(self, lrp)
Return the status from plan_window_status for this visit and the
input LRP.
get_sched_end(self, baseline='GLOBAL')
Retrieve the scheduled end time from the global baseline.
get_sched_start(self, baseline='GLOBAL')
Retrieve the scheduled start time from the baseline.
get_sched_times(self, baseline='GLOBAL')
Retrieve the scheduled start and end times from the baseline.
get_special_req_map(self)
Produce the special requirement map.  See available report for mapping details.
get_special_requirements(self)
get_suitability_string(self, ttime=None, scenario_name=None)
Produce the suitability string used in the available report.
 
Requirements from Ian:
1.  The fields in the cw table should start out being populated with '-'
to represent no constraint windows.
 
2.  If an SAA-free constraint window intersects the interval, re-populate
the field with a '.'.
 
3.  If a PSA coded constraint window intersects the interval, re-populate
the field with a 'p'.
 
4.  If an SAA coded constraint window intersects the interval, re-populate
the field with an 'S'.
 
5.  If a PAC coded constraint window intersects the interval, re-populate
the field with an 'x' unless it already contans and 'S'--in which case
re-populate with an 'X' instead.
 
6.  If an SAC coded constraint window intersects the interval, re-populate
the field with an 'X'.
 
7.  If a CVZ coded constraint window intersects the interval, re-populate
the field with an 'X' if it is populated with 'S', 'x' if it is populated
with 'p', and 'C' if populated by '.' or '-'.
get_targets(self, data=None)
Query ASSIST to determine the targets contained in the visit.
Returns target list object; returns a null list if no records
were found in the database.
get_visit_special_requirements(self)
Returns a list of visit special requirements.
has_field(self, field)
Check the object for the existence of 'field' in its internal dictionary.
 
Returns TRUE if it is there, FALSE otherwise.
has_key(self, field)
is_coronographic(self)
Return TRUE if this SU has exposures using coronographic
apertures.
is_cos_mirrorb(self)
Returns True if this visit contains a COS MIRROR B exposure.
 
Otherwise, returns False.
is_earthflat(self)
Check to see if this visit is an earthflat.
 
Returns TRUE or FALSE
is_parallel(self)
Return TRUE if this SU has the PAR special requirement.
Return False otherwise.
is_prime(self)
Check to see if this is a prime visit.
 
Returns TRUE or FALSE
other_after_by(self)
Return a list of special_req objects from another SU which points to this SU
with AFTER BY or an empty list if there is no such SU.
other_orient_from(self)
Return a list of special_req objects from another SU which points to this SU
with ORIENT FROM or an empty list if there is no such SU.
set(self, field, value)
Set a 'field' to 'value'.
 
'Field' is set to 'value' only in the object.  This function does not affect
the PMDB.

Methods inherited from su_util.su:
__cmp__(self, other)
Compare two SUs.
 
If 'other' is a string, assume it is an SU id, otherwise 'other'
must be an su object. 'Self' and 'other' are compared using the string
value for their sunit_id.  If the two SUs have the sunit_id, then the
version numbers are compared. Raises a TypeError if something other
than string or su object is passed in.
__eq__(self, other)
__ne__(self, other)
get_configs(self)
Return a list of all the different configs used in this SU.
get_error(self)
get_non_parallel_configs(self)
Return a list of all the configs used in non-parallel exposures
in this SU.
get_obsets(self)
Query QSBRANCHING to determine the obsets contained in the SU.
Returns list of obset objects; returns a null list if no records
were found in the database.
get_orient_linkset(self)
Return the linkset id if this SU is in a orient linkset or None if it is not.
get_parallel_configs(self)
Return a list of all the configs used in parallel exposures
in this SU.
get_qelogsheet_data(self)
Retrieve info from QELOGSHEET relation for all exposures in SU.
Returns a list of exposure objects sorted by obset sequence number
(if exposure is in a multi-obset SU), obset id, exposure number
in the logsheet, then exposure ID.
get_timing_linkset(self)
Return the linkset id if this SU is in a timing linkset or None if it is not.
get_trans_date(self)
Retrieve the Transformation date of the SU as populated in a
comment field in the QSUCOMMENTS relation.
get_usc_windows(self)
Returns a dictionary where the keys are the window types
from assist..usc_name and the values are window_lists.
get_verified_constraint_windows(self)
Returns a list of dictionaries, each dictionary containing the data from
one record of constraint_windows_ver for this SU.
get_wistat_sunit(self, baseline='GLOBAL')
Retrieve the data from wistat_sunit from the baseline.
in_executing_linkset(self)
in_executing_orient_linkset(self)
Returns TRUE if this is SU is part of an executing orient linkset.
in_executing_timing_linkset(self)
Returns TRUE if this is SU is part of an executing timing linkset.
intersect_usc_windows(self)
Performs an intersection on all the window lists in the usc_windows dictionary.
Returns a single window list.
is_baselined(self)
Determines if SU is on global baseline according to the database.
Returns 0 (false) or 1 (true).
set_error(self, message)
Simple mutator method to set error attribute.
set_priority(self, priority)
Set the current scheduling units priority.
 
Returns the rowcount.  This should be 1 if the set priority
worked, 0 if it did not.
 
Priority must be an integer between 1 and 100.
update(self, start_t=None, end_t=None, verbose=True)
Execute a pmdb/update for this su.
Returns the status flag from the pmdb -update.
vis_fit_estimate(self, vis_size=22)
Determine how friendly this SU is to orbits with limited visibility.
vis_size is given in minutes.
 
Returns the number of estimated orbits that will fit in orbits of size
'vis_size'.

Static methods inherited from su_util.su:
__get_sunit__(data)

Data descriptors inherited from su_util.su:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from su_util.su:
valid_10_char_su_re = r'^\s([0-9,A-Z]{7,7}):([0-9,A-Z]{2,2})\s$'
valid_7_char_su_re = r'^\s([0-9,A-Z]{7,7})\s$'
valid_vn_re = r'^\s([0-9,A-Z]{2,2})\s$'

Methods inherited from __builtin__.dict:
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
__sizeof__(...)
D.__sizeof__() -> size of D in memory, in bytes
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
fromkeys(...)
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
values(...)
D.values() -> list of D's values
viewitems(...)
D.viewitems() -> a set-like object providing a view on D's items
viewkeys(...)
D.viewkeys() -> a set-like object providing a view on D's keys
viewvalues(...)
D.viewvalues() -> an object providing a view on D's values

Data and other attributes inherited from __builtin__.dict:
__hash__ = None

 
class visit(su_util.su)
    A class for visits derived from the su class.
 
 
Method resolution order:
visit
su_util.su
__builtin__.dict
__builtin__.object

Methods defined here:
__contains__(self, item)
__init__(self, data={})
Constructor for a visit object.
 
If the input parameter is not a string, dictionary, or list, a
TypeError will be raised.
__repr__(self)
The string representation of a visit object is the sunit_id
delete_constraint_windows(self)
get(self, field, failobj=None)
Gets the value of field.
Will retrieve it from the PMDB if needed.
get_all_target_types(self)
Return a concatenation of all the different internal and external target types
for the exposures within this visit.
 
Target types:
(E)arth, (D)ark Earth, (M)oon, (I)nternal, orbit-(P)ole, (A)nti-sun, (B)ackground pointing,
(F)ixed, (G)eneric or (S)olar system.
get_config_map(self, Format='full')
Return a configuration mapping.  See available.py for details.
get_config_map_key(self, Format='full')
Return the header string for a particular config map format.
get_constraint_windows(self, scenario_name=None)
get_exposure_special_requirements(self)
Returns a list of exposure special requirements.
get_failure_cause(self, lrp)
Return failure_cause from lrp_schedulables.
get_instrument_usage(self)
get_lrps(self)
Return a list of the LRP this visit is in.
get_numexp_with_datavolume(self)
Returns the number of exposures in the visit that contribute to the max_data_vol
for the visit.
get_plan_orient(self, lrp)
Return a planOrient object containing the plan orient for the
given LRP.
get_plan_window_history(self)
get_plan_windows(self, lrp)
Return a planWindow object containing all the plan windows for the
given LRP.
get_primary_target_type(self)
Take all the target types returned from get_all_target_types and reduce it to
the single most important target type based on the following ranking (from most
important to least): S, F, G, M, A, P, D, E, I, B.
get_pw_count(self, lrp)
Return the number of plan windows for this SU in a given lrp.
get_pw_span(self, lrp)
Return a window object with the begin time as the earliest plan window begin and
the end time as the latest plan window end.
get_pw_status(self, lrp)
Return the status from plan_window_status for this visit and the
input LRP.
get_sched_end(self, baseline='GLOBAL')
Retrieve the scheduled end time from the global baseline.
get_sched_start(self, baseline='GLOBAL')
Retrieve the scheduled start time from the baseline.
get_sched_times(self, baseline='GLOBAL')
Retrieve the scheduled start and end times from the baseline.
get_special_req_map(self)
Produce the special requirement map.  See available report for mapping details.
get_special_requirements(self)
get_suitability_string(self, ttime=None, scenario_name=None)
Produce the suitability string used in the available report.
 
Requirements from Ian:
1.  The fields in the cw table should start out being populated with '-'
to represent no constraint windows.
 
2.  If an SAA-free constraint window intersects the interval, re-populate
the field with a '.'.
 
3.  If a PSA coded constraint window intersects the interval, re-populate
the field with a 'p'.
 
4.  If an SAA coded constraint window intersects the interval, re-populate
the field with an 'S'.
 
5.  If a PAC coded constraint window intersects the interval, re-populate
the field with an 'x' unless it already contans and 'S'--in which case
re-populate with an 'X' instead.
 
6.  If an SAC coded constraint window intersects the interval, re-populate
the field with an 'X'.
 
7.  If a CVZ coded constraint window intersects the interval, re-populate
the field with an 'X' if it is populated with 'S', 'x' if it is populated
with 'p', and 'C' if populated by '.' or '-'.
get_targets(self, data=None)
Query ASSIST to determine the targets contained in the visit.
Returns target list object; returns a null list if no records
were found in the database.
get_visit_special_requirements(self)
Returns a list of visit special requirements.
has_field(self, field)
Check the object for the existence of 'field' in its internal dictionary.
 
Returns TRUE if it is there, FALSE otherwise.
has_key(self, field)
is_coronographic(self)
Return TRUE if this SU has exposures using coronographic
apertures.
is_cos_mirrorb(self)
Returns True if this visit contains a COS MIRROR B exposure.
 
Otherwise, returns False.
is_earthflat(self)
Check to see if this visit is an earthflat.
 
Returns TRUE or FALSE
is_parallel(self)
Return TRUE if this SU has the PAR special requirement.
Return False otherwise.
is_prime(self)
Check to see if this is a prime visit.
 
Returns TRUE or FALSE
other_after_by(self)
Return a list of special_req objects from another SU which points to this SU
with AFTER BY or an empty list if there is no such SU.
other_orient_from(self)
Return a list of special_req objects from another SU which points to this SU
with ORIENT FROM or an empty list if there is no such SU.
set(self, field, value)
Set a 'field' to 'value'.
 
'Field' is set to 'value' only in the object.  This function does not affect
the PMDB.

Static methods defined here:
__new__(cls, data={})

Data and other attributes defined here:
conversion = {'active_flag': None, 'beg_tim': <class 'time_util.spss_time'>, 'end_tim': <class 'time_util.spss_time'>, 'est_orbits': <type 'int'>, 'external_su': None, 'first_sci': <class 'time_util.spss_time'>, 'flight_ready_date': <function <lambda>>, 'internal_su': None, 'lrp_state': None, 'priority': None, ...}
conversion_imports = ['time_util', 'string']
relation = {'active_flag': 'su_track', 'est_orbits': 'su_track', 'external_su': 'su_track', 'flight_ready_date': 'su_track', 'internal_su': 'su_track', 'lrp_state': 'su_track', 'prop_id': 'su_track', 'schedulability_time': 'su_track', 'spss_prep_done': 'su_track', 'status': 'su_track', ...}

Methods inherited from su_util.su:
__cmp__(self, other)
Compare two SUs.
 
If 'other' is a string, assume it is an SU id, otherwise 'other'
must be an su object. 'Self' and 'other' are compared using the string
value for their sunit_id.  If the two SUs have the sunit_id, then the
version numbers are compared. Raises a TypeError if something other
than string or su object is passed in.
__eq__(self, other)
__ne__(self, other)
get_configs(self)
Return a list of all the different configs used in this SU.
get_error(self)
get_non_parallel_configs(self)
Return a list of all the configs used in non-parallel exposures
in this SU.
get_obsets(self)
Query QSBRANCHING to determine the obsets contained in the SU.
Returns list of obset objects; returns a null list if no records
were found in the database.
get_orient_linkset(self)
Return the linkset id if this SU is in a orient linkset or None if it is not.
get_parallel_configs(self)
Return a list of all the configs used in parallel exposures
in this SU.
get_qelogsheet_data(self)
Retrieve info from QELOGSHEET relation for all exposures in SU.
Returns a list of exposure objects sorted by obset sequence number
(if exposure is in a multi-obset SU), obset id, exposure number
in the logsheet, then exposure ID.
get_timing_linkset(self)
Return the linkset id if this SU is in a timing linkset or None if it is not.
get_trans_date(self)
Retrieve the Transformation date of the SU as populated in a
comment field in the QSUCOMMENTS relation.
get_usc_windows(self)
Returns a dictionary where the keys are the window types
from assist..usc_name and the values are window_lists.
get_verified_constraint_windows(self)
Returns a list of dictionaries, each dictionary containing the data from
one record of constraint_windows_ver for this SU.
get_wistat_sunit(self, baseline='GLOBAL')
Retrieve the data from wistat_sunit from the baseline.
in_executing_linkset(self)
in_executing_orient_linkset(self)
Returns TRUE if this is SU is part of an executing orient linkset.
in_executing_timing_linkset(self)
Returns TRUE if this is SU is part of an executing timing linkset.
intersect_usc_windows(self)
Performs an intersection on all the window lists in the usc_windows dictionary.
Returns a single window list.
is_baselined(self)
Determines if SU is on global baseline according to the database.
Returns 0 (false) or 1 (true).
set_error(self, message)
Simple mutator method to set error attribute.
set_priority(self, priority)
Set the current scheduling units priority.
 
Returns the rowcount.  This should be 1 if the set priority
worked, 0 if it did not.
 
Priority must be an integer between 1 and 100.
update(self, start_t=None, end_t=None, verbose=True)
Execute a pmdb/update for this su.
Returns the status flag from the pmdb -update.
vis_fit_estimate(self, vis_size=22)
Determine how friendly this SU is to orbits with limited visibility.
vis_size is given in minutes.
 
Returns the number of estimated orbits that will fit in orbits of size
'vis_size'.

Static methods inherited from su_util.su:
__get_sunit__(data)

Data descriptors inherited from su_util.su:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from su_util.su:
valid_10_char_su_re = r'^\s([0-9,A-Z]{7,7}):([0-9,A-Z]{2,2})\s$'
valid_7_char_su_re = r'^\s([0-9,A-Z]{7,7})\s$'
valid_vn_re = r'^\s([0-9,A-Z]{2,2})\s$'

Methods inherited from __builtin__.dict:
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
__sizeof__(...)
D.__sizeof__() -> size of D in memory, in bytes
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
fromkeys(...)
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
values(...)
D.values() -> list of D's values
viewitems(...)
D.viewitems() -> a set-like object providing a view on D's items
viewkeys(...)
D.viewkeys() -> a set-like object providing a view on D's keys
viewvalues(...)
D.viewvalues() -> an object providing a view on D's values

Data and other attributes inherited from __builtin__.dict:
__hash__ = None

 
class visit_list(su_util.su_list)
    A class to hold a list of visits; it inherits from the su_list class
 
 
Method resolution order:
visit_list
su_util.su_list
__builtin__.object

Methods defined here:
__init__(self, visitlist=None)
Constructor for a visit_list object.
 
If the input parameter is not a string, dictionary, or list, a
TypeError will be raised.
 
The constructor requires a list of visit objects or a
string containing a file name.  The file should contain
a list of sunit_id's, one sunit_id per line.  If 'visitlist' contains
something other than list or a file name as a string,
an TypeError will be raised.
 
Note: the visit_list object uses the input list of visit
objects in place, it does not copy them.
append(self, v=None)
Appends another visit or visit_list onto the current visit_list.
 
Raises -- TypeError - Raised if the input is something other than
a target_list or target.
apply_usc(self, usc_name, usc_windows, usc_value=1.0, usc_mode='combine', usc_comment='No comment provided.', **usc_keyword_args)
delete_cws(self, visits)
Deletes constraint windows from the DB fo input visit list
format(self, formats=[])
Return this visit list as a string formatted in various ways.
get(self, field)
Populates all visit objects in the list with the value of 'field' from DB if not already in the object.
 
Returns the value of 'field'.
get_visit(self, visit)
Returns the visit object for the 'visit' from the list.
 
Given a visit, go through the visit_list until the visit object
matching that visit is found.  Return that visit object.  If
no matching visit object is found, None is returned.
search(self, param, value_pattern)
Search the list of visits for visits where the value of 'param' matches 'value_pattern'.
 
'Value_pattern' should be a regular expresion.  'search' is case-insensitive.
Returns su_list object containing all the matching visits.
set(self, field, value)
Set a 'field' to 'value'.
 
'Field' is set to 'value' only in the object.  This function does not affect
the PMDB.

Methods inherited from su_util.su_list:
__add__(self, other)
Add an this su_list to another su_list or su.
 
Returns a new su_list.
 
Raises a TypeError if the input is not an su_list or su.
__getitem__(self, offset)
__getslice__(self, low, high)
__len__(self)
__radd__(self, other)
Add an this su_list to another su_list or su.
 
Returns a new su_list.
__repr__(self)
create_sunit_id_file(self, filename)
Create a file with the sunit_ids from the su_list.
 
For use with commands like 'cclist -create' which can take as
input a file with a list  of sus.
equals(self, other)
Checks if 'self' and 'other' are the same.
 
Returns true if 'self' and 'other' contain all the same sus and
only the same sus. Otherwise, returns false.
get_sunit(self, sunit_id)
Returns the su object with 'sunit_id' from the list.
 
Given an sunit_id, go through the su_list until the su object
matching that sunit_id is found.  Return that su object.  If
no matching SU object is found, None is returned.
index(self, su)
Return the smallest i where sulist[i] == su.
prop_id_string(self)
Returns a string with the prop_ids formatted for an IN clause in an ISQL query.
reverse(self)
Reverse the list of SUs.
set_priority(self, priority)
Set the priority for all the SUs in the su_list.
 
Returns a tuple.  The first value in the tuple is the number
of SUs successfully processed, the second, the number of
SUs not processed.
sort(self, cmpfunc=None, key=None, reverse=False)
Sort the list of sus.
 
If 'cmpfunc' and 'key' defaulted, sort the SUs based on their sunit id.
Otherwise use the passed in 'cmpfunc' and 'key' to compare them.
sunit_id_string(self)
Returns a string with the sunit_ids formatted for an IN clause in an ISQL query.
update(self, start_t=None, end_t=None, verbose=True)
runs su update for each su in list.

Data descriptors inherited from su_util.su_list:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
get_available_windows(ttime=None, scenario_name=None)
Return a list of 13 windows for the available 'suitability' string calculation.
get_by_cycle(cycle, returned_entities='visit', cp_types=('GO%', 'GTO%', 'CAL%', 'ENG%'), pt_status=('pi', 'implementation', 'scheduling'), excluded_lrps=())
Returns either a visit_list or list of propsoals (depending on what returned_entities
is set to) for a given cycle or list of cycles. Parameter returned_entities must be either
'visit' or 'proposal'.
 
Allowed values for pt_status are the allowed values of database field prop_track.status,
ie., 'pi', 'implementation', 'scheduling', 'withdrawn', 'failed', 'completed', 'n/a'.
Input value should be a tuple or a list.  Defaults to ('pi', 'implementation', 'scheduling'.
 
Parameter excluded_lrps should be a list or a tuple of LRP names.  Proposals (or visits belonging
to proposals) in those LRPs will be excluded from the returned list.
get_config_map_key(format='old')
get_visits_by_cycle(cycle, cp_types=('GO%', 'GTO%', 'CAL%', 'ENG%'), pt_status=('pi', 'implementation', 'scheduling'), excluded_lrps=())
Return a visit_list of visits for a given cycle.
 
Allowed values for prop_type are snap, nosnap, and all.
parse_si_modes(queryOptions)
parsecommandline(*args)
Generic function for parsing commandline arguments and options
populatefromdb(queryOptions, verbose=None)
set_visit_query(queryOptions='', sulist=[])
which_db(field)
Given a field, determine which database its relation is in.

 
Data
        PT_STATUS = ('pi', 'implementation', 'scheduling', 'withdrawn', 'failed', 'completed', 'n/a')
SPEC_REQ_CODES = {'AFTER': 'A', 'AFTER BY': '+', 'BEFORE': '<', 'BETWEEN': 'B', 'CVZ': 'C', 'GROUP WITHIN': 'G', 'LOW-SKY': 'K', 'ON HOLD': 'H', 'ON HOLD FOR': 'h', 'ORIENT': 'O', ...}
__version__ = '16.03.15'
assist_db = 'assist'