Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: storing in ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 9 Topic 5728 of 5734
Post > Topic >>

Re: storing in array

by kishore1818@[EMAIL PROTECTED] May 11, 2008 at 02:26 PM

On May 11, 5:11=A0am, Spon <christoph.b...@[EMAIL PROTECTED]
> wrote:
> On May 11, 12:48 am, kishore1...@[EMAIL PROTECTED]
 wrote:
>
>
>
> > Hi,
>
> > I am new in IDL language. For reading the CALIPSO satellite data sets
> > in that what type of cloud type for that they provided read routine.
> > If I use this routine it is printing on IDL log window. How to store
> > this information into an string array.
> > This is the routine
> > vfm_feature_flags,36282
> > The output is like this:
> > Bit set: =A0 =A0 =A0 =A02
> > Bit set: =A0 =A0 =A0 =A04
> > Bit set: =A0 =A0 =A0 =A05
> > Bit set: =A0 =A0 =A0 =A06
> > Bit set: =A0 =A0 =A0 =A08
> > Bit set: =A0 =A0 =A0 =A09
> > Bit set: =A0 =A0 =A0 11
> > Bit set: =A0 =A0 =A0 12
> > Bit set: =A0 =A0 =A0 16
> > Feature Type : cloud
> > Feature Subtype : cirrus (transparent)
> > Feature Type QA : high
> > Ice/Water Phase : ice
> > Ice/Water Phase QA: high
> > Cloud/Aerosol/PSC Type QA : not confident
> > Horizontal averaging required for detection: 20 km
>
> > The above information i want to store in string array.
>
> > ;************************routine********************
> > pro vfm_feature_flags,val
> > ; =A0this routine demonstrates how to read and extract values from a
> > feature
> > ; =A0classification flag 16-bit integer value in CALIPSO Level 2
> > Vertical
> > ; =A0Feature Mask files
> > ;
> > ; =A0INPUT:
> > ; =A0val - the feature classification flag value to be decoded
> > ;
> > ; =A0OUTPUT:
> > ; =A0all information is printed into the IDL log window
>
> > print, val
>
> > feature_type =3D 0
> > feature_type_qa =3D 0
> > ice_water_phase =3D 0
> > ice_water_phase_qa =3D 0
> > feature_subtype =3D 0
> > cloud_aerosol_psc_type_qa =3D 0
> > horizontal_averaging =3D 0
>
> > for i=3D0,15 do begin
> > =A0 if ((val and 2L^i) NE 0) then begin
> > =A0 =A0 print,'Bit set: ',i+1
> > =A0 =A0 case i+1 of
> > =A0 =A0 1 : feature_type =3D feature_type + 1
> > =A0 =A0 2 : feature_type =3D feature_type + 2
> > =A0 =A0 3 : feature_type =3D feature_type + 4
> > =A0 =A0 4 : feature_type_qa =3D feature_type_qa + 1
> > =A0 =A0 5 : feature_type_qa =3D feature_type_qa + 2
> > =A0 =A0 6 : ice_water_phase =3D ice_water_phase + 1
> > =A0 =A0 7 : ice_water_phase =3D ice_water_phase + 2
> > =A0 =A0 8 : ice_water_phase_qa =3D ice_water_phase_qa + 1
> > =A0 =A0 9 : ice_water_phase_qa =3D ice_water_phase_qa + 2
> > =A0 =A0 10 : feature_subtype =3D feature_subtype + 1
> > =A0 =A0 11 : feature_subtype =3D feature_subtype + 2
> > =A0 =A0 12 : feature_subtype =3D feature_subtype + 4
> > =A0 =A0 13 : cloud_aerosol_psc_type_qa =3D cloud_aerosol_psc_type_qa +
1=

