void RotatingCube::RotateMyCube ( H5File &h5_local_ref, int total_blocks, const char *cube_name, const char *cube_description ) { char s[128]; string str; for ( int i=0; i<total_blocks; i++ ) { sprintf ( s,"%s/block_%04d",cube_name, i ); H5DataSet *ptr = h5_local_ref.CreateDataSet ( s, source, 3 ); sprintf ( s,"%s",cube_description ); h5_local_ref.CreateAttribute ( ptr->getDataSetId(),"description",s ); h5_local_ref.makeParamNames ( "ndx_",source.GetNumZ(),str ); h5_local_ref.CreateAttribute ( ptr->getDataSetId(),"paramNames",str.c_str() ); h5_vec.push_back ( ptr ); } }
// set up a basic data cube + matched h5 set //@TODO: use templates to avoid "INT" duplication void MatchedCubeInt::InitBasicCube ( H5File &h5_local_ref, int col, int row, int maxflows, const char *set_name, const char *set_description, const char *param_root ) { //printf ( "%s\n",set_name ); string str; source.Init ( col, row, maxflows ); source.SetRange ( 0,col, 0, row, 0, maxflows ); source.AllocateBuffer(); h5_set = h5_local_ref.CreateDataSet ( set_name, source, 3 ); h5_local_ref.CreateAttribute ( h5_set->getDataSetId(),"description",set_description ); // either we're just using the axis for nothing special if ( strlen ( param_root ) <1 ) { h5_local_ref.makeParamNames ( "ndx_",maxflows, str ); } else { // or we have a specific set of variables for this axis str = param_root; } h5_local_ref.CreateAttribute ( h5_set->getDataSetId(),"paramNames",str.c_str() ); }