[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20010830: MCIDAS - IMGCOPY questions..... (cont.)



>From: Giovanni Leoncini <address@hidden>
>Organization: SJSU
>Keywords: 200108291527.f7TFR3115078 McIDAS IMGCOPY

Giovanni,

>thanks for your quick and useful reply!! 

You are certainly welcome.

>I look up the source code you suggested, I understood something, but I
>still have a few problems:
>
>I'm not able to get the albedo, eventhough I'm trying to convert into
>netcdf a vis img (band 1). The reason could be here:
>
>>   if (strncmp((char *) &areaDir[CAL_TYPE], "ALB ", 4) == 0) {

The code is checking a specific word in the input AREA file directory
for the letters "ALB ".  That word that is being checked is word
52 (zero based).  The documentation for this word (from the area2.doc
file in the distribution) is:

    W53.  Calibration Type: units in which the digital data is stored
                    (e.g. 'RAW ','TEMP','BRIT',...)

(the words in this listing are 1-based, not 0-based).  So, if word
52 of your input image does not say "ALB ", you will not get albedo
in the output netCDF.

You can check word 52 of the input image by using the LWU facility
of McIDAS.  Let's assume that your input image is contained in AREA
file 1234:

LWU LIST AREA1234 0 64

This will give you a listing of the entire AREA file directory block.
A shorter list aroudn word 52 would be:

LWU LIST AREA1234 50 54

Here is such a listing for one of the VIS images that Unidata sites
can get in the Unidata-Wisconsin datastream:

LWU LIST AREA1234 52 54
      52. 1112688980           2 HEX: 42524954        2 ASCII: BRIT
      54.          0           0 HEX:        0        0 ASCII:
 --END OF LISTING

Notice that the calibration units of this image are BRIT.  I suspect
that the same can be said for the image(s) that you are dealing with.

>I have the feeling that the last space of the string "ALB " is the key.

I don't think so.

>I'm not a C programmer but I think the flags of the command line are
>processed before ncdfaput comes into play (the array argv is used only
>for trace) and it seems that it access the flags' values by a call to areaDir

If you are referring to the command line arguments on the IMGCOPY invocation,
then you are correct.  The argv values referred to in the ncdfaput.cp
routine are what are passed from the client (you running IMGCOPY) to
the server (ncdfaput.cp).

re: Why is data:type always VISR even though I use BAND=ALL and I don't
specify STYPE=VISR?

>It happens regardless of the image I'm using

You need to list out the header values from the input image to see how
ncdfaput.cp will act.

>> >>Why do I always have the same headers even if I set DOC=YES? the goes imag
> es
>> >>don't need calibration information?
>> 
>> What gets written to the file is hardcoded in the ouput routine.  It
>> might be most useful for you to read through the code for the routine
>> that actually writes the data.  Again, this can be found in
>> ~mcidas/mcidas7.7/src/ncdfaput.cp.

>I try to look for it but I didn't find where it reads this flag

I read through ncdfaput.cp and also did not find anything that looks
like processing of the DOC= keyword on IMGCOPY.  To me, this means that
the ncdfaput.cp server implementation is incomplete!  Perhaps this is
what was meant by the information at the beginning of ncdfaput.cp:

** The exact format of the output NetCDF file is certainly not carved
** in stone.  Which area metadata to include, how to format and store
** data and navigation, are all subject to debate.

>thanks again!

Sorry I can't be of more help, but I didn't write ncdfaput.cp.  Perhaps
if you can state exactly what your objective is and include the header
information from your input AREA file, I can send the information along
to SSEC and ask for comments as to whether the author belives that
ncdfaput.cp should be able to do the job at hand.

Tom