body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
@property
def observer(self):
'\n The coordinates of the observer.\n\n If set, and a target is set as well, this will override any explicit\n radial velocity passed in.\n\n Returns\n -------\n `~astropy.coordinates.BaseCoordinateFrame`\n The astropy coordinate fr... | -2,235,384,996,682,472,000 | The coordinates of the observer.
If set, and a target is set as well, this will override any explicit
radial velocity passed in.
Returns
-------
`~astropy.coordinates.BaseCoordinateFrame`
The astropy coordinate frame representing the observation. | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | observer | honeybhardwaj/Language_Identification | python | @property
def observer(self):
'\n The coordinates of the observer.\n\n If set, and a target is set as well, this will override any explicit\n radial velocity passed in.\n\n Returns\n -------\n `~astropy.coordinates.BaseCoordinateFrame`\n The astropy coordinate fr... |
@property
def target(self):
'\n The coordinates of the target being observed.\n\n If set, and an observer is set as well, this will override any explicit\n radial velocity passed in.\n\n Returns\n -------\n `~astropy.coordinates.BaseCoordinateFrame`\n The astropy... | -5,736,557,129,610,842,000 | The coordinates of the target being observed.
If set, and an observer is set as well, this will override any explicit
radial velocity passed in.
Returns
-------
`~astropy.coordinates.BaseCoordinateFrame`
The astropy coordinate frame representing the target. | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | target | honeybhardwaj/Language_Identification | python | @property
def target(self):
'\n The coordinates of the target being observed.\n\n If set, and an observer is set as well, this will override any explicit\n radial velocity passed in.\n\n Returns\n -------\n `~astropy.coordinates.BaseCoordinateFrame`\n The astropy... |
@property
def radial_velocity(self):
'\n Radial velocity of target relative to the observer.\n\n Returns\n -------\n `~astropy.units.Quantity`\n Radial velocity of target.\n\n Notes\n -----\n This is different from the ``.radial_velocity`` property of a\n ... | 1,471,006,984,708,161,500 | Radial velocity of target relative to the observer.
Returns
-------
`~astropy.units.Quantity`
Radial velocity of target.
Notes
-----
This is different from the ``.radial_velocity`` property of a
coordinate frame in that this calculates the radial velocity with
respect to the *observer*, not the origin of the fram... | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | radial_velocity | honeybhardwaj/Language_Identification | python | @property
def radial_velocity(self):
'\n Radial velocity of target relative to the observer.\n\n Returns\n -------\n `~astropy.units.Quantity`\n Radial velocity of target.\n\n Notes\n -----\n This is different from the ``.radial_velocity`` property of a\n ... |
@property
def redshift(self):
'\n Redshift of target relative to observer. Calculated from the radial\n velocity.\n\n Returns\n -------\n float\n Redshift of target.\n '
return _velocity_to_redshift(self.radial_velocity) | -1,663,626,652,174,325,200 | Redshift of target relative to observer. Calculated from the radial
velocity.
Returns
-------
float
Redshift of target. | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | redshift | honeybhardwaj/Language_Identification | python | @property
def redshift(self):
'\n Redshift of target relative to observer. Calculated from the radial\n velocity.\n\n Returns\n -------\n float\n Redshift of target.\n '
return _velocity_to_redshift(self.radial_velocity) |
@staticmethod
def _calculate_radial_velocity(observer, target, as_scalar=False):
'\n Compute the line-of-sight velocity from the observer to the target.\n\n Parameters\n ----------\n observer : `~astropy.coordinates.BaseCoordinateFrame`\n The frame of the observer.\n ta... | 988,378,101,657,718,800 | Compute the line-of-sight velocity from the observer to the target.
Parameters
----------
observer : `~astropy.coordinates.BaseCoordinateFrame`
The frame of the observer.
target : `~astropy.coordinates.BaseCoordinateFrame`
The frame of the target.
as_scalar : bool
If `True`, the magnitude of the velocity v... | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | _calculate_radial_velocity | honeybhardwaj/Language_Identification | python | @staticmethod
def _calculate_radial_velocity(observer, target, as_scalar=False):
'\n Compute the line-of-sight velocity from the observer to the target.\n\n Parameters\n ----------\n observer : `~astropy.coordinates.BaseCoordinateFrame`\n The frame of the observer.\n ta... |
@staticmethod
def _normalized_position_vector(observer, target):
'\n Calculate the normalized position vector between two frames.\n\n Parameters\n ----------\n observer : `~astropy.coordinates.BaseCoordinateFrame` or `~astropy.coordinates.SkyCoord`\n The observation frame or c... | 8,450,039,182,530,405,000 | Calculate the normalized position vector between two frames.
Parameters
----------
observer : `~astropy.coordinates.BaseCoordinateFrame` or `~astropy.coordinates.SkyCoord`
The observation frame or coordinate.
target : `~astropy.coordinates.BaseCoordinateFrame` or `~astropy.coordinates.SkyCoord`
The target fram... | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | _normalized_position_vector | honeybhardwaj/Language_Identification | python | @staticmethod
def _normalized_position_vector(observer, target):
'\n Calculate the normalized position vector between two frames.\n\n Parameters\n ----------\n observer : `~astropy.coordinates.BaseCoordinateFrame` or `~astropy.coordinates.SkyCoord`\n The observation frame or c... |
@u.quantity_input(velocity=(u.km / u.s))
def with_observer_stationary_relative_to(self, frame, velocity=None, preserve_observer_frame=False):
"\n A new `SpectralCoord` with the velocity of the observer altered,\n but not the position.\n\n If a coordinate frame is specified, the observer veloci... | 4,901,878,164,844,446,000 | A new `SpectralCoord` with the velocity of the observer altered,
but not the position.
If a coordinate frame is specified, the observer velocities will be
modified to be stationary in the specified frame. If a coordinate
instance is specified, optionally with non-zero velocities, the
observer velocities will be updat... | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | with_observer_stationary_relative_to | honeybhardwaj/Language_Identification | python | @u.quantity_input(velocity=(u.km / u.s))
def with_observer_stationary_relative_to(self, frame, velocity=None, preserve_observer_frame=False):
"\n A new `SpectralCoord` with the velocity of the observer altered,\n but not the position.\n\n If a coordinate frame is specified, the observer veloci... |
def with_radial_velocity_shift(self, target_shift=None, observer_shift=None):
"\n Apply a velocity shift to this spectral coordinate.\n\n The shift can be provided as a redshift (float value) or radial\n velocity (`~astropy.units.Quantity` with physical type of 'speed').\n\n Parameters\n... | -3,032,038,574,636,160,000 | Apply a velocity shift to this spectral coordinate.
The shift can be provided as a redshift (float value) or radial
velocity (`~astropy.units.Quantity` with physical type of 'speed').
Parameters
----------
target_shift : float or `~astropy.units.Quantity`
Shift value to apply to current target.
observer_shift : f... | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | with_radial_velocity_shift | honeybhardwaj/Language_Identification | python | def with_radial_velocity_shift(self, target_shift=None, observer_shift=None):
"\n Apply a velocity shift to this spectral coordinate.\n\n The shift can be provided as a redshift (float value) or radial\n velocity (`~astropy.units.Quantity` with physical type of 'speed').\n\n Parameters\n... |
def to_rest(self):
'\n Transforms the spectral axis to the rest frame.\n '
if ((self.observer is not None) and (self.target is not None)):
return self.with_observer_stationary_relative_to(self.target)
result = _apply_relativistic_doppler_shift(self, (- self.radial_velocity))
return... | -384,347,302,439,089,100 | Transforms the spectral axis to the rest frame. | LI/lib/python3.8/site-packages/astropy/coordinates/spectral_coordinate.py | to_rest | honeybhardwaj/Language_Identification | python | def to_rest(self):
'\n \n '
if ((self.observer is not None) and (self.target is not None)):
return self.with_observer_stationary_relative_to(self.target)
result = _apply_relativistic_doppler_shift(self, (- self.radial_velocity))
return self.replicate(value=result, radial_velocity=(... |
def searchInsert(self, nums, target):
'\n :type nums: List[int]\n :type target: int\n :rtype: int\n '
if ((nums is None) or (len(nums) == 0)):
return 0
for i in range(0, len(nums)):
if (nums[i] == target):
return i
elif (nums[i] < target):
... | 1,615,753,001,070,173,400 | :type nums: List[int]
:type target: int
:rtype: int | Python/SearchInsertPosition.py | searchInsert | TonnyL/Windary | python | def searchInsert(self, nums, target):
'\n :type nums: List[int]\n :type target: int\n :rtype: int\n '
if ((nums is None) or (len(nums) == 0)):
return 0
for i in range(0, len(nums)):
if (nums[i] == target):
return i
elif (nums[i] < target):
... |
def download_library():
'Download and install the CDF library'
if (sys.platform != 'win32'):
raise NotImplementedError('CDF library install only supported on Windows')
try:
import html.parser as HTMLParser
except ImportError:
import HTMLParser
class LinkParser(HTMLParser.HTM... | -6,954,307,582,105,150,000 | Download and install the CDF library | pycdf/__init__.py | download_library | cpiker/condaCDF | python | def download_library():
if (sys.platform != 'win32'):
raise NotImplementedError('CDF library install only supported on Windows')
try:
import html.parser as HTMLParser
except ImportError:
import HTMLParser
class LinkParser(HTMLParser.HTMLParser, object):
def __init_... |
def _compress(obj, comptype=None, param=None):
'Set or check the compression of a :py:class:`pycdf.CDF` or :py:class:`pycdf.Var`\n\n @param obj: object on which to set or check compression\n @type obj: :py:class:`pycdf.CDF` or :py:class:`pycdf.Var`\n @param comptype: type of compression to change to, see C... | 2,903,751,509,734,036,000 | Set or check the compression of a :py:class:`pycdf.CDF` or :py:class:`pycdf.Var`
@param obj: object on which to set or check compression
@type obj: :py:class:`pycdf.CDF` or :py:class:`pycdf.Var`
@param comptype: type of compression to change to, see CDF C reference
manual section 4.10. Constants for t... | pycdf/__init__.py | _compress | cpiker/condaCDF | python | def _compress(obj, comptype=None, param=None):
'Set or check the compression of a :py:class:`pycdf.CDF` or :py:class:`pycdf.Var`\n\n @param obj: object on which to set or check compression\n @type obj: :py:class:`pycdf.CDF` or :py:class:`pycdf.Var`\n @param comptype: type of compression to change to, see C... |
def __init__(self, libpath=None, library=None):
"Load the CDF C library.\n\n Searches for the library in the order:\n 1. Appropriately-named file in CDF_LIB\n 2. Appropriately-named file in CDF_BASE\n 3. Standard library search path\n @raise CDFError: BAD_DATA_TYPE if ... | 4,657,589,305,218,685,000 | Load the CDF C library.
Searches for the library in the order:
1. Appropriately-named file in CDF_LIB
2. Appropriately-named file in CDF_BASE
3. Standard library search path
@raise CDFError: BAD_DATA_TYPE if can't map types properly | pycdf/__init__.py | __init__ | cpiker/condaCDF | python | def __init__(self, libpath=None, library=None):
"Load the CDF C library.\n\n Searches for the library in the order:\n 1. Appropriately-named file in CDF_LIB\n 2. Appropriately-named file in CDF_BASE\n 3. Standard library search path\n @raise CDFError: BAD_DATA_TYPE if ... |
@staticmethod
def _find_lib():
'\n Search for the CDF library\n\n Searches in likely locations for CDF libraries and attempts to load\n them. Stops at first successful load and, if fails, reports all\n the files that were tried as libraries.\n\n Returns\n =======\n o... | -8,930,959,412,059,058,000 | Search for the CDF library
Searches in likely locations for CDF libraries and attempts to load
them. Stops at first successful load and, if fails, reports all
the files that were tried as libraries.
Returns
=======
out : tuple
This is either (path to library, loaded library)
or, in the event of failure, (No... | pycdf/__init__.py | _find_lib | cpiker/condaCDF | python | @staticmethod
def _find_lib():
'\n Search for the CDF library\n\n Searches in likely locations for CDF libraries and attempts to load\n them. Stops at first successful load and, if fails, reports all\n the files that were tried as libraries.\n\n Returns\n =======\n o... |
@staticmethod
def _lib_paths():
'Find candidate paths for the CDF library\n\n Does not check that the library is actually in any particular directory,\n just returns a list of possible locations, in priority order.\n\n Returns\n =======\n out : generator of str\n paths ... | -1,022,284,542,166,911,400 | Find candidate paths for the CDF library
Does not check that the library is actually in any particular directory,
just returns a list of possible locations, in priority order.
Returns
=======
out : generator of str
paths that look like the CDF library | pycdf/__init__.py | _lib_paths | cpiker/condaCDF | python | @staticmethod
def _lib_paths():
'Find candidate paths for the CDF library\n\n Does not check that the library is actually in any particular directory,\n just returns a list of possible locations, in priority order.\n\n Returns\n =======\n out : generator of str\n paths ... |
def check_status(self, status, ignore=()):
'\n Raise exception or warning based on return status of CDF call\n\n Parameters\n ==========\n status : int\n status returned by the C library\n\n Other Parameters\n ================\n ignore : sequence of ctypes... | 6,336,779,443,411,467,000 | Raise exception or warning based on return status of CDF call
Parameters
==========
status : int
status returned by the C library
Other Parameters
================
ignore : sequence of ctypes.c_long
CDF statuses to ignore. If any of these is returned by CDF library,
any related warnings or exceptions will... | pycdf/__init__.py | check_status | cpiker/condaCDF | python | def check_status(self, status, ignore=()):
'\n Raise exception or warning based on return status of CDF call\n\n Parameters\n ==========\n status : int\n status returned by the C library\n\n Other Parameters\n ================\n ignore : sequence of ctypes... |
def call(self, *args, **kwargs):
"\n Call the CDF internal interface\n\n Passes all parameters directly through to the CDFlib routine of the\n CDF library's C internal interface. Checks the return value with\n :meth:`check_status`.\n\n Terminal NULL is automatically added to args.... | 1,458,759,059,557,401,000 | Call the CDF internal interface
Passes all parameters directly through to the CDFlib routine of the
CDF library's C internal interface. Checks the return value with
:meth:`check_status`.
Terminal NULL is automatically added to args.
Parameters
==========
args : various, see :mod:`ctypes`
Passed directly to the C... | pycdf/__init__.py | call | cpiker/condaCDF | python | def call(self, *args, **kwargs):
"\n Call the CDF internal interface\n\n Passes all parameters directly through to the CDFlib routine of the\n CDF library's C internal interface. Checks the return value with\n :meth:`check_status`.\n\n Terminal NULL is automatically added to args.... |
def set_backward(self, backward=True):
'\n Set backward compatibility mode for new CDFs\n\n Unless backward compatible mode is set, CDF files created by\n the version 3 library can not be read by V2.\n\n Parameters\n ==========\n backward : boolean\n Set backward... | 6,009,374,051,950,584,000 | Set backward compatibility mode for new CDFs
Unless backward compatible mode is set, CDF files created by
the version 3 library can not be read by V2.
Parameters
==========
backward : boolean
Set backward compatible mode if True; clear it if False.
Raises
======
ValueError : if backward=False and underlying CDF ... | pycdf/__init__.py | set_backward | cpiker/condaCDF | python | def set_backward(self, backward=True):
'\n Set backward compatibility mode for new CDFs\n\n Unless backward compatible mode is set, CDF files created by\n the version 3 library can not be read by V2.\n\n Parameters\n ==========\n backward : boolean\n Set backward... |
def epoch_to_datetime(self, epoch):
'\n Converts a CDF epoch value to a datetime\n\n Parameters\n ==========\n epoch : float\n epoch value from CDF\n\n Returns\n =======\n out : :class:`datetime.datetime`\n date and time corresponding to epoch. ... | -4,194,116,941,151,881,700 | Converts a CDF epoch value to a datetime
Parameters
==========
epoch : float
epoch value from CDF
Returns
=======
out : :class:`datetime.datetime`
date and time corresponding to epoch. Invalid values are set to
usual epoch invalid value, i.e. last moment of year 9999.
See Also
========
v_epoch_to_datetim... | pycdf/__init__.py | epoch_to_datetime | cpiker/condaCDF | python | def epoch_to_datetime(self, epoch):
'\n Converts a CDF epoch value to a datetime\n\n Parameters\n ==========\n epoch : float\n epoch value from CDF\n\n Returns\n =======\n out : :class:`datetime.datetime`\n date and time corresponding to epoch. ... |
def datetime_to_epoch(self, dt):
'\n Converts a Python datetime to a CDF Epoch value\n\n Parameters\n ==========\n dt : :class:`datetime.datetime`\n date and time to convert\n\n Returns\n =======\n out : float\n epoch corresponding to dt\n\n ... | 7,494,655,386,455,670,000 | Converts a Python datetime to a CDF Epoch value
Parameters
==========
dt : :class:`datetime.datetime`
date and time to convert
Returns
=======
out : float
epoch corresponding to dt
See Also
========
v_datetime_to_epoch | pycdf/__init__.py | datetime_to_epoch | cpiker/condaCDF | python | def datetime_to_epoch(self, dt):
'\n Converts a Python datetime to a CDF Epoch value\n\n Parameters\n ==========\n dt : :class:`datetime.datetime`\n date and time to convert\n\n Returns\n =======\n out : float\n epoch corresponding to dt\n\n ... |
def epoch16_to_datetime(self, epoch0, epoch1):
'\n Converts a CDF epoch16 value to a datetime\n\n .. note::\n The call signature has changed since SpacePy 0.1.2. Formerly\n this method took a single argument with two values; now it\n requires two arguments (one for eac... | 916,899,503,809,279,500 | Converts a CDF epoch16 value to a datetime
.. note::
The call signature has changed since SpacePy 0.1.2. Formerly
this method took a single argument with two values; now it
requires two arguments (one for each value). To convert existing
code, replace ``epoch16_to_datetime(epoch)`` with
``epoch16_t... | pycdf/__init__.py | epoch16_to_datetime | cpiker/condaCDF | python | def epoch16_to_datetime(self, epoch0, epoch1):
'\n Converts a CDF epoch16 value to a datetime\n\n .. note::\n The call signature has changed since SpacePy 0.1.2. Formerly\n this method took a single argument with two values; now it\n requires two arguments (one for eac... |
def datetime_to_epoch16(self, dt):
'\n Converts a Python datetime to a CDF Epoch16 value\n\n Parameters\n ==========\n dt : :class:`datetime.datetime`\n date and time to convert\n\n Returns\n =======\n out : list of float\n epoch16 correspondin... | -7,864,392,969,522,198,000 | Converts a Python datetime to a CDF Epoch16 value
Parameters
==========
dt : :class:`datetime.datetime`
date and time to convert
Returns
=======
out : list of float
epoch16 corresponding to dt
See Also
========
v_datetime_to_epoch16 | pycdf/__init__.py | datetime_to_epoch16 | cpiker/condaCDF | python | def datetime_to_epoch16(self, dt):
'\n Converts a Python datetime to a CDF Epoch16 value\n\n Parameters\n ==========\n dt : :class:`datetime.datetime`\n date and time to convert\n\n Returns\n =======\n out : list of float\n epoch16 correspondin... |
def epoch_to_epoch16(self, epoch):
'\n Converts a CDF EPOCH to a CDF EPOCH16 value\n\n Parameters\n ==========\n epoch : double\n EPOCH to convert. Lists and numpy arrays are acceptable.\n\n Returns\n =======\n out : (double, double)\n EPOCH16 c... | 8,412,332,055,089,482,000 | Converts a CDF EPOCH to a CDF EPOCH16 value
Parameters
==========
epoch : double
EPOCH to convert. Lists and numpy arrays are acceptable.
Returns
=======
out : (double, double)
EPOCH16 corresponding to epoch | pycdf/__init__.py | epoch_to_epoch16 | cpiker/condaCDF | python | def epoch_to_epoch16(self, epoch):
'\n Converts a CDF EPOCH to a CDF EPOCH16 value\n\n Parameters\n ==========\n epoch : double\n EPOCH to convert. Lists and numpy arrays are acceptable.\n\n Returns\n =======\n out : (double, double)\n EPOCH16 c... |
def epoch_to_num(self, epoch):
'\n Convert CDF EPOCH to matplotlib number.\n\n Same output as :func:`~matplotlib.dates.date2num` and useful for\n plotting large data sets without converting the times through datetime.\n\n Parameters\n ==========\n epoch : double\n ... | -281,976,541,988,294,500 | Convert CDF EPOCH to matplotlib number.
Same output as :func:`~matplotlib.dates.date2num` and useful for
plotting large data sets without converting the times through datetime.
Parameters
==========
epoch : double
EPOCH to convert. Lists and numpy arrays are acceptable.
Returns
=======
out : double
Floating ... | pycdf/__init__.py | epoch_to_num | cpiker/condaCDF | python | def epoch_to_num(self, epoch):
'\n Convert CDF EPOCH to matplotlib number.\n\n Same output as :func:`~matplotlib.dates.date2num` and useful for\n plotting large data sets without converting the times through datetime.\n\n Parameters\n ==========\n epoch : double\n ... |
def epoch16_to_epoch(self, epoch16):
'\n Converts a CDF EPOCH16 to a CDF EPOCH value\n\n Parameters\n ==========\n epoch16 : (double, double)\n EPOCH16 to convert. Lists and numpy arrays are acceptable.\n LAST dimension should be 2: the two pairs of EPOCH16\n\n ... | 1,951,505,701,562,002,700 | Converts a CDF EPOCH16 to a CDF EPOCH value
Parameters
==========
epoch16 : (double, double)
EPOCH16 to convert. Lists and numpy arrays are acceptable.
LAST dimension should be 2: the two pairs of EPOCH16
Returns
=======
out : double
EPOCH corresponding to epoch16 | pycdf/__init__.py | epoch16_to_epoch | cpiker/condaCDF | python | def epoch16_to_epoch(self, epoch16):
'\n Converts a CDF EPOCH16 to a CDF EPOCH value\n\n Parameters\n ==========\n epoch16 : (double, double)\n EPOCH16 to convert. Lists and numpy arrays are acceptable.\n LAST dimension should be 2: the two pairs of EPOCH16\n\n ... |
def tt2000_to_datetime(self, tt2000):
"\n Converts a CDF TT2000 value to a datetime\n\n .. note::\n Although TT2000 values support leapseconds, Python's datetime\n object does not. Any times after 23:59:59.999999 will\n be truncated to 23:59:59.999999.\n\n\n Par... | 923,339,050,099,816,700 | Converts a CDF TT2000 value to a datetime
.. note::
Although TT2000 values support leapseconds, Python's datetime
object does not. Any times after 23:59:59.999999 will
be truncated to 23:59:59.999999.
Parameters
==========
tt2000 : int
TT2000 value from CDF
Raises
======
EpochError : if input invali... | pycdf/__init__.py | tt2000_to_datetime | cpiker/condaCDF | python | def tt2000_to_datetime(self, tt2000):
"\n Converts a CDF TT2000 value to a datetime\n\n .. note::\n Although TT2000 values support leapseconds, Python's datetime\n object does not. Any times after 23:59:59.999999 will\n be truncated to 23:59:59.999999.\n\n\n Par... |
def datetime_to_tt2000(self, dt):
'\n Converts a Python datetime to a CDF TT2000 value\n\n Parameters\n ==========\n dt : :class:`datetime.datetime`\n date and time to convert\n\n Returns\n =======\n out : int\n tt2000 corresponding to dt\n\n ... | -3,065,209,170,280,399,400 | Converts a Python datetime to a CDF TT2000 value
Parameters
==========
dt : :class:`datetime.datetime`
date and time to convert
Returns
=======
out : int
tt2000 corresponding to dt
See Also
========
v_datetime_to_tt2000 | pycdf/__init__.py | datetime_to_tt2000 | cpiker/condaCDF | python | def datetime_to_tt2000(self, dt):
'\n Converts a Python datetime to a CDF TT2000 value\n\n Parameters\n ==========\n dt : :class:`datetime.datetime`\n date and time to convert\n\n Returns\n =======\n out : int\n tt2000 corresponding to dt\n\n ... |
def _datetime_to_tt2000_typepunned(self, dt):
'\n Converts a Python datetime to a CDF TT2000 value\n\n Typepunned version that passes doubles as longlongs, to get around\n ARM calling convention oddness.\n\n Parameters\n ==========\n dt : :class:`datetime.datetime`\n ... | -4,813,442,311,137,848,000 | Converts a Python datetime to a CDF TT2000 value
Typepunned version that passes doubles as longlongs, to get around
ARM calling convention oddness.
Parameters
==========
dt : :class:`datetime.datetime`
date and time to convert
Returns
=======
out : int
tt2000 corresponding to dt
See Also
========
v_datetim... | pycdf/__init__.py | _datetime_to_tt2000_typepunned | cpiker/condaCDF | python | def _datetime_to_tt2000_typepunned(self, dt):
'\n Converts a Python datetime to a CDF TT2000 value\n\n Typepunned version that passes doubles as longlongs, to get around\n ARM calling convention oddness.\n\n Parameters\n ==========\n dt : :class:`datetime.datetime`\n ... |
def epoch_to_tt2000(self, epoch):
'\n Converts a CDF EPOCH to a CDF TT2000 value\n\n Parameters\n ==========\n epoch : double\n EPOCH to convert\n\n Returns\n =======\n out : int\n tt2000 corresponding to epoch\n\n See Also\n =====... | -8,411,049,353,749,146,000 | Converts a CDF EPOCH to a CDF TT2000 value
Parameters
==========
epoch : double
EPOCH to convert
Returns
=======
out : int
tt2000 corresponding to epoch
See Also
========
v_epoch_to_tt2000 | pycdf/__init__.py | epoch_to_tt2000 | cpiker/condaCDF | python | def epoch_to_tt2000(self, epoch):
'\n Converts a CDF EPOCH to a CDF TT2000 value\n\n Parameters\n ==========\n epoch : double\n EPOCH to convert\n\n Returns\n =======\n out : int\n tt2000 corresponding to epoch\n\n See Also\n =====... |
def tt2000_to_epoch(self, tt2000):
'\n Converts a CDF TT2000 value to a CDF EPOCH\n\n .. note::\n Although TT2000 values support leapseconds, CDF EPOCH values\n do not. Times during leapseconds are rounded up to beginning\n of the next day.\n\n\n Parameters\n ... | -1,038,626,129,928,731,500 | Converts a CDF TT2000 value to a CDF EPOCH
.. note::
Although TT2000 values support leapseconds, CDF EPOCH values
do not. Times during leapseconds are rounded up to beginning
of the next day.
Parameters
==========
tt2000 : int
TT2000 value from CDF
Raises
======
EpochError : if input invalid
Return... | pycdf/__init__.py | tt2000_to_epoch | cpiker/condaCDF | python | def tt2000_to_epoch(self, tt2000):
'\n Converts a CDF TT2000 value to a CDF EPOCH\n\n .. note::\n Although TT2000 values support leapseconds, CDF EPOCH values\n do not. Times during leapseconds are rounded up to beginning\n of the next day.\n\n\n Parameters\n ... |
def epoch16_to_tt2000(self, epoch0, epoch1):
'\n Converts a CDF epoch16 value to TT2000\n\n .. note::\n Because TT2000 does not support picoseconds, the picoseconds\n value in epoch is ignored (i.e., truncated.)\n\n Parameters\n ==========\n epoch0 : float\n ... | 7,639,834,107,065,348,000 | Converts a CDF epoch16 value to TT2000
.. note::
Because TT2000 does not support picoseconds, the picoseconds
value in epoch is ignored (i.e., truncated.)
Parameters
==========
epoch0 : float
epoch16 value from CDF, first half
epoch1 : float
epoch16 value from CDF, second half
Raises
======
EpochErro... | pycdf/__init__.py | epoch16_to_tt2000 | cpiker/condaCDF | python | def epoch16_to_tt2000(self, epoch0, epoch1):
'\n Converts a CDF epoch16 value to TT2000\n\n .. note::\n Because TT2000 does not support picoseconds, the picoseconds\n value in epoch is ignored (i.e., truncated.)\n\n Parameters\n ==========\n epoch0 : float\n ... |
def tt2000_to_epoch16(self, tt2000):
'\n Converts a CDF TT2000 value to a CDF EPOCH16\n\n .. note::\n Although TT2000 values support leapseconds, CDF EPOCH16 values\n do not. Times during leapseconds are rounded up to beginning\n of the next day.\n\n Parameters\... | 7,700,580,540,914,393,000 | Converts a CDF TT2000 value to a CDF EPOCH16
.. note::
Although TT2000 values support leapseconds, CDF EPOCH16 values
do not. Times during leapseconds are rounded up to beginning
of the next day.
Parameters
==========
tt2000 : int
TT2000 value from CDF
Raises
======
EpochError : if input invalid
Ret... | pycdf/__init__.py | tt2000_to_epoch16 | cpiker/condaCDF | python | def tt2000_to_epoch16(self, tt2000):
'\n Converts a CDF TT2000 value to a CDF EPOCH16\n\n .. note::\n Although TT2000 values support leapseconds, CDF EPOCH16 values\n do not. Times during leapseconds are rounded up to beginning\n of the next day.\n\n Parameters\... |
def _bad_tt2000(*args, **kwargs):
'Convenience function for complaining that TT2000 not supported'
raise NotImplementedError('TT2000 functions require CDF library 3.4.0 or later') | 5,016,153,546,655,569,000 | Convenience function for complaining that TT2000 not supported | pycdf/__init__.py | _bad_tt2000 | cpiker/condaCDF | python | def _bad_tt2000(*args, **kwargs):
raise NotImplementedError('TT2000 functions require CDF library 3.4.0 or later') |
def __init__(self, status):
'\n Create a CDF Exception\n\n Uses CDF C library to look up an appropriate error message.\n\n Parameters\n ==========\n status : ctypes.c_long\n CDF status\n '
self.status = status
self.string = (('CDF error ' + repr(status)) ... | -3,756,434,079,576,152,000 | Create a CDF Exception
Uses CDF C library to look up an appropriate error message.
Parameters
==========
status : ctypes.c_long
CDF status | pycdf/__init__.py | __init__ | cpiker/condaCDF | python | def __init__(self, status):
'\n Create a CDF Exception\n\n Uses CDF C library to look up an appropriate error message.\n\n Parameters\n ==========\n status : ctypes.c_long\n CDF status\n '
self.status = status
self.string = (('CDF error ' + repr(status)) ... |
def __str__(self):
'\n Error string associated with the library error.\n\n Returns\n =======\n out : str\n Error message from the CDF library.\n '
return self.string | -6,240,089,809,281,292,000 | Error string associated with the library error.
Returns
=======
out : str
Error message from the CDF library. | pycdf/__init__.py | __str__ | cpiker/condaCDF | python | def __str__(self):
'\n Error string associated with the library error.\n\n Returns\n =======\n out : str\n Error message from the CDF library.\n '
return self.string |
def warn(self, level=4):
'\n Issues a warning based on the information stored in my exception\n\n Intended for use in check_status or similar wrapper function.\n\n Other Parameters\n ================\n level : int\n optional (default 3), how far up the stack the warning... | 8,221,289,147,594,777,000 | Issues a warning based on the information stored in my exception
Intended for use in check_status or similar wrapper function.
Other Parameters
================
level : int
optional (default 3), how far up the stack the warning should
be reported. Passed directly to :class:`warnings.warn`. | pycdf/__init__.py | warn | cpiker/condaCDF | python | def warn(self, level=4):
'\n Issues a warning based on the information stored in my exception\n\n Intended for use in check_status or similar wrapper function.\n\n Other Parameters\n ================\n level : int\n optional (default 3), how far up the stack the warning... |
def __init__(self, pathname, masterpath=None, create=None, readonly=None):
"Open or create a CDF file.\n\n Parameters\n ==========\n pathname : string\n name of the file to open or create\n masterpath : string\n name of the master CDF file to use in creating\n ... | -1,831,719,878,659,203,800 | Open or create a CDF file.
Parameters
==========
pathname : string
name of the file to open or create
masterpath : string
name of the master CDF file to use in creating
a new file. If not provided, an existing file is
opened; if provided but evaluates to ``False``
(e.g., ``''``), an empty new CDF i... | pycdf/__init__.py | __init__ | cpiker/condaCDF | python | def __init__(self, pathname, masterpath=None, create=None, readonly=None):
"Open or create a CDF file.\n\n Parameters\n ==========\n pathname : string\n name of the file to open or create\n masterpath : string\n name of the master CDF file to use in creating\n ... |
def __del__(self):
'Destructor; called when CDF object is destroyed.\n\n Close CDF file if there is still a valid handle.\n .. note::\n To avoid data loss, explicitly call :py:meth:`pycdf.CDF.close` \n or :py:meth:`pycdf.CDF.save`.\n '
if self._opened:
self.clo... | -7,342,038,237,845,616,000 | Destructor; called when CDF object is destroyed.
Close CDF file if there is still a valid handle.
.. note::
To avoid data loss, explicitly call :py:meth:`pycdf.CDF.close`
or :py:meth:`pycdf.CDF.save`. | pycdf/__init__.py | __del__ | cpiker/condaCDF | python | def __del__(self):
'Destructor; called when CDF object is destroyed.\n\n Close CDF file if there is still a valid handle.\n .. note::\n To avoid data loss, explicitly call :py:meth:`pycdf.CDF.close` \n or :py:meth:`pycdf.CDF.save`.\n '
if self._opened:
self.clo... |
def __delitem__(self, name):
"Delete a zVariable in this CDF, by name or number\n\n Parameters\n ==========\n name : string or int\n Name or number of the CDF variable\n .. note:\n Variable numbers may change if variables are added or removed.\n\n Examples\n ... | 1,720,612,374,302,670,300 | Delete a zVariable in this CDF, by name or number
Parameters
==========
name : string or int
Name or number of the CDF variable
.. note:
Variable numbers may change if variables are added or removed.
Examples
========
Delete the variable ``Epoch`` from the open CDF file ``cdffile``.
>>> del cdffile['Epoch... | pycdf/__init__.py | __delitem__ | cpiker/condaCDF | python | def __delitem__(self, name):
"Delete a zVariable in this CDF, by name or number\n\n Parameters\n ==========\n name : string or int\n Name or number of the CDF variable\n .. note:\n Variable numbers may change if variables are added or removed.\n\n Examples\n ... |
def __enter__(self):
'Context manager entrance function.'
return self | 3,041,422,879,654,393,300 | Context manager entrance function. | pycdf/__init__.py | __enter__ | cpiker/condaCDF | python | def __enter__(self):
return self |
def __exit__(self, type, value, traceback):
'Context manager exit function.\n\n Close CDF file.\n '
self.close() | -737,521,970,676,473,300 | Context manager exit function.
Close CDF file. | pycdf/__init__.py | __exit__ | cpiker/condaCDF | python | def __exit__(self, type, value, traceback):
'Context manager exit function.\n\n Close CDF file.\n '
self.close() |
def __getitem__(self, name):
'Gets a zVariable in this CDF, by name or number\n\n The CDF acts like a dict\n\n @param name: Name or number of the CDF variable\n @type name: string or int\n @return: CDF variable named or numbered L{name}\n @rtype: :py:class:`pycdf.Var`\n @ra... | 9,036,144,436,764,017,000 | Gets a zVariable in this CDF, by name or number
The CDF acts like a dict
@param name: Name or number of the CDF variable
@type name: string or int
@return: CDF variable named or numbered L{name}
@rtype: :py:class:`pycdf.Var`
@raise KeyError: for pretty much any problem in lookup
@note: variable numbers may change if ... | pycdf/__init__.py | __getitem__ | cpiker/condaCDF | python | def __getitem__(self, name):
'Gets a zVariable in this CDF, by name or number\n\n The CDF acts like a dict\n\n @param name: Name or number of the CDF variable\n @type name: string or int\n @return: CDF variable named or numbered L{name}\n @rtype: :py:class:`pycdf.Var`\n @ra... |
def __setitem__(self, name, data):
'Writes data to a zVariable in this CDF\n\n If the zVariable does not exist, will create one matching\n L{data}. If it does exist, will attempt to write L{data}\n to it without changing the type or dimensions.\n\n @param name: name or number of the vari... | -3,767,715,177,205,707,000 | Writes data to a zVariable in this CDF
If the zVariable does not exist, will create one matching
L{data}. If it does exist, will attempt to write L{data}
to it without changing the type or dimensions.
@param name: name or number of the variable to write
@type name: str or int
@param data: data to write, or a :py:clas... | pycdf/__init__.py | __setitem__ | cpiker/condaCDF | python | def __setitem__(self, name, data):
'Writes data to a zVariable in this CDF\n\n If the zVariable does not exist, will create one matching\n L{data}. If it does exist, will attempt to write L{data}\n to it without changing the type or dimensions.\n\n @param name: name or number of the vari... |
def __iter__(self, current=0):
'Iterates over zVars in CDF\n\n Iterators for dicts return keys\n @note: Returned in variable-number order\n '
while (current < self.__len__()):
name = self[current].name()
value = (yield name)
if (value is None):
current +=... | 2,986,849,771,068,039,700 | Iterates over zVars in CDF
Iterators for dicts return keys
@note: Returned in variable-number order | pycdf/__init__.py | __iter__ | cpiker/condaCDF | python | def __iter__(self, current=0):
'Iterates over zVars in CDF\n\n Iterators for dicts return keys\n @note: Returned in variable-number order\n '
while (current < self.__len__()):
name = self[current].name()
value = (yield name)
if (value is None):
current +=... |
def __len__(self):
"Implements 'length' of CDF (number of zVars)\n\n @return: number of zVars in the CDF\n @rtype: int\n "
count = ctypes.c_long(0)
self._call(const.GET_, const.CDF_NUMzVARS_, ctypes.byref(count))
return count.value | -7,621,790,437,472,465,000 | Implements 'length' of CDF (number of zVars)
@return: number of zVars in the CDF
@rtype: int | pycdf/__init__.py | __len__ | cpiker/condaCDF | python | def __len__(self):
"Implements 'length' of CDF (number of zVars)\n\n @return: number of zVars in the CDF\n @rtype: int\n "
count = ctypes.c_long(0)
self._call(const.GET_, const.CDF_NUMzVARS_, ctypes.byref(count))
return count.value |
def __contains__(self, key):
"Determines whether a particular variable name is in the CDF\n\n @note: Essentially an efficiency function; L{__iter__} is called\n if this isn't defined\n @param key: key/variable name to check\n @type key: string\n @return: True if L{key} is t... | -3,203,029,772,389,402,000 | Determines whether a particular variable name is in the CDF
@note: Essentially an efficiency function; L{__iter__} is called
if this isn't defined
@param key: key/variable name to check
@type key: string
@return: True if L{key} is the name of a variable in CDF, else False
@rtype: Boolean | pycdf/__init__.py | __contains__ | cpiker/condaCDF | python | def __contains__(self, key):
"Determines whether a particular variable name is in the CDF\n\n @note: Essentially an efficiency function; L{__iter__} is called\n if this isn't defined\n @param key: key/variable name to check\n @type key: string\n @return: True if L{key} is t... |
def __repr__(self):
"Returns representation of CDF\n\n Cannot return anything that can be eval'd to create a copy of the\n CDF, so just wrap the informal representation in angle brackets.\n @return: all the data in this list of attributes\n @rtype: str\n "
return (('<CDF:\n' +... | -1,682,708,596,007,814,400 | Returns representation of CDF
Cannot return anything that can be eval'd to create a copy of the
CDF, so just wrap the informal representation in angle brackets.
@return: all the data in this list of attributes
@rtype: str | pycdf/__init__.py | __repr__ | cpiker/condaCDF | python | def __repr__(self):
"Returns representation of CDF\n\n Cannot return anything that can be eval'd to create a copy of the\n CDF, so just wrap the informal representation in angle brackets.\n @return: all the data in this list of attributes\n @rtype: str\n "
return (('<CDF:\n' +... |
def __str__(self):
"Returns a string representation of the CDF\n\n This is an 'informal' representation in that it cannot be evaluated\n directly to create a :py:class:`pycdf.CDF`, just the names, types, and sizes of all\n variables. (Attributes are not listed.)\n\n @return: description ... | 5,551,468,211,548,867,000 | Returns a string representation of the CDF
This is an 'informal' representation in that it cannot be evaluated
directly to create a :py:class:`pycdf.CDF`, just the names, types, and sizes of all
variables. (Attributes are not listed.)
@return: description of the variables in the CDF
@rtype: str | pycdf/__init__.py | __str__ | cpiker/condaCDF | python | def __str__(self):
"Returns a string representation of the CDF\n\n This is an 'informal' representation in that it cannot be evaluated\n directly to create a :py:class:`pycdf.CDF`, just the names, types, and sizes of all\n variables. (Attributes are not listed.)\n\n @return: description ... |
def _open(self, readonly=True):
'Opens the CDF file (called on init)\n\n Will open an existing CDF file read/write.\n\n Raises\n ======\n CDFError : if CDF library reports an error\n CDFWarning : if CDF library reports a warning and interpreter\n is set to erro... | 1,323,780,822,043,422,700 | Opens the CDF file (called on init)
Will open an existing CDF file read/write.
Raises
======
CDFError : if CDF library reports an error
CDFWarning : if CDF library reports a warning and interpreter
is set to error on warnings.
.. note:
Not intended for direct call; pass parameters to
:py:class:`p... | pycdf/__init__.py | _open | cpiker/condaCDF | python | def _open(self, readonly=True):
'Opens the CDF file (called on init)\n\n Will open an existing CDF file read/write.\n\n Raises\n ======\n CDFError : if CDF library reports an error\n CDFWarning : if CDF library reports a warning and interpreter\n is set to erro... |
def _create(self):
'Creates (and opens) a new CDF file\n\n Created at ``pathname``.\n Assumes zero-dimension r variables\n\n Raises\n ======\n CDFError : if CDF library reports an error\n CDFWarning : if CDF library reports a warning and interpreter\n is... | 3,707,443,813,987,726,000 | Creates (and opens) a new CDF file
Created at ``pathname``.
Assumes zero-dimension r variables
Raises
======
CDFError : if CDF library reports an error
CDFWarning : if CDF library reports a warning and interpreter
is set to error on warnings.
.. note:
Not intended for direct call; pass parameters to
... | pycdf/__init__.py | _create | cpiker/condaCDF | python | def _create(self):
'Creates (and opens) a new CDF file\n\n Created at ``pathname``.\n Assumes zero-dimension r variables\n\n Raises\n ======\n CDFError : if CDF library reports an error\n CDFWarning : if CDF library reports a warning and interpreter\n is... |
def _from_master(self, master_path):
'Creates a new CDF from a master CDF file\n\n ``master_path`` is copied to ``pathname`` and opened.\n\n Parameters\n ==========\n master_path : string\n location of the master CDF file\n\n Raises\n ======\n CDFError : i... | -7,633,811,102,613,640,000 | Creates a new CDF from a master CDF file
``master_path`` is copied to ``pathname`` and opened.
Parameters
==========
master_path : string
location of the master CDF file
Raises
======
CDFError : if CDF library reports an error
CDFWarning : if CDF library reports a warning and interpreter
is set to e... | pycdf/__init__.py | _from_master | cpiker/condaCDF | python | def _from_master(self, master_path):
'Creates a new CDF from a master CDF file\n\n ``master_path`` is copied to ``pathname`` and opened.\n\n Parameters\n ==========\n master_path : string\n location of the master CDF file\n\n Raises\n ======\n CDFError : i... |
def _call(self, *args, **kwargs):
"Select this CDF as current and call the CDF internal interface\n\n Adds call to select this CDF to L{args} and passes all parameters\n directly through to the CDFlib routine of the CDF library's C internal\n interface. Checks the return value with L{Library.ch... | 4,281,152,753,754,060,300 | Select this CDF as current and call the CDF internal interface
Adds call to select this CDF to L{args} and passes all parameters
directly through to the CDFlib routine of the CDF library's C internal
interface. Checks the return value with L{Library.check_status}.
Parameters
==========
args : various, see :py:mod:`ct... | pycdf/__init__.py | _call | cpiker/condaCDF | python | def _call(self, *args, **kwargs):
"Select this CDF as current and call the CDF internal interface\n\n Adds call to select this CDF to L{args} and passes all parameters\n directly through to the CDFlib routine of the CDF library's C internal\n interface. Checks the return value with L{Library.ch... |
def clone(self, zVar, name=None, data=True):
'\n Clone a zVariable (from another CDF or this) into this CDF\n\n Parameters\n ==========\n zVar : :py:class:`Var`\n variable to clone\n\n Other Parameters\n ================\n name : str\n Name of t... | -8,248,084,366,707,620,000 | Clone a zVariable (from another CDF or this) into this CDF
Parameters
==========
zVar : :py:class:`Var`
variable to clone
Other Parameters
================
name : str
Name of the new variable (default: name of the original)
data : boolean (optional)
Copy data, or only type, dimensions, variance, attribute... | pycdf/__init__.py | clone | cpiker/condaCDF | python | def clone(self, zVar, name=None, data=True):
'\n Clone a zVariable (from another CDF or this) into this CDF\n\n Parameters\n ==========\n zVar : :py:class:`Var`\n variable to clone\n\n Other Parameters\n ================\n name : str\n Name of t... |
def col_major(self, new_col=None):
'\n Finds the majority of this CDF file\n\n Other Parameters\n ================\n new_col : boolean\n Specify True to change to column-major, False to change to\n row major, or do not specify to check the majority\n rath... | 3,227,542,539,931,076,000 | Finds the majority of this CDF file
Other Parameters
================
new_col : boolean
Specify True to change to column-major, False to change to
row major, or do not specify to check the majority
rather than changing it.
(default is check only)
Returns
=======
out : boolean
True if column-major,... | pycdf/__init__.py | col_major | cpiker/condaCDF | python | def col_major(self, new_col=None):
'\n Finds the majority of this CDF file\n\n Other Parameters\n ================\n new_col : boolean\n Specify True to change to column-major, False to change to\n row major, or do not specify to check the majority\n rath... |
def readonly(self, ro=None):
'\n Sets or check the readonly status of this CDF\n\n If the CDF has been changed since opening, setting readonly mode\n will have no effect.\n\n .. note::\n Closing a CDF that has been opened readonly, or setting readonly\n False, may t... | 8,532,621,285,948,232,000 | Sets or check the readonly status of this CDF
If the CDF has been changed since opening, setting readonly mode
will have no effect.
.. note::
Closing a CDF that has been opened readonly, or setting readonly
False, may take a substantial amount of time if there are many
variables in the CDF, as a (potentia... | pycdf/__init__.py | readonly | cpiker/condaCDF | python | def readonly(self, ro=None):
'\n Sets or check the readonly status of this CDF\n\n If the CDF has been changed since opening, setting readonly mode\n will have no effect.\n\n .. note::\n Closing a CDF that has been opened readonly, or setting readonly\n False, may t... |
def checksum(self, new_val=None):
'\n Set or check the checksum status of this CDF. If checksums\n are enabled, the checksum will be verified every time the file\n is opened.\n\n Other Parameters\n ================\n new_val : boolean\n True to enable checksum, F... | 1,468,243,584,143,955,000 | Set or check the checksum status of this CDF. If checksums
are enabled, the checksum will be verified every time the file
is opened.
Other Parameters
================
new_val : boolean
True to enable checksum, False to disable, or leave out
to simply check.
Returns
=======
out : boolean
True if the checks... | pycdf/__init__.py | checksum | cpiker/condaCDF | python | def checksum(self, new_val=None):
'\n Set or check the checksum status of this CDF. If checksums\n are enabled, the checksum will be verified every time the file\n is opened.\n\n Other Parameters\n ================\n new_val : boolean\n True to enable checksum, F... |
def close(self):
'\n Closes the CDF file\n\n Although called on object destruction (:meth:`~CDF.__del__`),\n to ensure all data are saved, the user should explicitly call\n :meth:`~CDF.close` or :meth:`~CDF.save`.\n\n Raises\n ======\n CDFError : if CDF library repor... | 5,496,972,562,181,374,000 | Closes the CDF file
Although called on object destruction (:meth:`~CDF.__del__`),
to ensure all data are saved, the user should explicitly call
:meth:`~CDF.close` or :meth:`~CDF.save`.
Raises
======
CDFError : if CDF library reports an error
Warns
=====
CDFWarning : if CDF library reports a warning | pycdf/__init__.py | close | cpiker/condaCDF | python | def close(self):
'\n Closes the CDF file\n\n Although called on object destruction (:meth:`~CDF.__del__`),\n to ensure all data are saved, the user should explicitly call\n :meth:`~CDF.close` or :meth:`~CDF.save`.\n\n Raises\n ======\n CDFError : if CDF library repor... |
def compress(self, comptype=None, param=None):
"\n Set or check the compression of this CDF\n\n Sets compression on entire *file*, not per-variable.\n\n See section 2.6 of the CDF user's guide for more information on\n compression.\n\n Other Parameters\n ================\n ... | 8,248,528,480,997,144,000 | Set or check the compression of this CDF
Sets compression on entire *file*, not per-variable.
See section 2.6 of the CDF user's guide for more information on
compression.
Other Parameters
================
comptype : ctypes.c_long
type of compression to change to, see CDF C reference manual
section 4.10. Cons... | pycdf/__init__.py | compress | cpiker/condaCDF | python | def compress(self, comptype=None, param=None):
"\n Set or check the compression of this CDF\n\n Sets compression on entire *file*, not per-variable.\n\n See section 2.6 of the CDF user's guide for more information on\n compression.\n\n Other Parameters\n ================\n ... |
def new(self, name, data=None, type=None, recVary=True, dimVarys=None, dims=None, n_elements=None, compress=None, compress_param=None):
"\n Create a new zVariable in this CDF\n\n .. note::\n Either ``data`` or ``type`` must be specified. If type is not\n specified, it is guessed ... | -8,630,664,426,403,404,000 | Create a new zVariable in this CDF
.. note::
Either ``data`` or ``type`` must be specified. If type is not
specified, it is guessed from ``data``.
Parameters
==========
name : str
name of the new variable
Other Parameters
================
data
data to store in the new variable. If this has a an ``att... | pycdf/__init__.py | new | cpiker/condaCDF | python | def new(self, name, data=None, type=None, recVary=True, dimVarys=None, dims=None, n_elements=None, compress=None, compress_param=None):
"\n Create a new zVariable in this CDF\n\n .. note::\n Either ``data`` or ``type`` must be specified. If type is not\n specified, it is guessed ... |
def raw_var(self, name):
'\n Get a "raw" :class:`Var` object.\n\n Normally a :class:`Var` will perform translation of values for\n certain types (to/from Unicode for CHAR variables on Py3k,\n and to/from datetime for all time types). A "raw" object\n does not perform this translat... | -3,017,748,155,568,611,000 | Get a "raw" :class:`Var` object.
Normally a :class:`Var` will perform translation of values for
certain types (to/from Unicode for CHAR variables on Py3k,
and to/from datetime for all time types). A "raw" object
does not perform this translation, on read or write.
This does *not* affect the data on disk, and in fact ... | pycdf/__init__.py | raw_var | cpiker/condaCDF | python | def raw_var(self, name):
'\n Get a "raw" :class:`Var` object.\n\n Normally a :class:`Var` will perform translation of values for\n certain types (to/from Unicode for CHAR variables on Py3k,\n and to/from datetime for all time types). A "raw" object\n does not perform this translat... |
def save(self):
'\n Saves the CDF file but leaves it open.\n\n If closing the CDF, :meth:`close` is sufficient;\n there is no need to call\n :meth:`save` before :meth:`close`.\n\n .. note::\n Relies on an undocumented call of the CDF C library, which is\n als... | 2,463,545,021,715,353,600 | Saves the CDF file but leaves it open.
If closing the CDF, :meth:`close` is sufficient;
there is no need to call
:meth:`save` before :meth:`close`.
.. note::
Relies on an undocumented call of the CDF C library, which is
also used in the Java interface.
Raises
======
CDFError : if CDF library reports an error... | pycdf/__init__.py | save | cpiker/condaCDF | python | def save(self):
'\n Saves the CDF file but leaves it open.\n\n If closing the CDF, :meth:`close` is sufficient;\n there is no need to call\n :meth:`save` before :meth:`close`.\n\n .. note::\n Relies on an undocumented call of the CDF C library, which is\n als... |
def copy(self):
'\n Make a copy of all data and attributes in this CDF\n\n Returns\n =======\n out : :py:class:`CDFCopy`\n :class:`~spacepy.datamodel.SpaceData`-like object of all data\n '
return CDFCopy(self) | 8,352,673,866,543,797,000 | Make a copy of all data and attributes in this CDF
Returns
=======
out : :py:class:`CDFCopy`
:class:`~spacepy.datamodel.SpaceData`-like object of all data | pycdf/__init__.py | copy | cpiker/condaCDF | python | def copy(self):
'\n Make a copy of all data and attributes in this CDF\n\n Returns\n =======\n out : :py:class:`CDFCopy`\n :class:`~spacepy.datamodel.SpaceData`-like object of all data\n '
return CDFCopy(self) |
def version(self):
'\n Get version of library that created this CDF\n\n Returns\n =======\n out : tuple\n version of CDF library, in form (version, release, increment)\n '
ver = ctypes.c_long(0)
rel = ctypes.c_long(0)
inc = ctypes.c_long(0)
self._call(co... | 235,729,553,055,022,300 | Get version of library that created this CDF
Returns
=======
out : tuple
version of CDF library, in form (version, release, increment) | pycdf/__init__.py | version | cpiker/condaCDF | python | def version(self):
'\n Get version of library that created this CDF\n\n Returns\n =======\n out : tuple\n version of CDF library, in form (version, release, increment)\n '
ver = ctypes.c_long(0)
rel = ctypes.c_long(0)
inc = ctypes.c_long(0)
self._call(co... |
def _get_attrs(self):
"Get attribute list\n\n Provide access to the CDF's attribute list without holding a\n strong reference, as the attribute list has a (strong)\n back-reference to its parent.\n\n Either deref a weak reference (to try and keep the object the same),\n or make a ... | 1,744,989,880,435,086,300 | Get attribute list
Provide access to the CDF's attribute list without holding a
strong reference, as the attribute list has a (strong)
back-reference to its parent.
Either deref a weak reference (to try and keep the object the same),
or make a new AttrList instance and assign it to the weak reference
for next time. | pycdf/__init__.py | _get_attrs | cpiker/condaCDF | python | def _get_attrs(self):
"Get attribute list\n\n Provide access to the CDF's attribute list without holding a\n strong reference, as the attribute list has a (strong)\n back-reference to its parent.\n\n Either deref a weak reference (to try and keep the object the same),\n or make a ... |
def _set_attrs(self, value):
'Assign to the attribute list\n\n Clears all elements of the attribute list and copies from value\n '
self.attrs.clone(value) | 4,701,805,248,585,535,000 | Assign to the attribute list
Clears all elements of the attribute list and copies from value | pycdf/__init__.py | _set_attrs | cpiker/condaCDF | python | def _set_attrs(self, value):
'Assign to the attribute list\n\n Clears all elements of the attribute list and copies from value\n '
self.attrs.clone(value) |
def var_num(self, varname):
"Get the variable number of a particular variable name\n\n This maintains a cache of name-to-number mappings for zVariables\n to keep from having to query the CDF library constantly. It's mostly\n an internal function.\n\n Parameters\n ==========\n ... | 291,467,886,314,890,700 | Get the variable number of a particular variable name
This maintains a cache of name-to-number mappings for zVariables
to keep from having to query the CDF library constantly. It's mostly
an internal function.
Parameters
==========
varname : bytes
name of the zVariable. Not this is NOT a string in Python 3!
Rais... | pycdf/__init__.py | var_num | cpiker/condaCDF | python | def var_num(self, varname):
"Get the variable number of a particular variable name\n\n This maintains a cache of name-to-number mappings for zVariables\n to keep from having to query the CDF library constantly. It's mostly\n an internal function.\n\n Parameters\n ==========\n ... |
def attr_num(self, attrname):
"Get the attribute number and scope by attribute name\n\n This maintains a cache of name-to-number mappings for attributes\n to keep from having to query the CDF library constantly. It's mostly\n an internal function.\n\n Parameters\n ==========\n ... | 4,735,735,691,906,771,000 | Get the attribute number and scope by attribute name
This maintains a cache of name-to-number mappings for attributes
to keep from having to query the CDF library constantly. It's mostly
an internal function.
Parameters
==========
attrname : bytes
name of the zVariable. Not this is NOT a string in Python 3!
Rais... | pycdf/__init__.py | attr_num | cpiker/condaCDF | python | def attr_num(self, attrname):
"Get the attribute number and scope by attribute name\n\n This maintains a cache of name-to-number mappings for attributes\n to keep from having to query the CDF library constantly. It's mostly\n an internal function.\n\n Parameters\n ==========\n ... |
def clear_attr_from_cache(self, attrname):
"Mark an attribute deleted in the name-to-number cache\n\n Will remove an attribute, and all attributes with higher numbers,\n from the attribute cache.\n\n Does NOT delete the variable!\n\n This maintains a cache of name-to-number mappings for ... | 5,254,106,712,406,894,000 | Mark an attribute deleted in the name-to-number cache
Will remove an attribute, and all attributes with higher numbers,
from the attribute cache.
Does NOT delete the variable!
This maintains a cache of name-to-number mappings for attributes
to keep from having to query the CDF library constantly. It's mostly
an inte... | pycdf/__init__.py | clear_attr_from_cache | cpiker/condaCDF | python | def clear_attr_from_cache(self, attrname):
"Mark an attribute deleted in the name-to-number cache\n\n Will remove an attribute, and all attributes with higher numbers,\n from the attribute cache.\n\n Does NOT delete the variable!\n\n This maintains a cache of name-to-number mappings for ... |
def clear_from_cache(self, varname):
"Mark a variable deleted in the name-to-number cache\n\n Will remove a variable, and all variables with higher numbers,\n from the variable cache.\n\n Does NOT delete the variable!\n\n This maintains a cache of name-to-number mappings for zVariables\n... | -3,410,475,348,191,111,700 | Mark a variable deleted in the name-to-number cache
Will remove a variable, and all variables with higher numbers,
from the variable cache.
Does NOT delete the variable!
This maintains a cache of name-to-number mappings for zVariables
to keep from having to query the CDF library constantly. It's mostly
an internal f... | pycdf/__init__.py | clear_from_cache | cpiker/condaCDF | python | def clear_from_cache(self, varname):
"Mark a variable deleted in the name-to-number cache\n\n Will remove a variable, and all variables with higher numbers,\n from the variable cache.\n\n Does NOT delete the variable!\n\n This maintains a cache of name-to-number mappings for zVariables\n... |
def add_attr_to_cache(self, attrname, num, scope):
"Add an attribute to the name-to-number cache\n\n This maintains a cache of name-to-number mappings for attributes\n to keep from having to query the CDF library constantly. It's mostly\n an internal function.\n\n Parameters\n ===... | 2,083,129,337,404,797,700 | Add an attribute to the name-to-number cache
This maintains a cache of name-to-number mappings for attributes
to keep from having to query the CDF library constantly. It's mostly
an internal function.
Parameters
==========
varname : bytes
name of the zVariable. Not this is NOT a string in Python 3!
num : int
... | pycdf/__init__.py | add_attr_to_cache | cpiker/condaCDF | python | def add_attr_to_cache(self, attrname, num, scope):
"Add an attribute to the name-to-number cache\n\n This maintains a cache of name-to-number mappings for attributes\n to keep from having to query the CDF library constantly. It's mostly\n an internal function.\n\n Parameters\n ===... |
def add_to_cache(self, varname, num):
"Add a variable to the name-to-number cache\n\n This maintains a cache of name-to-number mappings for zVariables\n to keep from having to query the CDF library constantly. It's mostly\n an internal function.\n\n Parameters\n ==========\n ... | 3,774,387,525,938,285,600 | Add a variable to the name-to-number cache
This maintains a cache of name-to-number mappings for zVariables
to keep from having to query the CDF library constantly. It's mostly
an internal function.
Parameters
==========
varname : bytes
name of the zVariable. Not this is NOT a string in Python 3!
num : int
nu... | pycdf/__init__.py | add_to_cache | cpiker/condaCDF | python | def add_to_cache(self, varname, num):
"Add a variable to the name-to-number cache\n\n This maintains a cache of name-to-number mappings for zVariables\n to keep from having to query the CDF library constantly. It's mostly\n an internal function.\n\n Parameters\n ==========\n ... |
def __init__(self, cdf_file, var_name, *args):
'Create or locate a variable\n\n Parameters\n ==========\n cdf_file : :py:class:`pycdf.CDF`\n CDF file containing this variable\n var_name : string\n name of this variable\n\n Other Parameters\n ==========... | -5,344,524,584,329,326,000 | Create or locate a variable
Parameters
==========
cdf_file : :py:class:`pycdf.CDF`
CDF file containing this variable
var_name : string
name of this variable
Other Parameters
================
args
additional arguments passed to :py:meth:`_create`. If none,
opens an existing variable. If provided, creat... | pycdf/__init__.py | __init__ | cpiker/condaCDF | python | def __init__(self, cdf_file, var_name, *args):
'Create or locate a variable\n\n Parameters\n ==========\n cdf_file : :py:class:`pycdf.CDF`\n CDF file containing this variable\n var_name : string\n name of this variable\n\n Other Parameters\n ==========... |
def __getitem__(self, key):
'Returns a slice from the data array. Details under :py:class:`pycdf.Var`.\n\n @return: The data from this variable\n @rtype: list-of-lists of appropriate type.\n @raise IndexError: if L{key} is out of range, mismatches dimensions,\n or simp... | -6,790,587,963,677,555,000 | Returns a slice from the data array. Details under :py:class:`pycdf.Var`.
@return: The data from this variable
@rtype: list-of-lists of appropriate type.
@raise IndexError: if L{key} is out of range, mismatches dimensions,
or simply unparseable.
@raise CDFError: for errors from the CDF library | pycdf/__init__.py | __getitem__ | cpiker/condaCDF | python | def __getitem__(self, key):
'Returns a slice from the data array. Details under :py:class:`pycdf.Var`.\n\n @return: The data from this variable\n @rtype: list-of-lists of appropriate type.\n @raise IndexError: if L{key} is out of range, mismatches dimensions,\n or simp... |
def __delitem__(self, key):
'Removes a record (or set of records) from the CDF\n\n Only whole records can be deleted, so the del call must either specify\n only one dimension or it must specify all elements of the non-record\n dimensions. This is *not* a way to resize a variable!\n\n Del... | 433,044,169,112,213,400 | Removes a record (or set of records) from the CDF
Only whole records can be deleted, so the del call must either specify
only one dimension or it must specify all elements of the non-record
dimensions. This is *not* a way to resize a variable!
Deleting records from the middle of a variable may be very slow in
some ci... | pycdf/__init__.py | __delitem__ | cpiker/condaCDF | python | def __delitem__(self, key):
'Removes a record (or set of records) from the CDF\n\n Only whole records can be deleted, so the del call must either specify\n only one dimension or it must specify all elements of the non-record\n dimensions. This is *not* a way to resize a variable!\n\n Del... |
def __setitem__(self, key, data):
'Puts a slice into the data array. Details under :py:class:`pycdf.Var`.\n\n @param key: index or slice to store\n @type key: int or slice\n @param data: data to store\n @type data: numpy.array\n @raise IndexError: if L{key} is out of range, mismat... | 8,200,239,495,651,038,000 | Puts a slice into the data array. Details under :py:class:`pycdf.Var`.
@param key: index or slice to store
@type key: int or slice
@param data: data to store
@type data: numpy.array
@raise IndexError: if L{key} is out of range, mismatches dimensions,
or simply unparseable. IndexError will
@raise CDF... | pycdf/__init__.py | __setitem__ | cpiker/condaCDF | python | def __setitem__(self, key, data):
'Puts a slice into the data array. Details under :py:class:`pycdf.Var`.\n\n @param key: index or slice to store\n @type key: int or slice\n @param data: data to store\n @type data: numpy.array\n @raise IndexError: if L{key} is out of range, mismat... |
def extend(self, data):
'\n Append multiple values to the end of this variable\n\n This is an efficiency function which overrides the base implementation\n in MutableSequence.\n\n Parameters\n ----------\n data :\n the data to append\n '
self[len(self)... | 1,579,934,320,573,426,000 | Append multiple values to the end of this variable
This is an efficiency function which overrides the base implementation
in MutableSequence.
Parameters
----------
data :
the data to append | pycdf/__init__.py | extend | cpiker/condaCDF | python | def extend(self, data):
'\n Append multiple values to the end of this variable\n\n This is an efficiency function which overrides the base implementation\n in MutableSequence.\n\n Parameters\n ----------\n data :\n the data to append\n '
self[len(self)... |
def insert(self, index, data):
'\n Inserts a *single* record before an index\n\n Parameters\n ----------\n index : int\n index before which to insert the new record\n data :\n the record to insert\n '
self[index:index] = [data] | -3,833,956,266,901,798,400 | Inserts a *single* record before an index
Parameters
----------
index : int
index before which to insert the new record
data :
the record to insert | pycdf/__init__.py | insert | cpiker/condaCDF | python | def insert(self, index, data):
'\n Inserts a *single* record before an index\n\n Parameters\n ----------\n index : int\n index before which to insert the new record\n data :\n the record to insert\n '
self[index:index] = [data] |
def _create(self, var_name, datatype, n_elements=1, dims=(), recVary=const.VARY, dimVarys=None):
'Creates a new zVariable\n\n @param var_name: name of this variable\n @type var_name: string\n @param datatype: CDF data type\n @type datatype: ctypes.c_long\n @param n_elements: numbe... | -3,817,955,230,981,504,000 | Creates a new zVariable
@param var_name: name of this variable
@type var_name: string
@param datatype: CDF data type
@type datatype: ctypes.c_long
@param n_elements: number of elements (should be 1 except for
CDF_CHAR variables).
@type n_elements: long
@param dims: size of each dimension for multi-d... | pycdf/__init__.py | _create | cpiker/condaCDF | python | def _create(self, var_name, datatype, n_elements=1, dims=(), recVary=const.VARY, dimVarys=None):
'Creates a new zVariable\n\n @param var_name: name of this variable\n @type var_name: string\n @param datatype: CDF data type\n @type datatype: ctypes.c_long\n @param n_elements: numbe... |
def _delete(self):
'Removes this zVariable from the CDF\n\n @raise CDFError: if CDF library reports an error\n @raise CDFWarning: if CDF library reports a warning and interpreter\n is set to error on warnings.\n '
self._call(const.DELETE_, const.zVAR_)
self.cdf... | 4,279,529,010,044,290,000 | Removes this zVariable from the CDF
@raise CDFError: if CDF library reports an error
@raise CDFWarning: if CDF library reports a warning and interpreter
is set to error on warnings. | pycdf/__init__.py | _delete | cpiker/condaCDF | python | def _delete(self):
'Removes this zVariable from the CDF\n\n @raise CDFError: if CDF library reports an error\n @raise CDFWarning: if CDF library reports a warning and interpreter\n is set to error on warnings.\n '
self._call(const.DELETE_, const.zVAR_)
self.cdf... |
def _get(self, var_name):
'Gets an existing zVariable\n\n @param var_name: name of this variable\n @type var_name: string\n @return: variable with this name\n @rtype: :py:class:`pycdf.Var`\n @raise CDFError: if CDF library reports an error\n @raise CDFWarning: if CDF librar... | 6,053,662,506,556,101,000 | Gets an existing zVariable
@param var_name: name of this variable
@type var_name: string
@return: variable with this name
@rtype: :py:class:`pycdf.Var`
@raise CDFError: if CDF library reports an error
@raise CDFWarning: if CDF library reports a warning and interpreter
is set to error on warnings.
@n... | pycdf/__init__.py | _get | cpiker/condaCDF | python | def _get(self, var_name):
'Gets an existing zVariable\n\n @param var_name: name of this variable\n @type var_name: string\n @return: variable with this name\n @rtype: :py:class:`pycdf.Var`\n @raise CDFError: if CDF library reports an error\n @raise CDFWarning: if CDF librar... |
def _num(self):
'Returns the zVar number for this variable\n\n @return: number of this zVar\n @rtype: int\n '
return self.cdf_file.var_num(self._name) | -5,077,650,296,107,514,000 | Returns the zVar number for this variable
@return: number of this zVar
@rtype: int | pycdf/__init__.py | _num | cpiker/condaCDF | python | def _num(self):
'Returns the zVar number for this variable\n\n @return: number of this zVar\n @rtype: int\n '
return self.cdf_file.var_num(self._name) |
def __len__(self):
'Get number of records for this variable in this file\n\n @return: Number of records\n @rtype: long\n @raise CDFError: if CDF library reports an error\n @raise CDFWarning: if CDF library reports a warning and interpreter\n is set to error on w... | -4,076,633,597,108,568,000 | Get number of records for this variable in this file
@return: Number of records
@rtype: long
@raise CDFError: if CDF library reports an error
@raise CDFWarning: if CDF library reports a warning and interpreter
is set to error on warnings. | pycdf/__init__.py | __len__ | cpiker/condaCDF | python | def __len__(self):
'Get number of records for this variable in this file\n\n @return: Number of records\n @rtype: long\n @raise CDFError: if CDF library reports an error\n @raise CDFWarning: if CDF library reports a warning and interpreter\n is set to error on w... |
def __repr__(self):
"Returns representation of the variable\n\n Cannot return anything that can be eval'd to create a copy,\n so just wrap the informal representation in angle brackets.\n @return: info on this zVar\n @rtype: str\n "
return (('<Var:\n' + str(self)) + '\n>') | -3,990,811,872,302,432,000 | Returns representation of the variable
Cannot return anything that can be eval'd to create a copy,
so just wrap the informal representation in angle brackets.
@return: info on this zVar
@rtype: str | pycdf/__init__.py | __repr__ | cpiker/condaCDF | python | def __repr__(self):
"Returns representation of the variable\n\n Cannot return anything that can be eval'd to create a copy,\n so just wrap the informal representation in angle brackets.\n @return: info on this zVar\n @rtype: str\n "
return (('<Var:\n' + str(self)) + '\n>') |
def __str__(self):
"Returns a string representation of the variable\n\n This is an 'informal' representation in that it cannot be evaluated\n directly to create a :py:class:`pycdf.Var`.\n\n @return: info on this zVar, CDFTYPE [dimensions] NRV\n (if not record-varying)\n @... | -3,957,928,169,494,949,400 | Returns a string representation of the variable
This is an 'informal' representation in that it cannot be evaluated
directly to create a :py:class:`pycdf.Var`.
@return: info on this zVar, CDFTYPE [dimensions] NRV
(if not record-varying)
@rtype: str | pycdf/__init__.py | __str__ | cpiker/condaCDF | python | def __str__(self):
"Returns a string representation of the variable\n\n This is an 'informal' representation in that it cannot be evaluated\n directly to create a :py:class:`pycdf.Var`.\n\n @return: info on this zVar, CDFTYPE [dimensions] NRV\n (if not record-varying)\n @... |
def _n_dims(self):
'Get number of dimensions for this variable\n\n @return: the number of dimensions\n @rtype: long\n '
n_dims = ctypes.c_long(0)
self._call(const.GET_, const.zVAR_NUMDIMS_, ctypes.byref(n_dims))
return n_dims.value | -3,148,282,105,845,771,000 | Get number of dimensions for this variable
@return: the number of dimensions
@rtype: long | pycdf/__init__.py | _n_dims | cpiker/condaCDF | python | def _n_dims(self):
'Get number of dimensions for this variable\n\n @return: the number of dimensions\n @rtype: long\n '
n_dims = ctypes.c_long(0)
self._call(const.GET_, const.zVAR_NUMDIMS_, ctypes.byref(n_dims))
return n_dims.value |
def _dim_sizes(self):
'Get the dimension sizes for this variable\n\n @return: sequence of sizes\n @rtype: sequence of long\n @note: This will always be in Python order (i.e. row major, last index\n iterates most quickly), *regardless* of the majority of the CDF.\n '
sizes = (c... | 3,968,508,833,405,391,400 | Get the dimension sizes for this variable
@return: sequence of sizes
@rtype: sequence of long
@note: This will always be in Python order (i.e. row major, last index
iterates most quickly), *regardless* of the majority of the CDF. | pycdf/__init__.py | _dim_sizes | cpiker/condaCDF | python | def _dim_sizes(self):
'Get the dimension sizes for this variable\n\n @return: sequence of sizes\n @rtype: sequence of long\n @note: This will always be in Python order (i.e. row major, last index\n iterates most quickly), *regardless* of the majority of the CDF.\n '
sizes = (c... |
def rv(self, new_rv=None):
'\n Gets or sets whether this variable has record variance\n\n If the variance is unknown, True is assumed\n (this replicates the apparent behavior of the CDF library on\n variable creation).\n\n Other Parameters\n ================\n new_rv... | -536,947,292,645,786,300 | Gets or sets whether this variable has record variance
If the variance is unknown, True is assumed
(this replicates the apparent behavior of the CDF library on
variable creation).
Other Parameters
================
new_rv : boolean
True to change to record variance, False to change to NRV,
unspecified to simpl... | pycdf/__init__.py | rv | cpiker/condaCDF | python | def rv(self, new_rv=None):
'\n Gets or sets whether this variable has record variance\n\n If the variance is unknown, True is assumed\n (this replicates the apparent behavior of the CDF library on\n variable creation).\n\n Other Parameters\n ================\n new_rv... |
def dv(self, new_dv=None):
'\n Gets or sets dimension variance of each dimension of variable.\n\n If the variance is unknown, True is assumed\n (this replicates the apparent behavior of the\n CDF library on variable creation).\n\n Parameters\n ==========\n new_dv : l... | 5,561,749,453,369,350,000 | Gets or sets dimension variance of each dimension of variable.
If the variance is unknown, True is assumed
(this replicates the apparent behavior of the
CDF library on variable creation).
Parameters
==========
new_dv : list of boolean
Each element True to change that dimension to dimension
variance, False to ... | pycdf/__init__.py | dv | cpiker/condaCDF | python | def dv(self, new_dv=None):
'\n Gets or sets dimension variance of each dimension of variable.\n\n If the variance is unknown, True is assumed\n (this replicates the apparent behavior of the\n CDF library on variable creation).\n\n Parameters\n ==========\n new_dv : l... |
def _call(self, *args, **kwargs):
"Select this CDF and variable and call the CDF internal interface\n\n Adds call to select this CDF to L{args} and passes all parameters\n directly through to the CDFlib routine of the CDF library's C internal\n interface. Checks the return value with L{Library.... | -5,022,373,434,638,317,000 | Select this CDF and variable and call the CDF internal interface
Adds call to select this CDF to L{args} and passes all parameters
directly through to the CDFlib routine of the CDF library's C internal
interface. Checks the return value with L{Library.check_status}.
@param args: Passed directly to the CDF library int... | pycdf/__init__.py | _call | cpiker/condaCDF | python | def _call(self, *args, **kwargs):
"Select this CDF and variable and call the CDF internal interface\n\n Adds call to select this CDF to L{args} and passes all parameters\n directly through to the CDFlib routine of the CDF library's C internal\n interface. Checks the return value with L{Library.... |
def _np_type(self):
'Returns the numpy type of this variable\n\n This is the numpy type that will come directly out of the CDF;\n see :meth:`dtype` for the representation post-conversion.\n\n Raises\n ======\n CDFError : for library-reported error or failure to find numpy type\n\n... | 6,706,597,157,620,074,000 | Returns the numpy type of this variable
This is the numpy type that will come directly out of the CDF;
see :meth:`dtype` for the representation post-conversion.
Raises
======
CDFError : for library-reported error or failure to find numpy type
Returns
=======
out : dtype
numpy dtype that will hold value from this... | pycdf/__init__.py | _np_type | cpiker/condaCDF | python | def _np_type(self):
'Returns the numpy type of this variable\n\n This is the numpy type that will come directly out of the CDF;\n see :meth:`dtype` for the representation post-conversion.\n\n Raises\n ======\n CDFError : for library-reported error or failure to find numpy type\n\n... |
def type(self, new_type=None):
'\n Returns or sets the CDF type of this variable\n\n Parameters\n ==========\n new_type : ctypes.c_long\n the new type from :mod:`~pycdf.const`\n\n Returns\n =======\n out : int\n CDF type\n '
if (new_t... | -5,909,217,226,126,335,000 | Returns or sets the CDF type of this variable
Parameters
==========
new_type : ctypes.c_long
the new type from :mod:`~pycdf.const`
Returns
=======
out : int
CDF type | pycdf/__init__.py | type | cpiker/condaCDF | python | def type(self, new_type=None):
'\n Returns or sets the CDF type of this variable\n\n Parameters\n ==========\n new_type : ctypes.c_long\n the new type from :mod:`~pycdf.const`\n\n Returns\n =======\n out : int\n CDF type\n '
if (new_t... |
def _nelems(self):
'Number of elements for each value in this variable\n\n This is the length of strings for CHAR and UCHAR,\n should be 1 otherwise.\n @return: length of strings\n @rtype: int\n '
nelems = ctypes.c_long(0)
self._call(const.GET_, const.zVAR_NUMELEMS_, ctype... | -7,765,110,379,715,856,000 | Number of elements for each value in this variable
This is the length of strings for CHAR and UCHAR,
should be 1 otherwise.
@return: length of strings
@rtype: int | pycdf/__init__.py | _nelems | cpiker/condaCDF | python | def _nelems(self):
'Number of elements for each value in this variable\n\n This is the length of strings for CHAR and UCHAR,\n should be 1 otherwise.\n @return: length of strings\n @rtype: int\n '
nelems = ctypes.c_long(0)
self._call(const.GET_, const.zVAR_NUMELEMS_, ctype... |
def name(self):
"\n Returns the name of this variable\n\n Returns\n =======\n out : str\n variable's name\n "
if isinstance(self._name, str):
return self._name
elif isinstance(self._name, bytes):
return self._name.decode() | -3,283,656,668,328,771,000 | Returns the name of this variable
Returns
=======
out : str
variable's name | pycdf/__init__.py | name | cpiker/condaCDF | python | def name(self):
"\n Returns the name of this variable\n\n Returns\n =======\n out : str\n variable's name\n "
if isinstance(self._name, str):
return self._name
elif isinstance(self._name, bytes):
return self._name.decode() |
def compress(self, comptype=None, param=None):
"\n Set or check the compression of this variable\n\n Compression may not be changeable on variables with data already\n written; even deleting the data may not permit the change.\n\n See section 2.6 of the CDF user's guide for more informat... | 3,699,615,847,711,787,500 | Set or check the compression of this variable
Compression may not be changeable on variables with data already
written; even deleting the data may not permit the change.
See section 2.6 of the CDF user's guide for more information on
compression.
Other Parameters
================
comptype : ctypes.c_long
type of... | pycdf/__init__.py | compress | cpiker/condaCDF | python | def compress(self, comptype=None, param=None):
"\n Set or check the compression of this variable\n\n Compression may not be changeable on variables with data already\n written; even deleting the data may not permit the change.\n\n See section 2.6 of the CDF user's guide for more informat... |
def copy(self):
'\n Copies all data and attributes from this variable\n\n Returns\n =======\n out : :class:`VarCopy`\n list of all data in record order\n '
return VarCopy(self) | 49,623,961,128,289,530 | Copies all data and attributes from this variable
Returns
=======
out : :class:`VarCopy`
list of all data in record order | pycdf/__init__.py | copy | cpiker/condaCDF | python | def copy(self):
'\n Copies all data and attributes from this variable\n\n Returns\n =======\n out : :class:`VarCopy`\n list of all data in record order\n '
return VarCopy(self) |
def rename(self, new_name):
'\n Renames this variable\n\n Parameters\n ==========\n new_name : str\n the new name for this variable\n '
try:
enc_name = new_name.encode('ascii')
except AttributeError:
enc_name = new_name
if (len(enc_name) > co... | 3,806,647,295,599,496,000 | Renames this variable
Parameters
==========
new_name : str
the new name for this variable | pycdf/__init__.py | rename | cpiker/condaCDF | python | def rename(self, new_name):
'\n Renames this variable\n\n Parameters\n ==========\n new_name : str\n the new name for this variable\n '
try:
enc_name = new_name.encode('ascii')
except AttributeError:
enc_name = new_name
if (len(enc_name) > co... |
@property
def shape(self):
'\n Provides the numpy array-like shape of this variable.\n\n Returns a tuple; first element is number of records (RV variable\n only) And the rest provide the dimensionality of the variable.\n\n .. note::\n Assigning to this attribute will not chang... | -4,140,950,993,922,606,600 | Provides the numpy array-like shape of this variable.
Returns a tuple; first element is number of records (RV variable
only) And the rest provide the dimensionality of the variable.
.. note::
Assigning to this attribute will not change the shape. | pycdf/__init__.py | shape | cpiker/condaCDF | python | @property
def shape(self):
'\n Provides the numpy array-like shape of this variable.\n\n Returns a tuple; first element is number of records (RV variable\n only) And the rest provide the dimensionality of the variable.\n\n .. note::\n Assigning to this attribute will not chang... |
@property
def dtype(self):
'\n Provide the numpy dtype equivalent to the CDF type of this variable.\n\n Data from this variable will be returned in numpy arrays of this type.\n\n See Also\n --------\n type\n '
cdftype = self.type()
if ((cdftype in (const.CDF_CHAR.va... | -1,868,019,082,301,510,700 | Provide the numpy dtype equivalent to the CDF type of this variable.
Data from this variable will be returned in numpy arrays of this type.
See Also
--------
type | pycdf/__init__.py | dtype | cpiker/condaCDF | python | @property
def dtype(self):
'\n Provide the numpy dtype equivalent to the CDF type of this variable.\n\n Data from this variable will be returned in numpy arrays of this type.\n\n See Also\n --------\n type\n '
cdftype = self.type()
if ((cdftype in (const.CDF_CHAR.va... |
def _get_attrs(self):
"Get attribute list\n\n Provide access to the zVar's attribute list without holding a\n strong reference, as the attribute list has a (strong)\n back-reference to its parent.\n\n Either deref a weak reference (to try and keep the object the same),\n or make a... | 3,003,470,097,806,460,000 | Get attribute list
Provide access to the zVar's attribute list without holding a
strong reference, as the attribute list has a (strong)
back-reference to its parent.
Either deref a weak reference (to try and keep the object the same),
or make a new AttrList instance and assign it to the weak reference
for next time. | pycdf/__init__.py | _get_attrs | cpiker/condaCDF | python | def _get_attrs(self):
"Get attribute list\n\n Provide access to the zVar's attribute list without holding a\n strong reference, as the attribute list has a (strong)\n back-reference to its parent.\n\n Either deref a weak reference (to try and keep the object the same),\n or make a... |
def _set_attrs(self, value):
'Assign to the attribute list\n\n Clears all elements of the attribute list and copies from value\n '
self.attrs.clone(value) | 4,701,805,248,585,535,000 | Assign to the attribute list
Clears all elements of the attribute list and copies from value | pycdf/__init__.py | _set_attrs | cpiker/condaCDF | python | def _set_attrs(self, value):
'Assign to the attribute list\n\n Clears all elements of the attribute list and copies from value\n '
self.attrs.clone(value) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.