Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/UnixTransition/doc/jwst_time_util.html
Дата изменения: Fri Apr 8 12:46:14 2016
Дата индексирования: Mon Apr 11 03:32:05 2016
Кодировка:

Поисковые слова: легирование
Python: module jwst_time_util
 
 
jwst_time_util (version 4/2/13)
index
jwst_time_util.py

PURPOSE --
A module for dealing with JWST times and related things.
 
DEVELOPER --
Don Chance
 
MODIFICATION HISTORY --
Initial implementation 12/10/08
replace tabs with spaces for Python 3 compatibility 2/13/12 drc & ar
strip whitespace off of input strings.  drc 3/13/12
support input unicode.  drc 3/13/12
modified for Python 3.2 compatibility. ar 4/26/12
remove global setting of TZ environment variable drc 4/2/13

 
Modules
       
datetime
os
re
time
time_util

 
Classes
       
time_util.spss_time(__builtin__.object)
jwst_time
localtime

 
class jwst_time(time_util.spss_time)
    A class for dealing with times in JWST PPS.
 
 
Method resolution order:
jwst_time
time_util.spss_time
__builtin__.object

Methods defined here:
__add__(self, other)
Operator overloading for addition.
 
Returns -- When an jwst_time and a delta, int, or float
are added, an jwst_time object will be returned.
__float__(self)
Seconds since Jan 1, 1970 returned
as a float.
__init__(self, t=None)
The jwst_time constructor.
 
Arguments:
 
t -- If a number, it is assumed to be seconds since 1970.  If
a string, it is assumed to be a character time in one of the
approved formats.  The default will set the time to the current
system time.
 
NOTE: In a departure from the way spss_time handles floats and ints,
jwst_time interprets these numbers as seconds since the 1/1/1970, not as
SOGS seconds (seconds since 1/1/1980).
 
Raises -- TypeError - Raised when the input is something
other than an int, float, string, or another jwst_time.
__int__(self)
Seconds since Jan 1, 1970 returned
as an int.
__repr__(self)
The string representation of an jwst_time.
 
Returns --  The JWST character time
will be printed.
__sub__(self, other)
Operator overloading for subtraction.
 
Returns -- A delta_time when two jwst_times are subtracted.
Subtracting a float, int, or delta_time from a jwst_time
returns an jwst_time.
get_localtime(self)

Static methods defined here:
dtdict_to_syssec(dict)
parse_string(stime)
Parse a string containing a time.

Data and other attributes defined here:
DD_PATTERN1 = <_sre.SRE_Pattern object>
DOY_PATTERN = <_sre.SRE_Pattern object at 0xfa860>
LONG_YEAR_PATTERN = <_sre.SRE_Pattern object>
SEC_PATTERN1 = <_sre.SRE_Pattern object>
SEC_PATTERN3 = <_sre.SRE_Pattern object>
SHORT_YEAR_PATTERN = <_sre.SRE_Pattern object>
TZ_PATTERN = <_sre.SRE_Pattern object>
TZ_PATTERN2 = <_sre.SRE_Pattern object>
UTC_PATTERN = <_sre.SRE_Pattern object>
calendar_format = u'%Y-%m-%dT%H:%M:%SZ'
ordinal_format = u'%Y-%jT%H:%M:%SZ'

Methods inherited from time_util.spss_time:
__eq__(self, other)
Operator overloading for ==
 
SOGS times may be compared with the '==' operator.
__ge__(self, other)
Operator overloading for >=
 
SOGS times may be compared with the '>=' operator.
__gt__(self, other)
Operator overloading for >
 
SOGS times may be compared with the '>' operator.
__iadd__(self, other)
Operator overloading for +=.
__le__(self, other)
Operator overloading for <=
 
SOGS times may be compared with the '<=' operator.
__lt__(self, other)
Operator overloading for <
 
SOGS times may be compared with the '<' operator.
__ne__(self, other)
Operator overloading for !=
 
SOGS times may be compared with the '!=' operator.
__radd__(self, other)
Operator overloading for addition.
 
