[no subject]

Script started on Wed Sep 25 14:57:51 1991
spso% ncgen -n -o avhrr.cdf -c avhrr.cdl
#include "netcdf.h"

int
main() {                        /* create sharpavhrr.cdf */

   int  cdfid;                  /* netCDF id */

   /* dimension ids */
   int  scan_dim, samples_dim, channels_dim, locations_dim, latlon_dim, 
scanwithgcps_dim;

   /* variable ids */
   int  video_data_id, first_line_with_tiepoints_id, 
pixels_with_latlong_grids_id;

   /* variable shapes */
   int dims[3];

   /* containers for scalar attributes */
   long  long_val;

   /* enter define mode */
   cdfid = nccreate("csharpavhrr.cdf", NC_CLOBBER);

   /* define dimensions */
   scan_dim = ncdimdef(cdfid, "scan", NC_UNLIMITED);
   samples_dim = ncdimdef(cdfid, "samples", 55);
   channels_dim = ncdimdef(cdfid, "channels", 5);
   locations_dim = ncdimdef(cdfid, "locations", 65);
   latlon_dim = ncdimdef(cdfid, "latlon", 2);
   scanwithgcps_dim = ncdimdef(cdfid, "scanwithgcps", 89);

   /* define variables */

   dims[0] = scan_dim;
   dims[1] = samples_dim;
   dims[2] = channels_dim;
   video_data_id = ncvardef (cdfid, "video_data", NC_SHORT, 3, dims);

   first_line_with_tiepoints_id = ncvardef (cdfid, "first_line_with_tiepoints", 
NC_SHORT, 0, 0);

   dims[0] = scan_dim;
   dims[1] = samples_dim;
   dims[2] = channels_dim;
   pixels_with_latlong_grids_id = ncvardef (cdfid, "pixels_with_latlong_grids", 
NC_BYTE, 3, dims);

   /* assign attributes */
   long_val = 5;
   ncattput (cdfid, video_data_id, "number_of_scan_lines", NC_LONG, 1,(void *) 
&long_val);
   ncattput (cdfid, NC_GLOBAL, "spacecraft_type", NC_CHAR, 8, (void *)"NOAA-11 
");
   ncattput (cdfid, NC_GLOBAL, "sensor_type", NC_CHAR, 6, (void *)"AVHRR ");
   ncattput (cdfid, NC_GLOBAL, "data_type_recorded", NC_CHAR, 5, (void *)"HRPT 
");
   ncattput (cdfid, NC_GLOBAL, "interleaving_indicator", NC_CHAR, 5, (void 
*)"LINN ");
   ncattput (cdfid, NC_GLOBAL, "product_level", NC_CHAR, 9, (void *)"level 1B 
");
   ncattput (cdfid, NC_GLOBAL, "product_type", NC_CHAR, 9, (void *)"HRPT RAW ");
   ncattput (cdfid, NC_GLOBAL, "orbit_number", NC_CHAR, 5, (void *)"8957 ");
   ncattput (cdfid, NC_GLOBAL, "scene_center_latitude", NC_CHAR, 12, (void 
*)"53.27019162 ");
   ncattput (cdfid, NC_GLOBAL, "scene_center_longitude", NC_CHAR, 12, (void 
*)"18.72126233 ");
   ncattput (cdfid, NC_GLOBAL, "scene_center_line_number", NC_CHAR, 6, (void 
*)"720.5 ");
   ncattput (cdfid, NC_GLOBAL, "scene_center_pixel_number", NC_CHAR, 7, (void 
*)"1024.5 ");
   ncattput (cdfid, NC_GLOBAL, "scene_center_year", NC_CHAR, 3, (void *)"90 ");
   ncattput (cdfid, NC_GLOBAL, "scene_center_julian_day", NC_CHAR, 4, (void 
*)"172 ");
   ncattput (cdfid, NC_GLOBAL, "scene_center_time", NC_CHAR, 13, (void 
*)"12:02:01:088 ");
   ncattput (cdfid, NC_GLOBAL, "ascending_descending_flag", NC_CHAR, 15, (void 
*)"ascending 1990 ");
   ncattput (cdfid, NC_GLOBAL, "ascending_descending_node", NC_CHAR, 12, (void 
*)"34.71596536 ");
   ncattput (cdfid, NC_GLOBAL, "time_of_asc_dec_node", NC_CHAR, 13, (void 
*)"11:46:41:714 ");
   ncattput (cdfid, NC_GLOBAL, "date_of_asc_dec_node", NC_CHAR, 4, (void *)"172 
");
   ncattput (cdfid, NC_GLOBAL, "wavelength_for_b1", NC_CHAR, 11, (void *)"680   
 580 ");
   ncattput (cdfid, NC_GLOBAL, "wavelength_for_b2", NC_CHAR, 11, (void *)"1100  
 725 ");
   ncattput (cdfid, NC_GLOBAL, "wavelength_for_b3", NC_CHAR, 12, (void *)"3930  
 3550 ");
   ncattput (cdfid, NC_GLOBAL, "wavelength_for_b4", NC_CHAR, 13, (void *)"11300 
 10300 ");
   ncattput (cdfid, NC_GLOBAL, "wavelength_for_b5", NC_CHAR, 13, (void *)"12500 
 11500 ");
   ncattput (cdfid, NC_GLOBAL, "rad_calibration_applied", NC_CHAR, 5, (void 
*)"none ");
   ncattput (cdfid, NC_GLOBAL, "rad_resolution_designator", NC_CHAR, 3, (void 
*)"10 ");
   ncattput (cdfid, NC_GLOBAL, "scene_rad_res_designator", NC_CHAR, 5, (void 
*)"none ");
   ncattput (cdfid, NC_GLOBAL, "inter_pixel_distance", NC_CHAR, 7, (void 
*)"1100.0 ");
   ncattput (cdfid, NC_GLOBAL, "inter_line_distance", NC_CHAR, 7, (void 
*)"1100.0 ");
   ncattput (cdfid, NC_GLOBAL, "nominal_altitue", NC_CHAR, 9, (void *)"850000.0 
");
   ncattput (cdfid, NC_GLOBAL, "nominal_ground_speed", NC_CHAR, 7, (void 
*)"6600.0 ");
   ncattput (cdfid, NC_GLOBAL, "satellite_heading", NC_CHAR, 11, (void 
*)"15.13781677");
   ncattput (cdfid, NC_GLOBAL, "angle_of_drift_at_center", NC_CHAR, 10, (void 
*)"2.31983821");

   /* leave define mode */
   ncendef (cdfid);

   {                    /* store video_data */
    static int video_data_start[] = {0, 0, 0};
    static int video_data_edges[] = {1, 55, 5};
    static short video_data[] = {469, 465, 900, 719, 685, 480, 479, 895, 741, 
708, 486, 489, 888, 754, 724, 485, 491, 902, 752, 722, 476, 487, 901, 747, 718, 
478, 493, 897, 751, 723, 502, 515, 899, 762, 732, 521, 528, 911, 762, 735, 526, 
531, 928, 734, 707, 502, 504, 928, 688, 658, 453, 459, 903, 650, 614, 429, 446, 
872, 643, 607, 443, 459, 869, 645, 610, 486, 487, 808, 656, 619, 494, 491, 821, 
681, 646, 496, 498, 846, 708, 675, 487, 495, 877, 721, 687, 489, 498, 894, 730, 
697, 494, 500, 920, 719, 686, 484, 489, 906, 704, 669, 462, 472, 851, 714, 681, 
428, 449, 834, 734, 706, 400, 432, 876, 716, 691, 364, 407, 796, 692, 664, 362, 
410, 824, 704, 676, 362, 411, 891, 716, 687, 344, 393, 885, 714, 683, 313, 365, 
879, 695, 665, 274, 332, 879, 665, 630, 247, 307, 858, 649, 619, 204, 272, 780, 
622, 597, 185, 262, 733, 603, 580, 181, 270, 643, 593, 581, 183, 294, 668, 584, 
563, 180, 313, 709, 576, 549, 204, 320, 852, 604, 568, 215, 325, 823, 621, 594, 
176, 314, 809, 582, 559, 173, 3!
14, 784, 581, 552, 216, 322, 816,
    ncvarput(cdfid, video_data_id, video_data_start, video_data_edges, (void 
*)video_data);
   }
Segmentation fault (core dumped)
spso% exit
spso% 
script done on Wed Sep 25 14:58:33 1991


  • 1991 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: