| 50 | |
| 51 | == Python module == |
| 52 | |
| 53 | The repository includes a genericio Python module that can read genericio-formatted files and return numpy arrays. This is included in the standard build. To use it, once you've built genericio, you can read genericio data as follows: |
| 54 | |
| 55 | {{{ |
| 56 | $ export PYTHONPATH=${GENERICIO_DIR}/python |
| 57 | $ python |
| 58 | >>> import genericio |
| 59 | >>> genericio.gio_inspect('m000-99.fofproperties') |
| 60 | Number of Elements: 1691 |
| 61 | [data type] Variable name |
| 62 | --------------------------------------------- |
| 63 | [i 32] fof_halo_count |
| 64 | [i 64] fof_halo_tag |
| 65 | [f 32] fof_halo_mass |
| 66 | [f 32] fof_halo_mean_x |
| 67 | [f 32] fof_halo_mean_y |
| 68 | [f 32] fof_halo_mean_z |
| 69 | [f 32] fof_halo_mean_vx |
| 70 | [f 32] fof_halo_mean_vy |
| 71 | [f 32] fof_halo_mean_vz |
| 72 | [f 32] fof_halo_vel_disp |
| 73 | |
| 74 | (i=integer,f=floating point, number bits size) |
| 75 | >>> genericio.gio_read('m000-99.fofproperties','fof_halo_mass') |
| 76 | array([[ 4.58575588e+13], |
| 77 | [ 5.00464689e+13], |
| 78 | [ 5.07078771e+12], |
| 79 | ..., |
| 80 | [ 1.35221006e+13], |
| 81 | [ 5.29125710e+12], |
| 82 | [ 7.12849857e+12]], dtype=float32) |
| 83 | |
| 84 | }}} |