Returns -- When an spss_time and a delta, int, or float
are added, an spss_time object will be returned.
get_julian_day(self)
Returns the time in Julian Day format.
get_pass_time(self)
Returns the time of the spss_time object expressed in PASS time format.
get_sms_time(self)
Returns the time of the spss_time object expressed in SMS time format.
get_sogs_character_time(self)
Returns the time of the spss_time object expressed as a SOGS character time.
get_sogsseconds(self)
Returns the time of the spss_time object expressed in SOGS seconds.
get_system_seconds(self)
Returns the time of the spss_time object expressed in system seconds
(seconds since Jan. 1, 1970).
get_weekid(self)
Finds the previous Monday.
 
Returns a weekid object constructed from that time.
set_julian_day(self, jd)
Sets the spss_time object to the entered Julian Day.
set_sogs_character_time(self, sct)
Sets spss_time object to 'sct'.
 
Input parameter is expressed in SOGS character time format.
set_sogsseconds(self, ss)
Sets the spss_time to 'ss' SOGS seconds.
 
Arguments:
 
ss -- must be in SOGS seconds. Sets spss_time object to that
number of SOGS seconds.
 
Raises -- TypeError - Raised when the input parameter is
something other than an int, float, or string.
set_system_seconds(self, ss)
Sets the spss_time to 'ss' system seconds.
 
Arguments:
 
ss -- must be seconds since Jan. 1, 1970. Sets spss_time object to that
number of system seconds.
 
Raises -- TypeError - Raised when the input parameter is
something other than an int, float, or string.
strftime(self, format)
Returns the spss_time in format 'format'.  Possible formats include:
 
o %a - abbreviated weekday name
o %A - full name of the weekday
o %b - abbreviated month name
o %B - full month name
o %d - day of the month (1-31)
o %H - hour of the day (0-23); 24-hour clock basis
o %I - hour of the day (1-12); 12-hour clock basis
o %j - day of the year (1-366)
o %m - month of the year (1-12)
o %M - minute (0-59)
o %S - seconds (0-59)
o %U - week number of the year (0-53) with Sunday as the first day of the week
o %w - weekday (Sunday=0,...,Saturday=6)
o %W - week number of the year (0-53) with Monday as the first day of the week
o %y - two-digit year representation (00-99)
o %Y - year with century (for example, 1998)
 
See 'time.strftime' for more possible formats.
strptime(self, time_string, format)
Parse a string representing a time and set the spss_time object to that time.
 
Returns the spss_time object.
 
Formats are the same as in strftime.
to_datetime(self)
Return a datetime object corresponding to this spss_time.

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

Data and other attributes inherited from time_util.spss_time:
MAX_SYSSEC = 1830383999
pass_format = '%YY%jD%HH%MM%SS'
sct_format = '%Y.%j:%H:%M:%S'
sms_format = '%yY%jD%HH%MM%SS'

 
class localtime(jwst_time)
    
Method resolution order:
localtime
jwst_time
time_util.spss_time
__builtin__.object

Methods defined here:
__init__(self, t=None, timezone=None)
__repr__(self)
get_timezone(self)
get_tz_offset(self)
get_tz_offset_str(self)
set_timezone(self, tz)
strftime(self, format)

Methods inherited from jwst_time:
__add__(self, other)
Operator overloading for addition.
 
Returns -- When an jwst_time and a delta, int, or float
are added, an jwst_time object will be returned.
__float__(self)
Seconds since Jan 1, 1970 returned
as a float.
__int__(self)
Seconds since Jan 1, 1970 returned
as an int.
__sub__(self, other)
Operator overloading for subtraction.
 
Returns -- A delta_time when two jwst_times are subtracted.
Subtracting a float, int, or delta_time from a jwst_time
returns an jwst_time.
get_localtime(self)

Static methods inherited from jwst_time:
dtdict_to_syssec(dict)
parse_string(stime)
Parse a string containing a time.

