INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
Returns True if lun_or_snap is attached to the host.
def has_hlu(self, lun_or_snap, cg_member=None): """Returns True if `lun_or_snap` is attached to the host. :param lun_or_snap: can be lun, lun snap, cg snap or a member snap of cg snap. :param cg_member: the member lun of cg if `lun_or_snap` is cg snap. :return: True - if `lu...
Gets the host lun of a lun lun snap cg snap or a member snap of cg snap.
def get_host_lun(self, lun_or_snap, cg_member=None): """Gets the host lun of a lun, lun snap, cg snap or a member snap of cg snap. :param lun_or_snap: can be lun, lun snap, cg snap or a member snap of cg snap. :param cg_member: the member lun of cg if `lun_or_snap` is cg sna...
Gets the hlu number of a lun lun snap cg snap or a member snap of cg snap.
def get_hlu(self, resource, cg_member=None): """Gets the hlu number of a lun, lun snap, cg snap or a member snap of cg snap. :param resource: can be lun, lun snap, cg snap or a member snap of cg snap. :param cg_member: the member lun of cg if `lun_or_snap` is cg snap. ...
Primarily for puppet - unity use.
def update_initiators(self, iqns=None, wwns=None): """Primarily for puppet-unity use. Update the iSCSI and FC initiators if needed. """ # First get current iqns iqns = set(iqns) if iqns else set() current_iqns = set() if self.iscsi_host_initiators: cu...
Return a Pandas Series of every file for chosen satellite data. This routine is intended to be used by pysat instrument modules supporting a particular NASA CDAWeb dataset.
def list_files(tag=None, sat_id=None, data_path=None, format_str=None, supported_tags=None, fake_daily_files_from_monthly=False, two_digit_year_break=None): """Return a Pandas Series of every file for chosen satellite data. This routine is intended to be used by pysat instrume...
Load NASA CDAWeb CDF files. This routine is intended to be used by pysat instrument modules supporting a particular NASA CDAWeb dataset.
def load(fnames, tag=None, sat_id=None, fake_daily_files_from_monthly=False, flatten_twod=True): """Load NASA CDAWeb CDF files. This routine is intended to be used by pysat instrument modules supporting a particular NASA CDAWeb dataset. Parameters ------------ fnames : (...
Routine to download NASA CDAWeb CDF data. This routine is intended to be used by pysat instrument modules supporting a particular NASA CDAWeb dataset.
def download(supported_tags, date_array, tag, sat_id, ftp_site='cdaweb.gsfc.nasa.gov', data_path=None, user=None, password=None, fake_daily_files_from_monthly=False): """Routine to download NASA CDAWeb CDF data. This routine is intended to be used by pysat instrumen...
Returns an instance of: class: HttpError or subclass based on response.
def from_response(response, method, url): """Returns an instance of :class:`HttpError` or subclass based on response. :param response: instance of `requests.Response` class :param method: HTTP method used for request :param url: URL used for request """ req_id = response.headers.get("x-opensta...
Create pool based on RaidGroupParameter.
def create_pool(self, name, raid_groups, description=None, **kwargs): """Create pool based on RaidGroupParameter. :param name: pool name :param raid_groups: a list of *RaidGroupParameter* :param description: pool description :param alert_threshold: Threshold at which the system ...
Returns ports list can be used by File
def get_file_port(self): """Returns ports list can be used by File File ports includes ethernet ports and link aggregation ports. """ eths = self.get_ethernet_port(bond=False) las = self.get_link_aggregation() return eths + las
Configures a remote system for remote replication.
def create_remote_system(self, management_address, local_username=None, local_password=None, remote_username=None, remote_password=None, connection_type=None): """ Configures a remote system for remote replication. ...
Creates a replication interface.
def create_replication_interface(self, sp, ip_port, ip_address, netmask=None, v6_prefix_length=None, gateway=None, vlan_id=None): """ Creates a replication interface. :param sp: `UnityStorageProcessor` object. Storage pro...
geographic coordinate to magnetic coordinate ( coarse ):
def geo2mag(incoord): """geographic coordinate to magnetic coordinate (coarse): Parameters ---------- incoord : numpy.array of shape (2,*) array([[glat0,glat1,glat2,...],[glon0,glon1,glon2,...]), where glat, glon are geographic latitude and longitude (or if you have only one po...
Restores a snapshot.: param res_id: the LUN number of primary LUN or snapshot mount point to be restored.: param backup_snap: the name of a backup snapshot to be created before restoring.
def restore(self, res_id, backup_snap=None): """ Restores a snapshot. :param res_id: the LUN number of primary LUN or snapshot mount point to be restored. :param backup_snap: the name of a backup snapshot to be created before restoring. """ name = ...
Return a Pandas Series of every file for chosen SuperMAG data
def list_files(tag='', sat_id=None, data_path=None, format_str=None): """Return a Pandas Series of every file for chosen SuperMAG data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are 'indices', 'all', 'stations', and '' (for just magne...
Load the SuperMAG files
def load(fnames, tag='', sat_id=None): """ Load the SuperMAG files Parameters ----------- fnames : (list) List of filenames tag : (str or NoneType) Denotes type of file to load. Accepted types are 'indices', 'all', 'stations', and '' (for just magnetometer measurements). (d...
Load data from a comma separated SuperMAG file
def load_csv_data(fname, tag): """Load data from a comma separated SuperMAG file Parameters ------------ fname : (str) CSV SuperMAG file name tag : (str) Denotes type of file to load. Accepted types are 'indices', 'all', 'stations', and '' (for just magnetometer measurement...
Load data from a self - documenting ASCII SuperMAG file
def load_ascii_data(fname, tag): """Load data from a self-documenting ASCII SuperMAG file Parameters ------------ fname : (str) ASCII SuperMAG filename tag : (str) Denotes type of file to load. Accepted types are 'indices', 'all', 'stations', and '' (for just magnetometer m...
Update SuperMAG metadata
def update_smag_metadata(col_name): """Update SuperMAG metadata Parameters ----------- col_name : (str) Data column name Returns -------- col_dict : (dict) Dictionary of strings detailing the units and long-form name of the data """ smag_units = {'IAGA':'non...
Format the list of baseline information from the loaded files into a cohesive informative string
def format_baseline_list(baseline_list): """Format the list of baseline information from the loaded files into a cohesive, informative string Parameters ------------ baseline_list : (list) List of strings specifying the baseline information for each SuperMAG file Returns --...
Routine to download SuperMAG data
def download(date_array, tag, sat_id='', data_path=None, user=None, password=None, baseline='all', delta='none', options='all', file_fmt='ascii'): """Routine to download SuperMAG data Parameters ----------- date_array : np.array Array of datetime objects tag : stri...
Load the SuperMAG files
def append_data(file_strings, file_fmt, tag): """ Load the SuperMAG files Parameters ----------- file_strings : array-like Lists or arrays of strings, where each string contains one file of data file_fmt : str String denoting file type (ascii or csv) tag : string String ...
Append data from multiple files for the same time period
def append_ascii_data(file_strings, tag): """ Append data from multiple files for the same time period Parameters ----------- file_strings : array-like Lists or arrays of strings, where each string contains one file of data tag : string String denoting the type of file to load, acce...
Append data from multiple csv files for the same time period
def append_csv_data(file_strings): """ Append data from multiple csv files for the same time period Parameters ----------- file_strings : array-like Lists or arrays of strings, where each string contains one file of data Returns ------- out_string : string String with all d...
Adds custom calculations to orbit simulation. This routine is run once and only once upon instantiation. Adds quasi - dipole coordiantes velocity calculation in ECEF coords adds the attitude vectors of spacecraft assuming x is ram pointing and z is generally nadir adds ionospheric parameters from the Interational Refer...
def init(self): """ Adds custom calculations to orbit simulation. This routine is run once, and only once, upon instantiation. Adds quasi-dipole coordiantes, velocity calculation in ECEF coords, adds the attitude vectors of spacecraft assuming x is ram pointing and z is generally nadir, add...
Returns data and metadata in the format required by pysat. Finds position of satellite in both ECI and ECEF co - ordinates. Routine is directly called by pysat and not the user. Parameters ---------- fnames: list - like collection File name that contains date in its name. tag: string Identifies a particular subset of s...
def load(fnames, tag=None, sat_id=None, obs_long=0., obs_lat=0., obs_alt=0., TLE1=None, TLE2=None): """ Returns data and metadata in the format required by pysat. Finds position of satellite in both ECI and ECEF co-ordinates. Routine is directl...
Produce a fake list of files spanning a year
def list_files(tag=None, sat_id=None, data_path=None, format_str=None): """Produce a fake list of files spanning a year""" index = pds.date_range(pysat.datetime(2017,12,1), pysat.datetime(2018,12,1)) # file list is effectively just the date in string format - '%D' works only in Mac. '%x' workins in bo...
Add attitude vectors for spacecraft assuming ram pointing. Presumes spacecraft is pointed along the velocity vector ( x ) z is generally nadir pointing ( positive towards Earth ) and y completes the right handed system ( generally southward ). Notes ----- Expects velocity and position of spacecraft in Earth Centered Ea...
def add_sc_attitude_vectors(inst): """ Add attitude vectors for spacecraft assuming ram pointing. Presumes spacecraft is pointed along the velocity vector (x), z is generally nadir pointing (positive towards Earth), and y completes the right handed system (generally southward). ...
Calculates spacecraft velocity in ECEF frame. Presumes that the spacecraft velocity in ECEF is in the input instrument object as position_ecef_ *. Uses a symmetric difference to calculate the velocity thus endpoints will be set to NaN. Routine should be run using pysat data padding feature to create valid end points. P...
def calculate_ecef_velocity(inst): """ Calculates spacecraft velocity in ECEF frame. Presumes that the spacecraft velocity in ECEF is in the input instrument object as position_ecef_*. Uses a symmetric difference to calculate the velocity thus endpoints will be set to NaN. Routine should b...
Uses Apexpy package to add quasi - dipole coordinates to instrument object. The Quasi - Dipole coordinate system includes both the tilt and offset of the geomagnetic field to calculate the latitude longitude and local time of the spacecraft with respect to the geomagnetic field. This system is preferred over AACGM near...
def add_quasi_dipole_coordinates(inst, glat_label='glat', glong_label='glong', alt_label='alt'): """ Uses Apexpy package to add quasi-dipole coordinates to instrument object. The Quasi-Dipole coordinate system includes both the tilt and offset of the geomag...
Uses AACGMV2 package to add AACGM coordinates to instrument object. The Altitude Adjusted Corrected Geomagnetic Coordinates library is used to calculate the latitude longitude and local time of the spacecraft with respect to the geomagnetic field. Example ------- # function added velow modifies the inst object upon eve...
def add_aacgm_coordinates(inst, glat_label='glat', glong_label='glong', alt_label='alt'): """ Uses AACGMV2 package to add AACGM coordinates to instrument object. The Altitude Adjusted Corrected Geomagnetic Coordinates library is used to calculate the latitud...
Uses IRI ( International Reference Ionosphere ) model to simulate an ionosphere. Uses pyglow module to run IRI. Configured to use actual solar parameters to run model. Example ------- # function added velow modifies the inst object upon every inst. load call inst. custom. add ( add_iri_thermal_plasma modify glat_label ...
def add_iri_thermal_plasma(inst, glat_label='glat', glong_label='glong', alt_label='alt'): """ Uses IRI (International Reference Ionosphere) model to simulate an ionosphere. Uses pyglow module to run IRI. Configured to use actual solar parameters to run model. ...
Uses HWM ( Horizontal Wind Model ) model to obtain neutral wind details. Uses pyglow module to run HWM. Configured to use actual solar parameters to run model. Example ------- # function added velow modifies the inst object upon every inst. load call inst. custom. add ( add_hwm_winds_and_ecef_vectors modify glat_label ...
def add_hwm_winds_and_ecef_vectors(inst, glat_label='glat', glong_label='glong', alt_label='alt'): """ Uses HWM (Horizontal Wind Model) model to obtain neutral wind details. Uses pyglow module to run HWM. Configured to use actual solar parameters to run m...
Uses International Geomagnetic Reference Field ( IGRF ) model to obtain geomagnetic field values. Uses pyglow module to run IGRF. Configured to use actual solar parameters to run model. Example ------- # function added velow modifies the inst object upon every inst. load call inst. custom. add ( add_igrf modify glat_la...
def add_igrf(inst, glat_label='glat', glong_label='glong', alt_label='alt'): """ Uses International Geomagnetic Reference Field (IGRF) model to obtain geomagnetic field values. Uses pyglow module to run IGRF. Configured to use actual solar parameters to run ...
Uses MSIS model to obtain thermospheric values. Uses pyglow module to run MSIS. Configured to use actual solar parameters to run model. Example ------- # function added velow modifies the inst object upon every inst. load call inst. custom. add ( add_msis modify glat_label = custom_label ) Parameters ---------- inst: p...
def add_msis(inst, glat_label='glat', glong_label='glong', alt_label='alt'): """ Uses MSIS model to obtain thermospheric values. Uses pyglow module to run MSIS. Configured to use actual solar parameters to run model. Example ------- # f...
Express input vector using s/ c attitude directions x - ram pointing y - generally southward z - generally nadir Parameters ---------- x_label: string Label used to get ECEF - X component of vector to be projected y_label: string Label used to get ECEF - Y component of vector to be projected z_label: string Label used ...
def project_ecef_vector_onto_sc(inst, x_label, y_label, z_label, new_x_label, new_y_label, new_z_label, meta=None): """Express input vector using s/c attitude directions x - ram pointing y - generally southward z - generally nadir ...
Return scatterplot of data_label ( s ) as functions of labelx y over a season.
def scatterplot(inst, labelx, labely, data_label, datalim, xlim=None, ylim=None): """Return scatterplot of data_label(s) as functions of labelx,y over a season. Parameters ---------- labelx : string data product for x-axis labely : string data product for y-axis data_label : s...
Enable console logging.
def enable_log(level=logging.DEBUG): """Enable console logging. This is a utils method for try run with storops. :param level: log level, default to DEBUG """ logger = logging.getLogger(__name__) logger.setLevel(level) if not logger.handlers: logger.info('enabling logging to console...
Return a Pandas Series of every file for chosen satellite data
def list_files(tag=None, sat_id=None, data_path=None, format_str=None): """Return a Pandas Series of every file for chosen satellite data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '' and 'ascii'. If '' is specified, the primary d...
Loads a list of COSMIC data files supplied by user. Returns a list of dicts a dict for each file.
def load_files(files, tag=None, sat_id=None, altitude_bin=None): '''Loads a list of COSMIC data files, supplied by user. Returns a list of dicts, a dict for each file. ''' output = [None]*len(files) drop_idx = [] for (i,file) in enumerate(files): try: #data = net...
round the number to the multiple of 60
def round_60(value): """ round the number to the multiple of 60 Say a random value is represented by: 60 * n + r n is an integer and r is an integer between 0 and 60. if r < 30, the result is 60 * n. otherwise, the result is 60 * (n + 1) The use of this function is that the counter refreshment...
calculate the utilization
def utilization(prev, curr, counters): """ calculate the utilization delta_busy = curr.busy - prev.busy delta_idle = curr.idle - prev.idle utilization = delta_busy / (delta_busy + delta_idle) :param prev: previous resource :param curr: current resource :param counters: list of two, busy ti...
calculate the delta per second of one counter
def delta_ps(prev, curr, counters): """ calculate the delta per second of one counter formula: (curr - prev) / delta_time :param prev: previous resource :param curr: current resource :param counters: the counter to do delta and per second, one only :return: value, NaN if invalid. """ co...
calculate the io size based on bandwidth and throughput
def io_size_kb(prev, curr, counters): """ calculate the io size based on bandwidth and throughput formula: average_io_size = bandwidth / throughput :param prev: prev resource, not used :param curr: current resource :param counters: two stats, bandwidth in MB and throughput count :return: value,...
Return a Pandas Series of every file for chosen satellite data
def list_files(tag='', sat_id=None, data_path=None, format_str=None): """Return a Pandas Series of every file for chosen satellite data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '' and 'ascii'. If '' is specified, the primary dat...
Load CHAMP STAR files
def load(fnames, tag=None, sat_id=None): """Load CHAMP STAR files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns -----...
Assign all external science instrument methods to Instrument object.
def _assign_funcs(self, by_name=False, inst_module=None): """Assign all external science instrument methods to Instrument object. """ import importlib # set defaults self._list_rtn = self._pass_func self._load_rtn = self._pass_func self._default_rtn = self...
Load data for an instrument on given date or fid dependng upon input.
def _load_data(self, date=None, fid=None): """ Load data for an instrument on given date or fid, dependng upon input. Parameters ------------ date : (dt.datetime.date object or NoneType) file date fid : (int or NoneType) filename index value ...
Load the next days data ( or file ) without incrementing the date. Repeated calls will not advance date/ file and will produce the same data Uses info stored in object to either increment the date or the file. Looks for self. _load_by_date flag.
def _load_next(self): """Load the next days data (or file) without incrementing the date. Repeated calls will not advance date/file and will produce the same data Uses info stored in object to either increment the date, or the file. Looks for self._load_by_date flag. ...
Load the next days data ( or file ) without decrementing the date. Repeated calls will not decrement date/ file and will produce the same data Uses info stored in object to either decrement the date or the file. Looks for self. _load_by_date flag.
def _load_prev(self): """Load the next days data (or file) without decrementing the date. Repeated calls will not decrement date/file and will produce the same data Uses info stored in object to either decrement the date, or the file. Looks for self._load_by_date flag. ...
Load instrument data into Instrument object. data.
def load(self, yr=None, doy=None, date=None, fname=None, fid=None, verifyPad=False): """Load instrument data into Instrument object .data. Parameters ---------- yr : integer year for desired data doy : integer day of year date : date...
Download data for given Instrument object from start to stop. Parameters ---------- start: pandas. datetime start date to download data stop: pandas. datetime stop date to download data freq: string Stepsize between dates for season D for daily M monthly ( see pandas ) user: string username if required by instrument da...
def download(self, start, stop, freq='D', user=None, password=None, **kwargs): """Download data for given Instrument object from start to stop. Parameters ---------- start : pandas.datetime start date to download data stop : pandas.datetime ...
Manually iterate through the data loaded in Instrument object. Bounds of iteration and iteration type ( day/ file ) are set by bounds attribute. Note ---- If there were no previous calls to load then the first day ( default )/ file will be loaded.
def next(self, verifyPad=False): """Manually iterate through the data loaded in Instrument object. Bounds of iteration and iteration type (day/file) are set by `bounds` attribute. Note ---- If there were no previous calls to load then the first...
Determines the two - character type code for a given variable type
def _get_var_type_code(self, coltype): '''Determines the two-character type code for a given variable type Parameters ---------- coltype : type or np.dtype The type of the variable Returns ------- str The variable type code for the given ...
Support file writing by determiniing data type and other options
def _get_data_info(self, data, file_format): """Support file writing by determiniing data type and other options Parameters ---------- data : pandas object Data to be written file_format : basestring String indicating netCDF3 or netCDF4 Returns ...
Filter metadata properties to be consistent with netCDF4. Notes ----- removed forced to True if coltype consistent with a string type Parameters ---------- mdata_dict: dict Dictionary equivalent to Meta object info coltype: type Type provided by _get_data_info remove: boolean ( False ) Removes FillValue and associated ...
def _filter_netcdf4_metadata(self, mdata_dict, coltype, remove=False): """Filter metadata properties to be consistent with netCDF4. Notes ----- removed forced to True if coltype consistent with a string type Parameters ---------- mdata_dict : dic...
Translates the metadate contained in an object into a dictionary suitable for export.
def generic_meta_translator(self, meta_to_translate): '''Translates the metadate contained in an object into a dictionary suitable for export. Parameters ---------- meta_to_translate : Meta The metadata object to translate Returns ------- dic...
Stores loaded data into a netCDF4 file. Parameters ---------- fname: string full path to save instrument object to base_instrument: pysat. Instrument used as a comparison only attributes that are present with self and not on base_instrument are written to netCDF epoch_name: str Label in file for datetime index of Instr...
def to_netcdf4(self, fname=None, base_instrument=None, epoch_name='Epoch', zlib=False, complevel=4, shuffle=True): """Stores loaded data into a netCDF4 file. Parameters ---------- fname : string full path to save instrument object to base_i...
Converter for alu hlu map
def to_alu_hlu_map(input_str): """Converter for alu hlu map Convert following input into a alu -> hlu map: Sample input: ``` HLU Number ALU Number ---------- ---------- 0 12 1 23 ``` ALU stands for array LUN number hlu stands...
Convert following input to disk indices
def to_disk_indices(value): """Convert following input to disk indices Sample input: ``` Disks: Bus 0 Enclosure 0 Disk 9 Bus 1 Enclosure 0 Disk 12 Bus 1 Enclosure 0 Disk 9 Bus 0 Enclosure 0 Disk 4 Bus 0 Enclosure 0 Disk 7 ``` :param value: disk list :return: disk indic...
convert a url to a host ( ip or domain )
def url_to_host(url): """convert a url to a host (ip or domain) :param url: url string :returns: host: domain name or ipv4/v6 address :rtype: str :raises: ValueError: given an illegal url that without a ip or domain name """ regex_url = r"([a-z][a-z0-9+\-.]*://)?" + \ r"([a...
parse host address to get domain name or ipv4/ v6 address cidr prefix and net mask code string if given a subnet address
def parse_host_address(addr): """ parse host address to get domain name or ipv4/v6 address, cidr prefix and net mask code string if given a subnet address :param addr: :type addr: str :return: parsed domain name/ipv4 address/ipv6 address, cidr prefix if there is, net m...
ipv4 cidr prefix to net mask
def ipv4_prefix_to_mask(prefix): """ ipv4 cidr prefix to net mask :param prefix: cidr prefix , rang in (0, 32) :type prefix: int :return: dot separated ipv4 net mask code, eg: 255.255.255.0 :rtype: str """ if prefix > 32 or prefix < 0: raise ValueError("invalid cidr prefix for i...
ipv6 cidr prefix to net mask
def ipv6_prefix_to_mask(prefix): """ ipv6 cidr prefix to net mask :param prefix: cidr prefix, rang in (0, 128) :type prefix: int :return: comma separated ipv6 net mask code, eg: ffff:ffff:ffff:ffff:0000:0000:0000:0000 :rtype: str """ if prefix > 128 or prefix < 0: r...
expand the LUN to a new size
def expand(self, new_size): """ expand the LUN to a new size :param new_size: new size in bytes. :return: the old size """ ret = self.size_total resp = self.modify(size=new_size) resp.raise_if_err() return ret
Primarily for puppet - unity use.
def update_hosts(self, host_names): """Primarily for puppet-unity use. Update the hosts for the lun if needed. :param host_names: specify the new hosts which access the LUN. """ if self.host_access: curr_hosts = [access.host.name for access in self.host_access] ...
Creates a replication session with a existing lun as destination.
def replicate(self, dst_lun_id, max_time_out_of_sync, replication_name=None, replicate_existing_snaps=None, remote_system=None): """ Creates a replication session with a existing lun as destination. :param dst_lun_id: destination lun id. :param max_ti...
Creates a replication session with destination lun provisioning.
def replicate_with_dst_resource_provisioning(self, max_time_out_of_sync, dst_pool_id, dst_lun_name=None, remote_system=None, ...
Returns the link aggregation object or the ethernet port object.
def get_physical_port(self): """Returns the link aggregation object or the ethernet port object.""" obj = None if self.is_link_aggregation(): obj = UnityLinkAggregation.get(self._cli, self.get_id()) else: obj = UnityEthernetPort.get(self._cli, self.get_id()) ...
Constructs an embeded object of UnityResourceConfig.
def to_embedded(pool_id=None, is_thin_enabled=None, is_deduplication_enabled=None, is_compression_enabled=None, is_backup_only=None, size=None, tiering_policy=None, request_id=None, src_id=None, name=None, default_sp=None, replication_resou...
Creates a replication session.
def create(cls, cli, src_resource_id, dst_resource_id, max_time_out_of_sync, name=None, members=None, auto_initiate=None, hourly_snap_replication_policy=None, daily_snap_replication_policy=None, replicate_existing_snaps=None, remote_system=None, ...
Create a replication session along with destination resource provisioning.
def create_with_dst_resource_provisioning( cls, cli, src_resource_id, dst_resource_config, max_time_out_of_sync, name=None, remote_system=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None, dst_resource_element...
Modifies properties of a replication session.
def modify(self, max_time_out_of_sync=None, name=None, hourly_snap_replication_policy=None, daily_snap_replication_policy=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None): """ Modifies proper...
Resumes a replication session.
def resume(self, force_full_copy=None, src_spa_interface=None, src_spb_interface=None, dst_spa_interface=None, dst_spb_interface=None): """ Resumes a replication session. This can be applied on replication session when it's operational status is reported as...
Fails over a replication session.
def failover(self, sync=None, force=None): """ Fails over a replication session. :param sync: True - sync the source and destination resources before failing over the asynchronous replication session or keep them in sync after failing over the synchronous replication ses...
Fails back a replication session.
def failback(self, force_full_copy=None): """ Fails back a replication session. This can be applied on a replication session that is failed over. Fail back will synchronize the changes done to original destination back to original source site and will restore the original direct...
Prepares data structure for breaking data into orbits. Not intended for end user.
def _calcOrbits(self): """Prepares data structure for breaking data into orbits. Not intended for end user.""" # if the breaks between orbit have not been defined, define them # also, store the data so that grabbing different orbits does not # require reloads of whole dataset ...
Determine where breaks in an equatorial satellite orbit occur.
def _equaBreaks(self, orbit_index_period=24.): """Determine where breaks in an equatorial satellite orbit occur. Looks for negative gradients in local time (or longitude) as well as breaks in UT. Parameters ---------- orbit_index_period : float The change in...
Determine where breaks in a polar orbiting satellite orbit occur.
def _polarBreaks(self): """Determine where breaks in a polar orbiting satellite orbit occur. Looks for sign changes in latitude (magnetic or geographic) as well as breaks in UT. """ if self.orbit_index is None: raise ValueError('Orbit properties must be defined at ...
Determine where orbital breaks in a dataset with orbit numbers occur.
def _orbitNumberBreaks(self): """Determine where orbital breaks in a dataset with orbit numbers occur. Looks for changes in unique values. """ if self.orbit_index is None: raise ValueError('Orbit properties must be defined at ' + 'pysat.Instrum...
Load a particular orbit into. data for loaded day.
def _getBasicOrbit(self, orbit=None): """Load a particular orbit into .data for loaded day. Parameters ---------- orbit : int orbit number, 1 indexed, negative indexes allowed, -1 last orbit Note ---- A day of data must be loaded before this routine ...
Load a particular orbit into. data for loaded day.
def load(self, orbit=None): """Load a particular orbit into .data for loaded day. Parameters ---------- orbit : int orbit number, 1 indexed Note ---- A day of data must be loaded before this routine functions properly. If the last orbit o...
Load the next orbit into. data.
def next(self, *arg, **kwarg): """Load the next orbit into .data. Note ---- Forms complete orbits across day boundaries. If no data loaded then the first orbit from the first date of data is returned. """ # first, check if data exists if not self.sat.emp...
Load Kp index files
def load(fnames, tag=None, sat_id=None): """Load Kp index files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns -------...
Basic parser to deal with date format of the Kp file.
def _parse(yr, mo, day): """ Basic parser to deal with date format of the Kp file. """ yr = '20'+yr yr = int(yr) mo = int(mo) day = int(day) return pds.datetime(yr, mo, day)
Load Kp index files
def load(fnames, tag=None, sat_id=None): """Load Kp index files Parameters ------------ fnames : (pandas.Series) Series of filenames tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) Returns -------...
Routine to download Kp index data
def download(date_array, tag, sat_id, data_path, user=None, password=None): """Routine to download Kp index data Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are '1min' and '5min'. (default=None) sat_id : (string or NoneType) ...
Filters pysat. Instrument data for given time after Kp drops below gate. Loads Kp data for the same timeframe covered by sat and sets sat. data to NaN for times when Kp > maxKp and for filterTime after Kp drops below maxKp. Parameters ---------- sat: pysat. Instrument Instrument to be filtered maxKp: float Maximum Kp v...
def filter_geoquiet(sat, maxKp=None, filterTime=None, kpData=None, kp_inst=None): """Filters pysat.Instrument data for given time after Kp drops below gate. Loads Kp data for the same timeframe covered by sat and sets sat.data to NaN for times when Kp > maxKp and for filterTime after Kp drops below max...
find converter function reference by name
def _get_converter(self, converter_str): """find converter function reference by name find converter by name, converter name follows this convention: Class.method or: method The first type of converter class/function must be available in current modul...
scp the local file to remote folder.
def copy_file_to_remote(self, local_path, remote_path): """scp the local file to remote folder. :param local_path: local path :param remote_path: remote path """ sftp_client = self.transport.open_sftp_client() LOG.debug('Copy the local file to remote. ' ...
Fetch remote File.
def get_remote_file(self, remote_path, local_path): """Fetch remote File. :param remote_path: remote path :param local_path: local path """ sftp_client = self.transport.open_sftp_client() LOG.debug('Get the remote file. ' 'Source=%(src)s. Target=%(targe...
Closes the ssh connection.
def close(self): """Closes the ssh connection.""" if 'isLive' in self.__dict__ and self.isLive: self.transport.close() self.isLive = False
indicate the return value is a xml api request
def xml_request(check_object=False, check_invalid_data_mover=False): """ indicate the return value is a xml api request :param check_invalid_data_mover: :param check_object: :return: the response of this request """ def decorator(f): @functools.wraps(f) def func_wrapper(self, *...
indicate it s a command of nas command run with ssh
def nas_command(f): """ indicate it's a command of nas command run with ssh :param f: function that returns the command in list :return: command execution result """ @functools.wraps(f) def func_wrapper(self, *argv, **kwargs): commands = f(self, *argv, **kwargs) return self.ssh...
Restore the snapshot to the associated storage resource.
def restore(self, backup=None, delete_backup=False): """Restore the snapshot to the associated storage resource. :param backup: name of the backup snapshot :param delete_backup: Whether to delete the backup snap after a successful restore. """ resp ...
Creates a new thin clone from this snapshot... note:: this snapshot should not enable Auto - Delete.
def thin_clone(self, name, io_limit_policy=None, description=None): """Creates a new thin clone from this snapshot. .. note:: this snapshot should not enable Auto-Delete. """ if self.is_member_snap(): raise UnityCGMemberActionNotSupportError() if self.lun and not sel...
Deletes the snapshot.
def delete(self, async_mode=False, even_attached=False): """Deletes the snapshot. :param async_mode: whether to delete the snapshot in async mode. :param even_attached: whether to delete the snapshot even it is attached to hosts. """ try: return super(Uni...
Get the resource by resource id.
def get_all(self, type_name, base_fields=None, the_filter=None, nested_fields=None): """Get the resource by resource id. :param nested_fields: nested resource fields :param base_fields: fields of this resource :param the_filter: dictionary of filter like `{'name': 'abc'}...
Get the resource by resource id.
def get(self, type_name, obj_id, base_fields=None, nested_fields=None): """Get the resource by resource id. :param nested_fields: nested resource fields. :param type_name: Resource type. For example, pool, lun, nasServer. :param obj_id: Resource id :param base_fields: Resource f...
Flat the virtual ports.
def _flat_vports(self, connection_port): """Flat the virtual ports.""" vports = [] for vport in connection_port.virtual_ports: self._set_child_props(connection_port, vport) vports.append(vport) return vports