Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Imgcif-l] [Fwd: Re: CBFlib doesn't seem to write final item in a"_loop"]

  • To: imgCIF Mailing List <imgcif-l@iucr.org>
  • Subject: [Imgcif-l] [Fwd: Re: CBFlib doesn't seem to write final item in a"_loop"]
  • From: Justin Anderson <justin@rayonix.com>
  • Date: Fri, 14 Sep 2007 14:12:11 -0500
-------- Original Message --------
Subject: Re: CBFlib doesn't seem to write final item in a "_loop"
Date: Fri, 14 Sep 2007 14:56:05 -0400
From: Herbert J. Bernstein <yaya@bernstein-plus-sons.com>
To: Justin Anderson <justin@rayonix.com>
CC: Michael Blum <blum@rayonix.com>
References: <46EACF62.2040000@rayonix.com>

Dear Justin,


   This will be educational for everyone, so you may wish to do them
the courtesy of sending this email interchange to the list, but
I leave the decision to you.

   What you did here was to tell CBFlib first to set the value
of the last row, second column to "DUMMY-ROW2" and then you
told it to overwrite that value with the binary array data
because you did not select a new category/column/row in which to
write the binary data.

   Regards,
     Herbert


At 1:13 PM -0500 9/14/07, Justin Anderson wrote:
>Hello again Herbert,
>
>I seem to have "hit another wall".  It would seem that my last 
>column of data, in my last row of a "_loop" is not being written to 
>the file.  As you can see below in my code and resulting output .cbf 
>file, only the first column ("DUMMY-ROW1") in the last row is being 
>written, and not the second column ("DUMMY-ROW2").
>
>Any ideas as to what could be going on?  I tried tracing through 
>CBFLib in the debugger but it was not really clear to me how the 
>data for the rows and columns was being stored.  It looked like the 
>data was being stored in a cbf_node child directly but I also 
>thought children of nodes were also cbf_nodes.
>
>I'm not sure if this message should go to the group as it relates to 
>coding...is the mailing list only for discussion of the format of 
>the files?
>
>
>
>Thank you very much for your help,
>
>--
>Justin Anderson                    Rayonix, LLC (Formerly Mar USA)
>Software Engineer                  justin@rayonix.com
>1880 Oak Ave. Ste. 120             Evanston, IL, USA 60201
>877.627.9729                       847.869.1548
>
>
>
><<<<<<<<<<<<<<<<<<<<<<<<<<---MY CODE--->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>   ....
>   ....
>   ....
>   cbf_failnez (cbf_new_category     (cbf, "diffrn_detector_axis"))
>   cbf_failnez (cbf_new_column       (cbf, "detector_id"))
>   cbf_failnez (cbf_set_value        (cbf, "RAYONIX-SNXXXX"))
>   cbf_failnez (cbf_new_row          (cbf))
>   cbf_failnez (cbf_set_value        (cbf, "RAYONIX-SNXXXX"))
>   cbf_failnez (cbf_new_row          (cbf))
>   cbf_failnez (cbf_set_value        (cbf, "RAYONIX-SNXXXX"))
>   cbf_failnez (cbf_new_row          (cbf))
>   cbf_failnez (cbf_set_value        (cbf, "RAYONIX-SNXXXX"))
>cbf_failnez (cbf_new_row          (cbf))
>cbf_failnez (cbf_set_value        (cbf, "DUMMY-ROW1"))
>   cbf_failnez (cbf_new_column       (cbf, "axis_id"))
>   cbf_failnez (cbf_rewind_row       (cbf))
>   cbf_failnez (cbf_set_value        (cbf, "DETECTOR_X"))
>   cbf_failnez (cbf_next_row         (cbf))
>   cbf_failnez (cbf_set_value        (cbf, "DETECTOR_Y"))
>   cbf_failnez (cbf_next_row         (cbf))
>   cbf_failnez (cbf_set_value        (cbf, "DETECTOR_Z"))
>   cbf_failnez (cbf_next_row         (cbf))
>   cbf_failnez (cbf_set_value        (cbf, "DETECTOR_PITCH"))
>cbf_failnez (cbf_next_row         (cbf))
>cbf_failnez (cbf_set_value        (cbf, "DUMMY-ROW2"))
>
>   /* Save the binary data */
>   cbf_failnez (cbf_set_integerarray (cbf, CBF_PACKED, 1,
>                                  dfp->data , dfp->header->depth, 1,
>                                  dfp->header->nfast * dfp->header->nslow))
>
>   /* Write the new file */
>   out = fopen (filename, "w+b");
>
>   if (!out)
>   {
>     fprintf (stderr, " Couldn't open the CBF file %s\n", filename);
>     exit (1);
>   }
>
>   cbf_failnez (cbf_write_file (cbf, out, 1, CBF, MSG_DIGEST | 
>MIME_HEADERS, 0))
>
>   /* Free the cbf */
>   cbf_failnez (cbf_free_handle (cbf))
>   ....
>   ....
>   ....
>
><<<<<<<<<<<<<<<<<<<<<<<<---THE OUTPUT--->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>###CBF: VERSION 1.5
># CBF file written by CBFlib v0.7.8
>
>data_image_1_marccd
>
>_diffrn.id DS1
>_diffrn.crystal_id DIFFRN_CRYSTAL_ID
>
>_diffrn_source.diffrn_id DS1
>
>_diffrn_radiation.diffrn_id DS1
>_diffrn_radiation.wavelength_id WAVELENGTH1
>
>_diffrn_radiation_wavelength.id WAVELENGTH1
>_diffrn_radiation_wavelength.wavelength 103318
>_diffrn_radiation_wavelength.wt 1.0
>
>_diffrn_detector.diffrn_id DS1
>_diffrn_detector.type RAYONIX
>
>loop_
>_diffrn_detector_axis.detector_id
>_diffrn_detector_axis.axis_id
>  RAYONIX-SNXXXX DETECTOR_X
>  RAYONIX-SNXXXX DETECTOR_Y
>  RAYONIX-SNXXXX DETECTOR_Z
>  RAYONIX-SNXXXX DETECTOR_PITCH
>  DUMMY-ROW1
>;
>--CIF-BINARY-FORMAT-SECTION--
>....
>....
>....


-- 
=====================================================
  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@dowling.edu
=====================================================



-- 
Justin Anderson                    Rayonix, LLC (Formerly Mar USA)
Software Engineer                  justin@rayonix.com
1880 Oak Ave. Ste. 120             Evanston, IL, USA 60201
877.627.9729                       847.869.1548
_______________________________________________
imgcif-l mailing list
imgcif-l@iucr.org
http://scripts.iucr.org/mailman/listinfo/imgcif-l

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.