[ncl-talk] attempting to extract Optical_Depth_047_grid1km from files
Dennis Shea
shea at ucar.edu
Tue Aug 20 15:16:54 MDT 2019
**IF** the satellite swath data [size: 1200x1200 ] were on a rectilinear
grid, your use of coordinate subscript syntax *{...}*
; create AOD extraction file for a given location
data_raw1 = data_raw(0,*{40.821}*,*{-73.949}*) <=== wrong usage
**Unfortunately**, the swath data are likely on a curvilinear grid. Hence,
the *{40.821}*,*{-73.949} i*s not appropriate. Hence, the error.
Likely, you will have to interpolate via *rcm2points*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml>
Warning: this could be slow because
[1] it uses a 'brute-force' approach [fortran 'do loops'];
[2] *Each file* will incur initializing overhead.
*====*
The *MCD19A2 [AQUA & TERRA] * contain *swath* data. In fact, depending upon
where the aeronet station(s) is/are located, you could have anywhere from
1-30+ swaths per file. They call the swaths "orbits". All lat/lon on an
individual file are fixed size (1200,1200) *BUT [I speculate] *each file
has different lat/lon curvilinear locations. You preallocated
twoday_data = new((/*1753*,1200,1200/),"double")
I am not sure where the *1753* originated. [I don't need to know! :-) ]
However, I presume that it comes from the number of files and the varying
number of swaths per file.
----------
What to say? Well, I* do know what to say: *
*The Golden Rule of data processing is : Know your data!!!!*
Due to the file-to-file variations both in lat/lon values and the number of
swaths (orbits) , this becomes dog-work programming. You have to know your
data to adequately handle assorted permutations. For example, a particular
swath may not include a desired aeronet location. The code must check. If
it does include the region, there could be from 1-30+ swath/orbit values
which must be appended. Given the unknown number of swath observations at
the aeronet location. Generally, it is not possible to precisely set the
size of the array to contain the the interpolated values. [You did but this
is likely not a good general approach.]
On Tue, Aug 20, 2019 at 8:11 AM Herb, Jason via ncl-talk <ncl-talk at ucar.edu>
wrote:
> Hello,
>
>
> I am attempting to extract Optical_Depth_047_grid1km data from multiple
> files into a text csv formated file for a given location in order to
> compare against aeronet station data for example CCNY 40.821 -73.949. I
> have tried to write an ascii file but it does not appear to appear after
> the script has finished running. I have attached the script to the email.
>
>
> Thanks,
>
> Jason
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190820/04c1dce3/attachment.html>
More information about the ncl-talk
mailing list