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

Dr. Avinash Kumar kumaravinash13 at gmail.com
Fri Jun 12 14:42:06 MDT 2015


​Thanks Dr. Alan for your reply and help. I will try to explore from
available resources to get solve my problem.


*​kindly I request from the active members from this forum if anyone can
help me to sort out this issue.*
Thanking
Avinash

​


On Sat, Jun 13, 2015 at 1:43 AM, Alan Brammer <abrammer at albany.edu> wrote:

> I don't have free time to write anything more than pseudocode for other
> people.
>
> All the resources are there.
> Good luck.
>
> On 12 June 2015 at 15:31, Dr. Avinash Kumar <kumaravinash13 at gmail.com>
> wrote:
>
>> ​Dear Alan
>> Thanks for your swift reply and solution. Yes, suggested Example 2 may be
>> required to fulfil my requirements but I not well versed to use NCL. I
>> would be appreciated if you can edit and provide  that Example Script.ncl
>> to achieve output as Netcdf mask of that area.
>>
>> Thanking you and Regards
>> Avinash
>>
>>
>>
>> On Fri, Jun 12, 2015 at 10:31 PM, Alan Brammer <abrammer at albany.edu>
>> wrote:
>>
>>> 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/20150613/197288da/attachment.html 


More information about the ncl-talk mailing list