A.STAR is a .Net library (programmed in C#) for STAR/CIF manipulation.
A.STAR features a object model for manipulating STAR/CIF data and object-oriented APIs for reading and writing STAR/CIF files.
Snippets (More):
C#:
... using AStar.Cif; ... CifPack pack = new CifPack("fa3203.cif"); Console.WriteLine("Formula: {0}", pack["I"]["_chemical_formula_sum"].Value); foreach(CifValue val in pack["I"]["_atom_site_U_iso_or_equiv"].List) { Console.WriteLine("Uiso/Ueq: {0} with s.u. ({1})", val.ToNumber(), val.ToMeasurand().Su); } ...
VB.Net:
... Imports AStar.Cif ... Dim pack As New CifPack("fa3203.cif") Console.WriteLine("Formula: {0}", pack("I")("_chemical_formula_sum").Value) For Each val As CifValue In pack("I")("_atom_site_U_iso_or_equiv").List Console.WriteLine("Uiso/Ueq: {0} with s.u. ({1})", val.ToNumber(), val.ToMeasurand().Su) Next ...
Python (IronPython):
... import clr clr.AddReference('AStar.dll') from AStar.Cif import * ... pack = CifPack('fa3203.cif') print 'Formula: %s' % pack['I']['_chemical_formula_sum'].Value for val in pack['I']['_atom_site_U_iso_or_equiv'].List: print 'Uiso/Ueq: %f with s.u. (%f)' % (val.ToNumber(), val.ToMeasurand().Su) ...
Ruby (IronRuby):
... require 'AStar.dll' include AStar::Cif ... pack = CifPack.new('fa3203.cif') printf("Formula: %s\n", pack['I']['_chemical_formula_sum'].Value) for val in pack['I']['_atom_site_U_iso_or_equiv'].List do printf("Uiso/Ueq: %f with s.u. (%f)\n", val.ToNumber(), val.ToMeasurand().Su) end ...
F#:
... open AStar.Cif ... let pack = CifPack("fa3203.cif") printfn "Formula: %s" (pack.["I"].["_chemical_formula_sum"].Value.ToString()) for v in pack.["I"].["_atom_site_U_iso_or_equiv"].List do printfn "Uiso/Ueq: %f with s.u. (%f)" (v.ToNumber()) (v.ToMeasurand().Su) ...
BOO:
... import AStar.Cif from 'AStar' ... pack = CifPack('fa3203.cif') Console.WriteLine('Formula: {0}', pack['I']['_chemical_formula_sum'].Value) for val as CifValue in pack['I']['_atom_site_U_iso_or_equiv'].List: Console.WriteLine('Uiso/Ueq: {0} with s.u. ({1})', val.ToNumber(), val.ToMeasurand().Su) ...
Go to the documentation page.
Download the source or binary distributions.