How do I get the data I extract from NetCDF using NCO to be in correct format?

71 Views Asked by At

I am working with a NetCDF file and am looking to extract the data using NCO. This is time series data of PM 2.5 across South Florida. Therefore, there is PM 2.5 data for thousands of points across the South Florida grid map for the days 1/01-3/30. I am using the command:

ncdump -t hysplit_pm25_sugar_10m_2014a.nc

This command does extract the data but gives it in a strange format. The PM 2.5 levels below is an example of one location. In my output, the rest of the pm 2.5 values are listed above, with the latitude, longitude, and times at the bottom.

 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3.75578e-05, 0, 0, 0, 8.411169e-06, 0,
    0, 3.043653e-05, 1.846332e-06, 0.0001020871, 0.0001990109, 0.0005862598,
    0.0006739099, 0.0007504884, 0.001151713, 0.001129386, 0.001347817,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9.50882e-06,
    1.027017e-06, 0, 0.0001941336, 0.0001520694, 0.0004375369, 0.0005555756,
    0.0004916056, 0.0009697205, 0.001099954 ;

 latitude = 24.15, 24.2, 24.25, 24.3, 24.35, 24.4, 24.45, 24.5, 24.55, 24.6,
    24.65, 24.7, 24.75, 24.8, 24.85, 24.9, 24.95, 25, 25.05, 25.1, 25.15,
    25.2, 25.25, 25.3, 25.35, 25.4, 25.45, 25.5, 25.55, 25.6, 25.65, 25.7,
    25.75, 25.8, 25.85, 25.9, 25.95, 26, 26.05, 26.1, 26.15, 26.2, 26.25,
    26.3, 26.35, 26.4, 26.45, 26.5, 26.55, 26.6, 26.65, 26.7, 26.75, 26.8,
    26.85, 26.9, 26.95, 27, 27.05, 27.1, 27.15, 27.2, 27.25, 27.3, 27.35,
    27.4, 27.45, 27.5, 27.55, 27.6, 27.65, 27.7, 27.75, 27.8, 27.85, 27.9,
    27.95, 28, 28.05, 28.1, 28.15, 28.2, 28.25, 28.3, 28.35, 28.4, 28.45,
    28.5, 28.55, 28.6, 28.65, 28.7, 28.75, 28.8, 28.85, 28.9, 28.95, 29,
    29.05, 29.1, 29.15 ;



