# Field Export Postprocess See the [Field Exports reference](../../reference/field_exports.md) for signatures and parameter descriptions. ## Basic Field Operations The {class}`PostprocessRecord ` contains the field export. You can use the record for basic exports. See the [Field Exports reference](../../reference/field_exports.md) for the complete method signatures and supported projections. The field-export status is reported by {meth}`is_field_export() `. ```python field_record = results.postprocesses[2] print(field_record.is_field_export()) # True print(field_record) # PostprocessRecord( # source_file: /home/.../fieldbag_cartesian.jcm # title: fieldbag_cartesian # status: available # preview: # view: complete # indices: (0, 1) # coordinates: X=(200, 200), Y=(200, 200) # field_shape: (200, 200, 3) # derivatives: () # transforms: () # ) ``` Access the field export through {attr}`field_record.fields `. The `fields` attribute returns the field data for this postprocess. ```python fields = field_record.fields print(fields) # FieldExportPayload( # view: complete # indices: (0, 1) # coordinates: X=(200, 200), Y=(200, 200) # field_shape: (200, 200, 3) # derivatives: () # transforms: () # ) ``` Field exports support non-empty combinations of Cartesian coordinates `X`, `Y`, and `Z`, and polar coordinates `R`, `Theta`, and `Phi`. Dictionary and xarray exports retain the original coordinate names. They do not convert polar coordinates to Cartesian coordinates. Singleton coordinates from squeezed data are removed as dimensions. Use the `full` loader format to retain them. The {term}`project` has two sources, so two field indices are available. The available positions are returned by {attr}`indices `. ```python print(fields.indices) # (0, 1) ``` Select the first field index with {meth}`select() `. The method returns a selection with that field only. ```python selected_field = fields.select(0) print(selected_field) # FieldExportPayload( # view: complete # indices: (0,) # coordinates: X=(200, 200), Y=(200, 200) # field_shape: (200, 200, 3) # derivatives: () # transforms: () # ) ``` An unselected xarray export has a `field_index` dimension and coordinate for all available fields. An explicitly selected export has neither. Use {meth}`transform() ` to transform field values. ```python phase_base = selected_field.transform("phase") print(phase_base) # FieldExportPayload( # view: complete # indices: (0,) # coordinates: X=(200, 200), Y=(200, 200) # field_shape: (200, 200, 3) # derivatives: () # transforms: ('phase',) # ) ``` You can chain transformations. ```python abs_phase_base = phase_base.transform("abs") print(abs_phase_base) # FieldExportPayload( # view: complete # indices: (0,) # coordinates: X=(200, 200), Y=(200, 200) # field_shape: (200, 200, 3) # derivatives: () # transforms: ('phase', 'abs') # ) ``` ## Intensity The {attr}`intensity ` view returns the squared norm. For a scalar field, this is its squared absolute value. For a vector field, this is the sum of squared absolute component values. The xarray export is real-valued and has no `component` dimension. ```python intensity = fields.intensity.base.select(0) intensity_tree = intensity.to_xarray() ``` The intensity view supports base access and field selection, but not further transforms: it already contains derived scalar data. For {term}`batched project keys`, use {attr}`BatchPostprocessRecord.fields `. The export retains `batch_index` and availability information. ```python batch_intensity = batch_results.postprocesses[2].fields.intensity.base.select(0) batch_intensity_tree = batch_intensity.to_xarray() ```