[Imgcif-l] [SPAM] ASSP Re: CBF adds new lines to character data

Michael Blum blum at rayonix.com
Thu Oct 16 03:08:49 BST 2008


Hi Herb,

Jeez, I had no idea what a deep subject this already was!  I thought I  
was just citing a bug.

Please don't go do a lot of work on this due to my question.   I think  
the read/write_widefile() calls
will fix my problem.  My interest is solely to be able to write a file  
that faithfully represents our data
and can be universally read.   I think our files will be read only be  
"modern" programs that are being
developed contemporaneously so I think  wide files will be OK.  I am  
going to assume that is true until
I get a complaint.

Thanks for your quick responses.

regards,

Michael

On Oct 15, 2008, at 8:10 PM, Herbert J. Bernstein wrote:

> Dear Michael,
>
>   The only reason we don't do it, is that nobody thought to
> ask for it in CBFlib.  We have it in a separate utility called
> CIFFOLD.  I'll add that into CBFlib when I get back from a talk
> I am giving in Dubuque this weekend.  If you need it sooner,
> the  is at
>
>  http://www.bernstein-plus-sons.com/software/ciffold/
>
> but that one is not prepared for the image portion of a CBF.
> I'll merge it into CBFlib, so it is image aware.
>
>   Regards,
>     Herbert
> =====================================================
>  Herbert J. Bernstein, Professor of Computer Science
>    Dowling College, Kramer Science Center, KSC 121
>         Idle Hour Blvd, Oakdale, NY, 11769
>
>                  +1-631-244-3035
>                  yaya at dowling.edu
> =====================================================
>
> On Wed, 15 Oct 2008, Michael Blum wrote:
>
>>
>> Thanks Herb - I'll switch to using _widefile - that should solve my
>> problem.
>>
>> But why doesn't cbflib "unfold" the lines again when it reads them?
>> Isn't the point of
>> escaping the extra newlines so they can be recognized and removed?
>>
>> Michael
>>
>>
>> On Oct 15, 2008, at 6:32 PM, Herbert J. Bernstein wrote:
>>
>>> There are two flavors of CIF -- the original 80 character line
>>> length CIFs that can be read by all parsers, and the newer 2048
>>> character line length CIFS that can be read by most newer parsers.
>>> CBFlib can handle either line length, but, if you are in the 80
>>> character mode and give it longer lines, it folds them with the
>>> backslash escape.  To avoid this, you need to tell it you want
>>> to use the longer line length, using cbf_write_widefile rather
>>> than cbf_write_file, and cbf_read_widefile instead of cbf_read_file.
>>>
>>> =====================================================
>>> Herbert J. Bernstein, Professor of Computer Science
>>>   Dowling College, Kramer Science Center, KSC 121
>>>        Idle Hour Blvd, Oakdale, NY, 11769
>>>
>>>                 +1-631-244-3035
>>>                 yaya at dowling.edu
>>> =====================================================
>>>
>>> On Wed, 15 Oct 2008, Michael Blum wrote:
>>>
>>>> Hi Herb et al,
>>>>
>>>> For testing our production of CBF files, I am converting our marccd
>>>> frames to CBF,  converting the CBF back to marccd, and
>>>> then doing a "diff" between the original and final marccd frame
>>>> files.  All interactions with the CBF file and data are done using
>>>> CBFlib.
>>>>
>>>> I am having trouble getting some string values  back intact.
>>>>
>>>> Long comments  (strings) that are written to the CBF using
>>>> set_value()  get newlines  (or carriage returns) added to them in  
>>>> the
>>>> CBF file.
>>>> When the text is extracted again, using cbf_get_value(),  it has  
>>>> the
>>>> extra newlines it.  The original strings may or may not have their
>>>> own
>>>> newlines.  The added newlines seem to be "escaped', using '\', but
>>>> neither the escapes nor the  escaped newlines  get removed from the
>>>> string.
>>>>
>>>> This a little more than just a cosmetic issue, as sometimes we have
>>>> formatted text in the comments, with columns that line up and
>>>> we would like to get the text back in a readable format.
>>>>
>>>>
>>>> two real examples using CBFlib v0.7.9 on a redhat 5.2 linux box.
>>>> ( BTW, CBFlib 0.7.9 writes "0.7.8" into the header prologue! )
>>>>
>>>> --------------------------------
>>>> This is OK:
>>>>
>>>> C-string input:
>>>> "file comments for a blank image on the marMosaic simulator with
>>>> dummy
>>>> values"
>>>>
>>>> CBF result:  (with cbf_set_value() )
>>>> _diffrn_data_frame.details^M
>>>> 'file comments for a blank image on the marMosaic simulator with
>>>> dummy values'^M
>>>> ^M
>>>>
>>>> C-string result of reading CBF:  (with cbf_get_value())
>>>> "file comments for a blank image on the marMosaic simulator with
>>>> dummy
>>>> values"
>>>> --------------------------------
>>>> --------------------------------
>>>> This is NOT OK:
>>>>
>>>> C-string input:
>>>> "dataset comments for a blank image on the marMosaic simulator with
>>>> dummy values"
>>>>
>>>> CBF result:  ( of cbf_set_value() )
>>>> _diffrn_measurement.details^M
>>>> ;\
>>>> dataset comments for a blank image on the marMosaic simulator with\
>>>> dummy values\
>>>> ;
>>>>
>>>> C-string result of parsing CBF:  (with cbf_get_value())
>>>> "\
>>>> dataset comments for a blank image on the marMosaic simulator with\
>>>> dummy values\"
>>>>
>>>> --------------------------------
>>>>
>>>>
>>>>
>>>> Note NEW Company name and email address!
>>>> _______________
>>>> Michael L. Blum                    Toll Free: 877-627-XRAY  
>>>> (627-9729)
>>>> Rayonix, LLC                        Tel: 847-869-1548
>>>> 1880 Oak Avenue                 Fax: 847-869-1587
>>>> Evanston, IL  60201              Email: blum at rayonix.com
>>>> USA                                       WWW: www.rayonix.com
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> imgcif-l mailing list
>>>> imgcif-l at iucr.org
>>>> http://scripts.iucr.org/mailman/listinfo/imgcif-l
>>>>
>>> _______________________________________________
>>> imgcif-l mailing list
>>> imgcif-l at iucr.org
>>> http://scripts.iucr.org/mailman/listinfo/imgcif-l
>>
>>
>> Note NEW Company name and email address!
>> _______________
>> Michael L. Blum                    Toll Free: 877-627-XRAY (627-9729)
>> Rayonix, LLC                        Tel: 847-869-1548
>> 1880 Oak Avenue                 Fax: 847-869-1587
>> Evanston, IL  60201              Email: blum at rayonix.com
>> USA                                       WWW: www.rayonix.com
>>
>>
>>
>>
>>
>> _______________________________________________
>> imgcif-l mailing list
>> imgcif-l at iucr.org
>> http://scripts.iucr.org/mailman/listinfo/imgcif-l
>>
> _______________________________________________
> imgcif-l mailing list
> imgcif-l at iucr.org
> http://scripts.iucr.org/mailman/listinfo/imgcif-l


Note NEW Company name and email address!
_______________
Michael L. Blum                    Toll Free: 877-627-XRAY (627-9729)
Rayonix, LLC                        Tel: 847-869-1548
1880 Oak Avenue                 Fax: 847-869-1587
Evanston, IL  60201              Email: blum at rayonix.com
USA                                       WWW: www.rayonix.com







More information about the imgcif-l mailing list