levels = 10 ;

 longitude = -83.15, -83.1, -83.05, -83, -82.95, -82.9, -82.85, -82.8,
    -82.75, -82.7, -82.65, -82.6, -82.55, -82.5, -82.45, -82.4, -82.35,
    -82.3, -82.25, -82.2, -82.15, -82.1, -82.05, -82, -81.95, -81.9, -81.85,
    -81.8, -81.75, -81.7, -81.65, -81.6, -81.55, -81.5, -81.45, -81.4,
    -81.35, -81.3, -81.25, -81.2, -81.15, -81.1, -81.05, -81, -80.95, -80.9,
    -80.85, -80.8, -80.75, -80.7, -80.65, -80.6, -80.55, -80.5, -80.45,
    -80.4, -80.35, -80.3, -80.25, -80.2, -80.15, -80.1, -80.05, -80, -79.95,
    -79.9, -79.85, -79.8, -79.75, -79.7, -79.65, -79.6, -79.55, -79.5,
    -79.45, -79.4, -79.35, -79.3, -79.25, -79.2, -79.15, -79.1, -79.05, -79,
    -78.95, -78.9, -78.85, -78.8, -78.75, -78.7, -78.65, -78.6, -78.55,
    -78.5, -78.45, -78.4, -78.35, -78.3, -78.25, -78.2, -78.15 ;

 time = "2014-01-01 16:30", "2014-01-02 16:30", "2014-01-03 16:30",
    "2014-01-04 16:30", "2014-01-05 16:30", "2014-01-06 16:30",
    "2014-01-07 16:30", "2014-01-08 16:30", "2014-01-09 16:30",
    "2014-01-10 16:30", "2014-01-11 16:30", "2014-01-12 16:30",
    "2014-01-13 16:30", "2014-01-14 16:30", "2014-01-15 16:30",
    "2014-01-16 16:30", "2014-01-17 16:30", "2014-01-18 16:30",
    "2014-01-19 16:30", "2014-01-20 16:30", "2014-01-21 16:30",
    "2014-01-22 16:30", "2014-01-23 16:30", "2014-01-24 16:30",
    "2014-01-25 16:30", "2014-01-26 16:30", "2014-01-27 16:30",
    "2014-01-28 16:30", "2014-01-29 16:30", "2014-01-30 16:30",
    "2014-01-31 16:30", "2014-02-01 16:30", "2014-02-02 16:30",
    "2014-02-03 16:30", "2014-02-04 16:30", "2014-02-05 16:30",
    "2014-02-06 16:30", "2014-02-07 16:30", "2014-02-08 16:30",
    "2014-02-09 16:30", "2014-02-10 16:30", "2014-02-11 16:30",
    "2014-02-12 16:30", "2014-02-13 16:30", "2014-02-14 16:30",
    "2014-02-15 16:30", "2014-02-16 16:30", "2014-02-17 16:30",
    "2014-02-18 16:30", "2014-02-19 16:30", "2014-02-20 16:30",
    "2014-02-21 16:30", "2014-02-22 16:30", "2014-02-23 16:30",
    "2014-02-24 16:30", "2014-02-25 16:30", "2014-02-26 16:30",
    "2014-02-27 16:30", "2014-02-28 16:30", "2014-03-01 16:30",
    "2014-03-02 16:30", "2014-03-03 16:30", "2014-03-04 16:30",
    "2014-03-05 16:30", "2014-03-06 16:30", "2014-03-07 16:30",
    "2014-03-08 16:30", "2014-03-09 16:30", "2014-03-10 16:30",
    "2014-03-11 16:30", "2014-03-12 16:30", "2014-03-13 16:30",
    "2014-03-14 16:30", "2014-03-15 16:30", "2014-03-16 16:30",
    "2014-03-17 16:30", "2014-03-18 16:30", "2014-03-19 16:30",
    "2014-03-20 16:30", "2014-03-21 16:30", "2014-03-22 16:30",
    "2014-03-23 16:30", "2014-03-24 16:30", "2014-03-25 16:30",
    "2014-03-26 16:30", "2014-03-27 16:30", "2014-03-28 16:30",
    "2014-03-29 16:30", "2014-03-30 14:29:58.593750" ;

 time_bnds =
  "2014-01-01 15:30", "2014-01-01 16:30",
  "2014-01-02 15:30", "2014-01-02 16:30",
  "2014-01-03 15:30", "2014-01-03 16:30",
  "2014-01-04 15:30", "2014-01-04 16:30",
  "2014-01-05 15:30", "2014-01-05 16:30",
  "2014-01-06 15:30", "2014-01-06 16:30",
  "2014-01-07 15:30", "2014-01-07 16:30",
  "2014-01-08 15:30", "2014-01-08 16:30",
  "2014-01-09 15:30", "2014-01-09 16:30",
  "2014-01-10 15:30", "2014-01-10 16:30",
  "2014-01-11 15:30", "2014-01-11 16:30",
  "2014-01-12 15:30", "2014-01-12 16:30",
  "2014-01-13 15:30", "2014-01-13 16:30",
  "2014-01-14 15:30", "2014-01-14 16:30",
  "2014-01-15 15:30", "2014-01-15 16:30",
  "2014-01-16 15:30", "2014-01-16 16:30",
  "2014-01-17 15:30", "2014-01-17 16:30",
  "2014-01-18 15:30", "2014-01-18 16:30",
  "2014-01-19 15:30", "2014-01-19 16:30",
  "2014-01-20 15:30", "2014-01-20 16:30",
  "2014-01-21 15:30", "2014-01-21 16:30",
  "2014-01-22 15:30", "2014-01-22 16:30",
  "2014-01-23 15:30", "2014-01-23 16:30",
  "2014-01-24 15:30", "2014-01-24 16:30",
  "2014-01-25 15:30", "2014-01-25 16:30",
  "2014-01-26 15:30", "2014-01-26 16:30",
  "2014-01-27 15:30", "2014-01-27 16:30",
  "2014-01-28 15:30", "2014-01-28 16:30",
  "2014-01-29 15:30", "2014-01-29 16:30",
  "2014-01-30 15:30", "2014-01-30 16:30",
  "2014-01-31 15:30", "2014-01-31 16:30",
  "2014-02-01 15:30", "2014-02-01 16:30",
  "2014-02-02 15:30", "2014-02-02 16:30",
  "2014-02-03 15:30", "2014-02-03 16:30",
  "2014-02-04 15:30", "2014-02-04 16:30",
  "2014-02-05 15:30", "2014-02-05 16:30",
  "2014-02-06 15:30", "2014-02-06 16:30",
  "2014-02-07 15:30", "2014-02-07 16:30",
  "2014-02-08 15:30", "2014-02-08 16:30",
  "2014-02-09 15:30", "2014-02-09 16:30",
  "2014-02-10 15:30", "2014-02-10 16:30",
  "2014-02-11 15:30", "2014-02-11 16:30",
  "2014-02-12 15:30", "2014-02-12 16:30",
  "2014-02-13 15:30", "2014-02-13 16:30",
  "2014-02-14 15:30", "2014-02-14 16:30",
  "2014-02-15 15:30", "2014-02-15 16:30",
  "2014-02-16 15:30", "2014-02-16 16:30",
  "2014-02-17 15:30", "2014-02-17 16:30",
  "2014-02-18 15:30", "2014-02-18 16:30",
  "2014-02-19 15:30", "2014-02-19 16:30",
  "2014-02-20 15:30", "2014-02-20 16:30",
  "2014-02-21 15:30", "2014-02-21 16:30",
  "2014-02-22 15:30", "2014-02-22 16:30",
  "2014-02-23 15:30", "2014-02-23 16:30",
  "2014-02-24 15:30", "2014-02-24 16:30",
  "2014-02-25 15:30", "2014-02-25 16:30",
  "2014-02-26 15:30", "2014-02-26 16:30",
  "2014-02-27 15:30", "2014-02-27 16:30",
  "2014-02-28 15:30", "2014-02-28 16:30",
  "2014-03-01 15:30", "2014-03-01 16:30",
  "2014-03-02 15:30", "2014-03-02 16:30",
  "2014-03-03 15:30", "2014-03-03 16:30",
  "2014-03-04 15:30", "2014-03-04 16:30",
  "2014-03-05 15:30", "2014-03-05 16:30",
  "2014-03-06 15:30", "2014-03-06 16:30",
  "2014-03-07 15:30", "2014-03-07 16:30",
  "2014-03-08 15:30", "2014-03-08 16:30",
  "2014-03-09 15:30", "2014-03-09 16:30",
  "2014-03-10 15:30", "2014-03-10 16:30",
  "2014-03-11 15:30", "2014-03-11 16:30",
  "2014-03-12 15:30", "2014-03-12 16:30",
  "2014-03-13 15:30", "2014-03-13 16:30",
  "2014-03-14 15:30", "2014-03-14 16:30",
  "2014-03-15 15:30", "2014-03-15 16:30",
  "2014-03-16 15:30", "2014-03-16 16:30",
  "2014-03-17 15:30", "2014-03-17 16:30",
  "2014-03-18 15:30", "2014-03-18 16:30",
  "2014-03-19 15:30", "2014-03-19 16:30",
  "2014-03-20 15:30", "2014-03-20 16:30",
  "2014-03-21 15:30", "2014-03-21 16:30",
  "2014-03-22 15:30", "2014-03-22 16:30",
  "2014-03-23 15:30", "2014-03-23 16:30",
  "2014-03-24 15:30", "2014-03-24 16:30",
  "2014-03-25 15:30", "2014-03-25 16:30",
  "2014-03-26 15:30", "2014-03-26 16:30",
  "2014-03-27 15:30", "2014-03-27 16:30",
  "2014-03-28 15:30", "2014-03-28 16:30",
  "2014-03-29 15:30", "2014-03-29 16:30",
  "2014-03-30 13:30", "2014-03-30 14:29:58.593750

The PM2.5 values at each location are listed first at the top, then the latitudes and longitudes are shown next, and the dates are given at the bottom. This is just one example of the PM2.5 data, there are many more in my output, but this is how time and location are given to me. They are in order, but it does not match the PM2.5 to the location and date in a way that works well. Ideally, we would like a monthly average for each point rather than the daily values. We would also like for the output of the command to give the average for one location, then the values of latitude and longitude that correspond to the PM 2.5 average, then the date, which would continue for all locations. All this being side to side would be in the format we need. I am extremely new to this and hope that my questions make sense. I would appreciate any help at all. Thanks!

0

There are 0 best solutions below