[ncl-talk] How to Convert binary Mask to NetCDF

Alan Brammer abrammer at albany.edu
Fri Jun 12 11:01:37 MDT 2015


Have you attempted to do this? Below are links to the relevant
documentation. The line of code pasted below allowed me to read the data
and it looked representative of the plot you attached.

Example 2 on the binary page shows pretty much exactly what you desire.


Good luck.


https://www.ncl.ucar.edu/Applications/r-binary.shtml
https://www.ncl.ucar.edu/Document/Functions/Built-in/fbindirread.shtml


filename = "region_n.msk"

data := fbindirread(filename, 0,(/448,304/), "byte")


https://www.ncl.ucar.edu/Applications/o-netcdf.shtml





On 12 June 2015 at 11:34, Dr. Avinash Kumar <kumaravinash13 at gmail.com>
wrote:

> Dear All
> I would be very much grateful if anyone can make a masking file in netcdf
> file using the region_n.msk: 448 rows x 304 columns [binary file]. The
> details are given in below link. Further, this Netcdf file can be used to
> mask any netcdf file based on our required regions.
>
> Region Masks
> http://nsidc.org/data/polar_stereo/tools_masks.html
>
> Region masks for the Northern (n). The files contain a 300-byte header,
> followed by a two-dimensional byte array stored by rows in column order.
> Regions are assigned different pixel values as shown in the following table.
>
> *region_n.msk: 448 rows x 304 columns [ATTACHED FOR KIND REFERENCE]*
> Grided mask map:JPG [ATTACHED FOR KIND REFERENCE]
>
> Pixel Value Arctic Region
> 1 Non-regional ocean
> 2 Sea of Okhotsk and Japan
> 3 Bering Sea
> 4 Hudson Bay
> 5 Baffin Bay/Davis Strait/Labrador Sea
> 6 Greenland Sea
> 7 Kara and Barents Seas
> 8 Arctic Ocean
> 9 Canadian Archipelago
> 10 Gulf of St. Lawrence
> 11 Land
> 12 Coast
> 0 Lakes, extended coast
>
> Thanking you and eagerly waiting for help from anyone.
>
> Kind Regards
> Avinash
> *Dr. Avinash Kumar **| **Scientist 'C' *
> *ESSO - **National Centre for Antarctic & Ocean Research*
> Earth System Science Organization *| *Ministry of Earth Sciences *|* Government
> of India
> Headland Sada *|* Vasco-da-Gama *|* Goa 403 804 *|* India
>
>
>
> *Phone No: **+91-**832-2525-637 (O) **|** +91-832-252556488 (R) **| **Mobile
> No: +91-9158536334 <%2B91-9158536334> *
> *Email: avinash at ncaor.gov.in <avinash at ncaor.gov.in> **|** kumaravinash13 at gmail.com
> <kumaravinash13 at gmail.com>*
> *Website: *www.ncaor.gov.in *| **http://www.researchgate.net/profile/Avinash_Kumar34
> <http://www.researchgate.net/profile/Avinash_Kumar34>  *
>
> _______________________________________________
> 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/20150612/58667942/attachment.html 


More information about the ncl-talk mailing list