Data and other attributes inherited from jwst_time:
DD_PATTERN1 = <_sre.SRE_Pattern object>
DOY_PATTERN = <_sre.SRE_Pattern object at 0xfa860>
LONG_YEAR_PATTERN = <_sre.SRE_Pattern object>
SEC_PATTERN1 = <_sre.SRE_Pattern object>
SEC_PATTERN3 = <_sre.SRE_Pattern object>
SHORT_YEAR_PATTERN = <_sre.SRE_Pattern object>
TZ_PATTERN = <_sre.SRE_Pattern object>
TZ_PATTERN2 = <_sre.SRE_Pattern object>
UTC_PATTERN = <_sre.SRE_Pattern object>
calendar_format = u'%Y-%m-%dT%H:%M:%SZ'
ordinal_format = u'%Y-%jT%H:%M:%SZ'

Methods inherited from time_util.spss_time:
__eq__(self, other)
Operator overloading for ==
 
SOGS times may be compared with the '==' operator.
__ge__(self, other)
Operator overloading for >=
 
SOGS times may be compared with the '>=' operator.
__gt__(self, other)
Operator overloading for >
 
SOGS times may be compared with the '>' operator.
__iadd__(self, other)
Operator overloading for +=.
__le__(self, other)
Operator overloading for <=
 
SOGS times may be compared with the '<=' operator.
__lt__(self, other)
Operator overloading for <
 
SOGS times may be compared with the '<' operator.
__ne__(self, other)
Operator overloading for !=
 
SOGS times may be compared with the '!=' operator.
__radd__(self, other)
Operator overloading for addition.
 
Returns -- When an spss_time and a delta, int, or float
are added, an spss_time object will be returned.
get_julian_day(self)
Returns the time in Julian Day format.
get_pass_time(self)
Returns the time of the spss_time object expressed in PASS time format.
get_sms_time(self)
Returns the time of the spss_time object expressed in SMS time format.
get_sogs_character_time(self)
Returns the time of the spss_time object expressed as a SOGS character time.
get_sogsseconds(self)
Returns the time of the spss_time object expressed in SOGS seconds.
get_system_seconds(self)
Returns the time of the spss_time object expressed in system seconds
(seconds since Jan. 1, 1970).
get_weekid(self)
Finds the previous Monday.
 
Returns a weekid object constructed from that time.
set_julian_day(self, jd)
Sets the spss_time object to the entered Julian Day.
set_sogs_character_time(self, sct)
Sets spss_time object to 'sct'.
 
Input parameter is expressed in SOGS character time format.
set_sogsseconds(self, ss)
Sets the spss_time to 'ss' SOGS seconds.
 
Arguments:
 
ss -- must be in SOGS seconds. Sets spss_time object to that
number of SOGS seconds.
 
Raises -- TypeError - Raised when the input parameter is
something other than an int, float, or string.
set_system_seconds(self, ss)
Sets the spss_time to 'ss' system seconds.
 
Arguments:
 
ss -- must be seconds since Jan. 1, 1970. Sets spss_time object to that
number of system seconds.
 
Raises -- TypeError - Raised when the input parameter is
something other than an int, float, or string.
strptime(self, time_string, format)
Parse a string representing a time and set the spss_time object to that time.
 
Returns the spss_time object.
 
Formats are the same as in strftime.
to_datetime(self)
Return a datetime object corresponding to this spss_time.

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

Data and other attributes inherited from time_util.spss_time:
MAX_SYSSEC = 1830383999
pass_format = '%YY%jD%HH%MM%SS'
sct_format = '%Y.%j:%H:%M:%S'
sms_format = '%yY%jD%HH%MM%SS'

 
Functions
       
tz_set(tz=u'UTC')
Manipulate the timezone without affecting with other things outside of this
module.
tz_unset()
Put the TZ environment variable back the way it was.

 
Data
        HAS_MX = False
MONTHS = [u'jan', u'feb', u'mar', u'apr', u'may', u'jun', u'jul', u'aug', u'sep', u'oct', u'nov', u'dec']
__version__ = u'4/2/13'
absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)
old_tz = None
print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
unicode_literals = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 131072)