data_models/data_model_helpers.py
def memory_data_model_to_buffer(model, jbuff, dm):
    """ Copy a memory data model to a buffer 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 model: Memory data model to be sent to buffer
    :param jbuff: JSON describing buffer
    :param dm: JSON describing data model
    """
    name = jbuff["directory"] + dm["name"]
    
    import os
    _, file_extension = os.path.splitext(dm["name"])
    
    if dm["data_model"] == "BlockVisibility":
        return export_blockvisibility_to_hdf5(model, name)
    elif dm["data_model"] == "Image":
        if file_extension == ".fits":
            return export_image_to_fits(model, name)
        else:
            return export_image_to_hdf5(model, name)
    elif dm["data_model"] == "GridData":
        return export_griddata_to_hdf5(model, name)
    elif dm["data_model"] == "ConvolutionFunction":
        return export_convolutionfunction_to_hdf5(model, name)
    elif dm["data_model"] == "SkyModel":
        return export_skymodel_to_hdf5(model, name)
    elif dm["data_model"] == "GainTable":
        return export_gaintable_to_hdf5(model, name)
    elif dm["data_model"] == "PointingTable":
        return export_pointingtable_to_hdf5(model, name)
    else:
        raise ValueError("Data model %s not supported" % dm["data_model"])
 Copy a memory data model to a buffer 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 model: Memory data model to be sent to buffer
    :param jbuff: JSON describing buffer
    :param dm: JSON describing data model
    
Copy a memory data model to a buffer 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 memory data model to a buffer 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 memory_data_model_to_buffer(model, jbuff, dm):
    name = jbuff["directory"] + dm["name"]
    import os
    _, file_extension = os.path.splitext(dm["name"])
    if dm["data_model"] == "BlockVisibility":
        return export_blockvisibility_to_hdf5(model, name)
    elif dm["data_model"] == "Image":
        if file_extension == ".fits":
            return export_image_to_fits(model, name)
        else:
            return export_image_to_hdf5(model, name)
    elif dm["data_model"] == "GridData":
        return export_griddata_to_hdf5(model, name)
    elif dm["data_model"] == "ConvolutionFunction":
        return export_convolutionfunction_to_hdf5(model, name)
    elif dm["data_model"] == "SkyModel":
        return export_skymodel_to_hdf5(model, name)
    elif dm["data_model"] == "GainTable":
        return export_gaintable_to_hdf5(model, name)
    elif dm["data_model"] == "PointingTable":
        return export_pointingtable_to_hdf5(model, name)
    else:
        raise ValueError("Data model %s not supported" % dm["data_model"])
def memory_data_model_to_buffer ( model , jbuff , dm ) : name = jbuff [ "directory" ] + dm [ "name" ] import os _ , file_extension = os . path . splitext ( dm [ "name" ] ) if dm [ "data_model" ] == "BlockVisibility" : return export_blockvisibility_to_hdf5 ( model , name ) elif dm [ "data_model" ] == "Image" : if file_extension == ".fits" : return export_image_to_fits ( model , name ) else : return export_image_to_hdf5 ( model , name ) elif dm [ "data_model" ] == "GridData" : return export_griddata_to_hdf5 ( model , name ) elif dm [ "data_model" ] == "ConvolutionFunction" : return export_convolutionfunction_to_hdf5 ( model , name ) elif dm [ "data_model" ] == "SkyModel" : return export_skymodel_to_hdf5 ( model , name ) elif dm [ "data_model" ] == "GainTable" : return export_gaintable_to_hdf5 ( model , name ) elif dm [ "data_model" ] == "PointingTable" : return export_pointingtable_to_hdf5 ( model , name ) else : raise ValueError ( "Data model %s not supported" % dm [ "data_model" ] )
Copy a memory data model to a buffer data model
The file type is derived from the file extension.
Copy a memory data model to a buffer data model The file type is derived from the file extension .
""" Copy a memory data model to a buffer 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 model: Memory data model to be sent to buffer
    :param jbuff: JSON describing buffer
    :param dm: JSON describing data model
    """
model
Memory data model to be sent to buffer
Memory data model to be sent to buffer
jbuff
JSON describing buffer
JSON describing buffer
dm
JSON describing data model
JSON describing data model