def LoadMAGIKPSD(fileinfo=None, collapse=True, collapse_axis='y', auto_PolState=False, PolState='', flip=True, transpose=True): """ loads a data file into a MetaArray and returns that. Checks to see if data being loaded is 2D; if not, quits Need to rebin and regrid if the detector is moving... **Inputs** fileinfo (fileinfo): File to open. collapse {Collapse along one of the axes} (bool): sum over axis of detector collapse_axis {number index of axis to collapse along} (opt:x|y): axis to sum over auto_PolState {Automatic polarization identify} (bool): automatically determine the polarization state from entry name PolState (str): polarization state if not automatically detected flip (bool): flip the data up and down transpose (bool): transpose the data **Returns** output (ospec2d[]): all the entries loaded. 2016-04-02 Brian Maranville """ from dataflow.modules.load import url_get path, mtime, entries = fileinfo['path'], fileinfo['mtime'], fileinfo['entries'] name = basename(path) fid = StringIO.StringIO(url_get(fileinfo)) file_obj = h5_open_zip(name, fid) return loadMAGIKPSD_helper(file_obj, name, path, collapse=collapse, collapse_axis=collapse_axis, auto_PolState=auto_PolState, PolState=PolState, flip=flip, transpose=transpose)
def LoadMAGIKPSDFile(path, **kw): return loadMAGIKPSD_helper(h5_open_zip(path), path, path, **kw)