> > =A0 =A0 14 : horizontal_averaging =3D horizontal_averaging + 1
> > =A0 =A0 15 : horizontal_averaging =3D horizontal_averaging + 2
> > =A0 =A0 16: horizontal_averaging =3D horizontal_averaging + 4
> > =A0 =A0 else:
> > =A0 =A0 endcase
> > =A0 endif
> > endfor
>
> > case feature_type of
> > 0 : print,"Feature Type : invalid (bad or missing data)"
> > 1 : print,"Feature Type : clear air"
> > 2 : begin
> > =A0 =A0 =A0 print,"Feature Type : cloud"
> > =A0 =A0 =A0 case feature_subtype of
> > =A0 =A0 =A0 0 : print, "Feature Subtype : low overcast, transparent"
> > =A0 =A0 =A0 1 : print, "Feature Subtype : low overcast, opaque"
> > =A0 =A0 =A0 2 : print, "Feature Subtype : transition stratocumulus"
> > =A0 =A0 =A0 3 : print, "Feature Subtype : low, broken cumulus"
> > =A0 =A0 =A0 4 : print, "Feature Subtype : altocumulus (transparent)"
> > =A0 =A0 =A0 5 : print, "Feature Subtype : altostratus (opaque)"
> > =A0 =A0 =A0 6 : print, "Feature Subtype : cirrus (transparent)"
> > =A0 =A0 =A0 7 : print, "Feature Subtype : deep convective (opaque)"
> > =A0 =A0 =A0 else : print,"*** error getting Feature Subtype"
> > =A0 =A0 =A0 endcase
> > =A0 =A0 end
> > 3 : begin
> > =A0 =A0 =A0 print,"Feature Type : aerosol"
> > =A0 =A0 =A0 case feature_subtype of
> > =A0 =A0 =A0 0 : print, "Feature Subtype : not determined"
> > =A0 =A0 =A0 1 : print, "Feature Subtype : clean marine"
> > =A0 =A0 =A0 2 : print, "Feature Subtype : dust"
> > =A0 =A0 =A0 3 : print, "Feature Subtype : polluted continental"
> > =A0 =A0 =A0 4 : print, "Feature Subtype : clean continental"
> > =A0 =A0 =A0 5 : print, "Feature Subtype : polluted dust"
> > =A0 =A0 =A0 6 : print, "Feature Subtype : smoke"
> > =A0 =A0 =A0 7 : print, "Feature Subtype : other"
> > =A0 =A0 =A0 else : print,"*** error getting Feature Subtype"
> > =A0 =A0 =A0 endcase
> > =A0 =A0 end
> > 4 : begin
> > =A0 =A0 =A0 print,"Feature Type : stratospheric feature--PSC or
> > stratospheric aerosol"
> > =A0 =A0 =A0 case feature_subtype of
> > =A0 =A0 =A0 0 : print, "Feature Subtype : not determined"
> > =A0 =A0 =A0 1 : print, "Feature Subtype : non-depolarizing PSC"
> > =A0 =A0 =A0 2 : print, "Feature Subtype : depolarizing PSC"
> > =A0 =A0 =A0 3 : print, "Feature Subtype : non-depolarizing aerosol"
> > =A0 =A0 =A0 4 : print, "Feature Subtype : depolarizing aerosol"
> > =A0 =A0 =A0 5 : print, "Feature Subtype : spare"
> > =A0 =A0 =A0 6 : print, "Feature Subtype : spare"
> > =A0 =A0 =A0 7 : print, "Feature Subtype : other"
> > =A0 =A0 =A0 else : print,"*** error getting Feature Subtype"
> > =A0 =A0 =A0 endcase
> > =A0 =A0 end
> > 5 : print,"Feature Type : surface"
> > 6 : print,"Feature Type : subsurface"
> > 7 : print,"Feature Type : no signal (totally attenuated)"
> > else : print,"*** error getting Feature Type"
> > endcase
>
> > case feature_type_qa of
> > 0 : print,"Feature Type QA : none"
> > 1 : print,"Feature Type QA : low"
> > 2 : print,"Feature Type QA : medium"
> > 3 : print,"Feature Type QA : high"
> > else : print,"*** error getting Feature Type QA"
> > endcase
>
> > case ice_water_phase of
> > 0 : print,"Ice/Water Phase : unknown/not determined"
> > 1 : print,"Ice/Water Phase : ice"
> > 2 : print,"Ice/Water Phase : water"
> > 3 : print,"Ice/Water Phase : mixed phase"
> > else : print,"*** error getting Ice/Water Phase"
> > endcase
>
> > case ice_water_phase_qa of
> > 0 : print,"Ice/Water Phase QA: none"
> > 1 : print,"Ice/Water Phase QA: low"
> > 2 : print,"Ice/Water Phase QA: medium"
> > 3 : print,"Ice/Water Phase QA: high"
> > else : print,"*** error getting Ice/Water Phase QA"
> > endcase
>
> > if (cloud_aerosol_psc_type_qa eq 0) then begin
> > =A0 print,"Cloud/Aerosol/PSC Type QA : not confident"
> > endif else begin
> > =A0 print,"Cloud/Aerosol/PSC Type QA : confident"
> > endelse
>
> > case horizontal_averaging of
> > 0 : print,"Horizontal averaging required for detection: not
> > applicable"
> > 1 : print,"Horizontal averaging required for detection: 1/3 km"
> > 2 : print,"Horizontal averaging required for detection: 1 km"
> > 3 : print,"Horizontal averaging required for detection: 5 km"
> > 4 : print,"Horizontal averaging required for detection: 20 km"
> > 5 : print,"Horizontal averaging required for detection: 80 km"
> > else : print,"*** error getting Horizontal averaging"
> > endcase
> > end
>
> Rather than a string array, I would use an anonymous structure for
> this sort of information:
>
> e.g.
> Data =3D {Type:"", Subtype:"", QA:"", Phase:"", PhaseQA:"", TypeQA:""} ;
> etc
> This creates a set of empty string fields.
>
> then you can read in your strings like this:
> data.type =3D 'cloud'
>
> and retrieve your information like this:
> help, data, /struct
> IDL> ** Structure <ff8a18>, 6 tags, length=3D72, data length=3D72,
refs=3D=
1:
> =A0 =A0TYPE =A0 =A0 =A0 =A0 =A0 =A0STRING =A0 =A0'cloud'
> =A0 =A0SUBTYPE =A0 =A0 =A0 =A0 STRING =A0 =A0''
> =A0 =A0QA =A0 =A0 =A0 =A0 =A0 =A0 =A0STRING =A0 =A0''
> =A0 =A0PHASE =A0 =A0 =A0 =A0 =A0 STRING =A0 =A0''
> =A0 =A0PHASEQA =A0 =A0 =A0 =A0 STRING =A0 =A0''
> =A0 =A0TYPEQA =A0 =A0 =A0 =A0 =A0STRING =A0 =A0''
>
> Reading in your strings could probably be done into a string array
> either if you really want to:
> Result =3D STRARR[n]
> FOR i =3D 0, n-1 DO BEGIN
> Result[i] =3D 'Cloud'
> ENDFOR ; etc.
>
> Also, you can probably use format codes to convert your bytes/integers
> to set bits, something along the lines of:
> CloudBits =3D STRING(CloudByte, FORMAT=3D'(B0)')
> NCloudBits =3D STRLEN(CloudBits)
>
> Which I can imagine would make determining your string contents a bit
> easier. I can't remember exactly, and I'm stuck with demo-mode only
> today(!), so you'll have to play around with it yourself, unless
> someone more knowledgeable jumps in with a fuller explanation.
>
> Good luck!
> Chris

