Data-processing services

class astrophysix.simdm.services.process.DataProcessingService(**kwargs)

Data processing service description defining a service name and a data host server name. Use it to bind a Snapshot to a specific data-processing service on Galactica.

Parameters
  • service_name (string) – data processing service name (mandatory)

  • data_host (string) – data host server name name (mandatory)

Example

>>> # To bind a given simulation snapshot to a data-processing service :
>>> sn = Snapshot(name="Third pericenter", time=(254.7, U.Myr),
...               data_reference="output_00034")
>>> serv = DataProcessingService(service_name="ray_tracer_amr",
...                              data_host="my_institute_cluster")
>>> sn.processing_services.add(serv)
__eq__(other)

DataProcessingService comparison method

other: DataProcessingService

Data processing service to compare to

__ne__(other)

Not an implied relationship between “rich comparison” equality methods in Python 2.X but only in Python 3.X see https://docs.python.org/2.7/reference/datamodel.html#object.__ne__

other: other instance to compare to

__unicode__()

String representation of the instance

property data_host

Data processing service host server name

galactica_valid_alias(alias_value)
galactica_validity_check(**kwargs)

Perform validity checks on this instance and eventually log warning messages.

Parameters

kwargs (dict) – keyword arguments (optional)

property hosted_service

Data processing service full description service_name @ data_host

property service_name

Data processing service name

property uid
class astrophysix.simdm.services.process.CatalogDataProcessingService(**kwargs)

Catalog item-bound data-processing service defining a service name and a data host server name. Use it to bind a Catalog to a specific data-processing service on Galactica.

Parameters
  • service_name (string) – data processing service name (mandatory)

  • data_host (string) – data host server name name (mandatory)

Example

>>> # Define a catalog
>>> cat = Catalog(target_object=gal_cluster, name="Galaxy cluster catalog")
>>>
>>> # To bind a given object catalog to a data-processing service :
>>> cat_dps = CatalogDataProcessingService(service_name="slice_map",
...                                        data_host="Lab_Cluster")
>>> cat.processing_services.add(cat_dps)
__eq__(other)

CatalogDataProcessingService comparison method

other: CatalogDataProcessingService

Data processing service to compare to

__ne__(other)

Not an implied relationship between “rich comparison” equality methods in Python 2.X but only in Python 3.X see https://docs.python.org/2.7/reference/datamodel.html#object.__ne__

other: other instance to compare to

__unicode__()

String representation of the instance

property catalog_field_bindings

Catalog data processing service list of catalog field bindings

property data_host

Data processing service host server name

galactica_valid_alias(alias_value)
galactica_validity_check(**kwargs)

Perform validity checks on this instance and eventually log warning messages.

Parameters

kwargs (dict) – keyword arguments (optional)

property hosted_service

Data processing service full description service_name @ data_host

property service_name

Data processing service name

property uid
class astrophysix.simdm.services.process.CatalogFieldBinding(*args, **kwargs)

Service input parameter - catalog field value binding for (catalog-bound) data processing services. The applied scaling formula is : \(\textrm{param_value} = \textrm{scale} \times \textrm{field_value} + \textrm{offset}\).

Parameters
  • catalog_field (CatalogField) – bound catalog field (mandatory)

  • param_key (string) – data processing service input parameter key (mandatory)

  • scale (float) – field value to service parameter scaling factor. Default 1.0

  • offset (: obj:float) – field value to service parameter offset value. Default 0.0

Example

>>> # Define a catalog
>>> cat = Catalog(target_object=gal_cluster, name="Galaxy cluster catalog")
>>> # Add the catalog fields into the catalog (100 clusters)
>>> fx = cat.catalog_fields.add(CatalogField(x, values=N.random.uniform(size=100)))
>>> fy = cat.catalog_fields.add(CatalogField(y, values=N.random.uniform(size=100)))
>>> fz = cat.catalog_fields.add(CatalogField(z, values=N.random.uniform(size=100)))
>>> fm = cat.catalog_fields.add(CatalogField(m, values=N.random.uniform(size=100)))
>>> # To bind a given object catalog to a data-processing service :
>>> cat_dps = CatalogDataProcessingService(service_name="slice_map",
...                                     data_host="Lab_Cluster")
>>> cat.processing_services.add(cat_dps)
>>>
>>> # Define catalog field bindings to automatically fill the data processing service
>>> # parameter value 'pv' with a catalog field value 'fv' of one of your catalog's object
>>> # according to the formula : pv = scale * fv + offset.
>>> fbx = CatalogFieldBinding(catalog_field=fx, param_key="x", scale=1.0e2, offset=-50.0))
>>> fby = CatalogFieldBinding(catalog_field=fy, param_key="y", scale=1.0e2, offset=-50.0))
>>> fbz = CatalogFieldBinding(catalog_field=fz, param_key="z", scale=1.0e2, offset=-50.0))
>>> cat_dps.catalog_field_bindings.add(fbx)
>>> cat_dps.catalog_field_bindings.add(fby)
>>> cat_dps.catalog_field_bindings.add(fbz)
__eq__(other)

CatalogDataProcessingService comparison method

other: CatalogFieldBinding

catalog field binding to compare to

__ne__(other)

Not an implied relationship between “rich comparison” equality methods in Python 2.X but only in Python 3.X see https://docs.python.org/2.7/reference/datamodel.html#object.__ne__

other: other instance to compare to

__unicode__()

String representation of the instance

property catalog_field

Associated catalog field (CatalogField). Cannot be edited.

property field_property_name

Associated catalog field’s target object property name. Cannot be edited

galactica_valid_alias(alias_value)
galactica_validity_check(**kwargs)

Perform validity checks on this instance and eventually log warning messages.

Parameters

kwargs (dict) – keyword arguments (optional)

property offset

Returns the offset to apply between the catalog field value and input value provided to the data-processing service parameter value. Can be edited.

property param_key

Data processing service parameter key. Can be edited.

property scale

Returns the scaling factor to apply between the catalog field value and input value provided to the data-processing service parameter value. Can be edited.

property uid