<div dir="ltr"><div dir="ltr"><div>*<b>IF*</b> the satellite swath data [size: 1200x1200 ] were on a rectilinear grid, your use of coordinate subscript syntax <span style="color:rgb(255,0,0)"><b>{...}</b></span><br></div><div><br></div><div>; create AOD extraction file for a given location<br>  data_raw1 =  data_raw(0,<span style="color:rgb(255,0,0)"><b>{40.821}</b>,<b>{-73.949}</b></span>)    <=== wrong usage<br></div><div><br></div><div><b>*Unfortunately</b>*, the swath data are  likely on a curvilinear grid. Hence, the <span style="color:rgb(255,0,0)"><b>{40.821}</b>,<b>{-73.949} i</b><span style="color:rgb(0,0,0)">s not appropriate. Hence, the error.</span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)"><br></span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">Likely, you will have to interpolate via <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml"><b>rcm2points</b></a><br></span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">Warning: this could be slow because <br></span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">[1] it uses a  'brute-force' approach [fortran 'do loops']; <br></span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">[2] <b>Each file</b> will incur initializing overhead. <br></span></span></div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)"><br></span></span></div><div><span style="color:rgb(255,0,0)"><b>====</b></span> <br></div><div><br></div><div>The <b>MCD19A2 [AQUA & TERRA] </b> contain <b>swath</b> 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) <b>BUT [I speculate] </b>each file has different lat/lon curvilinear locations. You preallocated<br></div><div><br></div><div>    twoday_data = new((/<b>1753</b>,1200,1200/),"double")</div><div><br></div><div>I am not sure where the <b>1753</b> 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.<br></div><div><br></div><div>----------<br></div><div><br></div><div>What to say?  Well, I<b> do know what to say: </b><span style="color:rgb(0,0,255)"><b><br></b></span></div><div><span style="color:rgb(0,0,255)"><b><br></b></span></div><div><span style="color:rgb(0,0,255)"><b>The Golden Rule of data processing is : Know your data!!!!</b></span><br></div><div><br></div><div>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.]<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 20, 2019 at 8:11 AM Herb, Jason via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_-3933997365082981057divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px">Hello,</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">I am attempting to extract <span>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.<br>
</span></p>
<p style="margin-top:0px;margin-bottom:0px"><span><br>
</span></p>
<p style="margin-top:0px;margin-bottom:0px"><span>Thanks,</span></p>
<p style="margin-top:0px;margin-bottom:0px"><span>Jason</span><br>
</p>
</div>
</div>

_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div></div>