data_models/data_model_helpers.py
def buffer_data_model_to_memory(jbuff, dm):
    """Copy a buffer data model into memory data model

    The file type is derived from the file extension. All are hdf only with the exception of Imaghe which can also be
    fits.

    :param jbuff: JSON describing buffer
    :param dm: JSON describing data model
    :return: data model
    """
    import os
    name = os.path.join(jbuff["directory"], dm["name"])
    
    import os
    _, file_extension = os.path.splitext(dm["name"])
    
    if dm["data_model"] == "BlockVisibility":
        return import_blockvisibility_from_hdf5(name)
    elif dm["data_model"] == "Image":
        if file_extension == ".fits":
            return import_image_from_fits(name)
        else:
            return import_image_from_hdf5(name)
    elif dm["data_model"] == "SkyModel":
        return import_skymodel_from_hdf5(name)
    elif dm["data_model"] == "GainTable":
        return import_gaintable_from_hdf5(name)
    elif dm["data_model"] == "PointingTable":
        return import_pointingtable_from_hdf5(name)
    elif dm["data_model"] == "GridData":
        return import_griddata_from_hdf5(name)
    elif dm["data_model"] == "ConvolutionFunction":
        return import_convolutionfunction_from_hdf5(name)
    else:
        raise ValueError("Data model %s not supported" % dm["data_model"])
Copy a buffer data model into memory data model

    The file type is derived from the file extension. All are hdf only with the exception of Imaghe which can also be
    fits.

    :param jbuff: JSON describing buffer
    :param dm: JSON describing data model
    :return: data model
    
Copy a buffer data model into memory data model
The file type is derived from the file extension. All are hdf only with the exception of Imaghe which can also be
fits.
Copy a buffer data model into memory data model The file type is derived from the file extension . All are hdf only with the exception of Imaghe which can also be fits .
def buffer_data_model_to_memory(jbuff, dm):
    import os
    name = os.path.join(jbuff["directory"], dm["name"])
    import os
    _, file_extension = os.path.splitext(dm["name"])
    if dm["data_model"] == "BlockVisibility":
        return import_blockvisibility_from_hdf5(name)
    elif dm["data_model"] == "Image":
        if file_extension == ".fits":
            return import_image_from_fits(name)
        else:
            return import_image_from_hdf5(name)
    elif dm["data_model"] == "SkyModel":
        return import_skymodel_from_hdf5(name)
    elif dm["data_model"] == "GainTable":
        return import_gaintable_from_hdf5(name)
    elif dm["data_model"] == "PointingTable":
        return import_pointingtable_from_hdf5(name)
    elif dm["data_model"] == "GridData":
        return import_griddata_from_hdf5(name)
    elif dm["data_model"] == "ConvolutionFunction":
        return import_convolutionfunction_from_hdf5(name)
    else:
        raise ValueError("Data model %s not supported" % dm["data_model"])
def buffer_data_model_to_memory ( jbuff , dm ) : import os name = os . path . join ( jbuff [ "directory" ] , dm [ "name" ] ) import os _ , file_extension = os . path . splitext ( dm [ "name" ] ) if dm [ "data_model" ] == "BlockVisibility" : return import_blockvisibility_from_hdf5 ( name ) elif dm [ "data_model" ] == "Image" : if file_extension == ".fits" : return import_image_from_fits ( name ) else : return import_image_from_hdf5 ( name ) elif dm [ "data_model" ] == "SkyModel" : return import_skymodel_from_hdf5 ( name ) elif dm [ "data_model" ] == "GainTable" : return import_gaintable_from_hdf5 ( name ) elif dm [ "data_model" ] == "PointingTable" : return import_pointingtable_from_hdf5 ( name ) elif dm [ "data_model" ] == "GridData" : return import_griddata_from_hdf5 ( name ) elif dm [ "data_model" ] == "ConvolutionFunction" : return import_convolutionfunction_from_hdf5 ( name ) else : raise ValueError ( "Data model %s not supported" % dm [ "data_model" ] )
Copy a buffer data model into memory data model
The file type is derived from the file extension.
Copy a buffer data model into memory data model The file type is derived from the file extension .
"""Copy a buffer data model into memory data model

    The file type is derived from the file extension. All are hdf only with the exception of Imaghe which can also be
    fits.

    :param jbuff: JSON describing buffer
    :param dm: JSON describing data model
    :return: data model
    """
None
jbuff
JSON describing buffer
JSON describing buffer
dm
JSON describing data model
JSON describing data model