masking

Rupak Rajbhandari rupak.rajbhandari at GMAIL.COM
Fri Oct 30 02:14:42 EDT 2009


Hi Matthias,

I am glad you liked it.

I am using FORTRAN as it is convenient to me. You can use any other language
which can handle binary files.

Basically, what GIS (ArcView) gives us is the IDs of the grid points which
are inside the country boundary. All my program does is assign 1s to those
points and 0s to rest of the points in a domain considered (mine happens to
be 86x46).

In binary file, replace all values by 'undefined' values (-999.0) where
masking file values are zero and save this as new file. Thats it.

Attached is the RAR file which comprises the following.
ASCII

masking file
unmasked-data file
masked-data file
(header file is also included to import it into ArcView)
control file - to display in grads

BINARY

unmasked data file
masked data file


If you have any query please let me know.

cheers!

-rupak



On Wed, Oct 28, 2009 at 4:47 PM, Matthias Fripp <matthias.fripp at eci.ox.ac.uk
> wrote:

> Wow, you used almost exactly the same approach I suggested (but with more
> Fortran and less Excel)! Glad to know I was on to something.
>
> I'm not fluent in Fortran, so I had trouble deciphering the cr_mask_fl.f
> program that converts an ASCII list of points into an ASCII masking file
> that GRADS can read. Would you be able to send a sample of the final ASCII
> masking file that you produced and the command you use to load it into
> GRADS? Or if there's an obvious place to look in the instructions, that
> would be great too. So far I only know how to get GRADS to read local or
> remote binary files. It would be great to have a way to display data from
> ASCII/text files that I create myself.
>
> Best,
>
> Matthias
>
> On Oct 28, 2009, at 8:39 AM, Rupak Rajbhandari wrote:
>
> Hi,
>
> Creating a masking file is not a simple procedure. Here I am sending you a
> masking instruction I prepared (last year  for small training group in
> Nepal). The masking file is for 0.1 resolution, so you need to edit a
> little. The attached RAR file consists of a instruction file and two fortran
> programs. In addition you will need ArcView GIS and India shape file
> (boundary polygon) and fortran compiler. You should first edit the program
> to suit your resolution. The rest should be clear from the instruction file.
>
> Once the masking file has been created, simply replace the master file with
> undefined values where grid point point values are zero in the masking file.
>
> Hope it helps!
>
> -rupak
>
>
>
>
>
> On Tue, Oct 27, 2009 at 9:04 PM, Matthias Fripp <
> matthias.fripp at eci.ox.ac.uk> wrote:
>
>> It sounds like you will need to do something like this:
>>
>> 1. Create a file listing all the grid points in or near India (e.g.,
>> within a simple latitude and longitude range that covers all of India and
>> some surrounding areas).
>>
>> 2. Import this list into a GIS program and intersect it with India's land
>> area.
>>
>> 3. Export a list of Indian grid points from the GIS program.
>>
>> 4. Import this list into GRADS.
>>
>> Step 1 would be easy to do, e.g., in a text (.csv) file created in Excel,
>> if your grid is regularly spaced.
>>
>> Step 2 and 3 are easy if you have a GIS program and difficult otherwise. I
>> could help you with that if you want.
>>
>> I don't know how you would do Step 4. I can easily create a text file
>> listing all the relevant points, but I don't know how you would reference
>> that text file from GRADS to create a mask variable. Anyone else have ideas
>> about this?
>>
>> Matthias
>>
>> On Tue, Oct 27, 2009 at 7:23 AM, Sachin Ghude <sachinghude at tropmet.res.in
>> > wrote:
>>
>>> Hi,
>>>
>>> I want to plot tropospheric NO2 only over the Indian grid points (not
>>> Nepal, Pakistan
>>> and BanglaDesh). Is there any such utility so that it will enable me to
>>> plot data only
>>> for  India girds in GRADs. ( my grid size is 0.25 x 0.25 degrees).
>>>
>>> please do the needful..
>>>
>>> bye..
>>>
>>> Sachin
>>>
>>
>>
> <masking.rar>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20091030/447d6293/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: masking.rar
Type: application/octet-stream
Size: 27118 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20091030/447d6293/attachment.obj 


More information about the gradsusr mailing list