def order_vars(self): """ Return the order variables object. This instance is generated when data is ordered from the NSIDC. See Also -------- variables.Variables Examples -------- >>> reg_a = ipx.Query('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-28']) # doctest: +SKIP >>> reg_a.earthdata_login(user_id,user_email) # doctest: +SKIP Earthdata Login password: ········ >>> reg_a.order_vars # doctest: +SKIP <icepyx.core.variables.Variables at [location]> """ if not hasattr(self, "_order_vars"): if self._source == "order": # DevGoal: check for active session here if hasattr(self, "_cust_options"): self._order_vars = Variables( self._source, session=self._session, product=self.product, avail=self._cust_options["variables"], ) else: self._order_vars = Variables( self._source, session=self._session, product=self.product, version=self._version, ) # I think this is where property setters come in, and one should be used here? Right now order_vars.avail is only filled in # if _cust_options exists when the class is initialized, but not if _cust_options is filled in prior to another call to order_vars # if self._order_vars.avail == None and hasattr(self, '_cust_options'): # print('got into the loop') # self._order_vars.avail = self._cust_options['variables'] return self._order_vars
def vars(self): """ Return the variables object associated with the data being read in. This instance is generated from the source file or first file in a list of input files (when source is a directory). See Also -------- variables.Variables Examples -------- >>> reader = ipx.Read(path_root, "ATL06", pattern) # doctest: +SKIP >>> reader.vars # doctest: +SKIP <icepyx.core.variables.Variables at [location]> """ if not hasattr(self, "_read_vars"): self._read_vars = Variables("file", path=self._filelist[0], product=self._prod) return self._read_vars
def file_vars(self): """ Return the file variables object. This instance is generated when files are used to create the data object (not yet implemented). See Also -------- variables.Variables Examples -------- >>> reg_a = ipx.Query('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-28']) # doctest: +SKIP >>> reg_a.earthdata_login(user_id,user_email) # doctest: +SKIP Earthdata Login password: ········ >>> reg_a.file_vars # doctest: +SKIP <icepyx.core.variables.Variables at [location]> """ if not hasattr(self, "_file_vars"): if self._source == "file": self._file_vars = Variables(self._source, product=self.product) return self._file_vars
def file_vars(self): """ Return the file variables object. This instance is generated when files are used to create the data object (not yet implemented). See Also -------- variables.Variables Examples -------- >>> reg_a = icepyx.icesat2data.Icesat2Data('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-28']) >>> reg_a.earthdata_login(user_id,user_email) Earthdata Login password: ········ >>> reg_a.file_vars <icepyx.core.variables.Variables at [location]> """ if not hasattr(self, '_file_vars'): if self._source == 'file': self._file_vars = Variables(self._source, dataset=self.dataset) return self._file_vars