Hi Chris,
Thanks for your quick reply.
I am using this routine in my program "vfm_feature_flags,36282"
This one is changing every time. Just I want to store o/p information
into a string.
Your program is simple, but I could not understand clearly. For
example I want to store "Feature Subtype : cirrus (transparent)  " and
this one is changing every time. Some times cirrus and some times
convective ..

Could you give me little clearly then I can follow.

Thanking you,

Kishore




 9 Posts in Topic:
storing in array
kishore1818@[EMAIL PROTEC  2008-05-10 16:48:08 
Re: storing in array
Spon <christoph.blau@[  2008-05-11 01:11:04 
Re: storing in array
kishore1818@[EMAIL PROTEC  2008-05-11 14:26:37 
Re: storing in array
Spon <christoph.blau@[  2008-05-12 03:03:03 
Re: storing in array
Spon <christoph.blau@[  2008-05-12 04:18:51 
Re: storing in array
Spon <christoph.blau@[  2008-05-12 07:09:15 
Re: storing in array
kishore1818@[EMAIL PROTEC  2008-05-12 08:35:26 
Re: storing in array
Spon <christoph.blau@[  2008-05-12 09:06:03 
Re: storing in array
kishore1818@[EMAIL PROTEC  2008-05-12 10:29:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 22:29:05 CDT 2008.